aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-11-29 02:57:58 -0800
committerzotlabs <mike@macgirvin.com>2016-11-29 02:57:58 -0800
commit3ed6d823677e5bfb5e3345b7ea0992d4585a929e (patch)
tree0b47c445ec2c6da01356abf8b2547f19ddd13c33 /Zotlabs/Module
parent793047919d493cd8cd15613f5a0df846113a5e29 (diff)
parentd184b3fa8674a349b274b69655b8e8c38dab064b (diff)
downloadvolse-hubzilla-3ed6d823677e5bfb5e3345b7ea0992d4585a929e.tar.gz
volse-hubzilla-3ed6d823677e5bfb5e3345b7ea0992d4585a929e.tar.bz2
volse-hubzilla-3ed6d823677e5bfb5e3345b7ea0992d4585a929e.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Wiki.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 37ebe2a38..edd783a62 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -34,10 +34,7 @@ class Wiki extends \Zotlabs\Web\Controller {
notice( t('Not found') . EOL);
return;
}
-
- $tab = 'wiki';
-
-
+
require_once('include/wiki.php');
require_once('include/acl_selectors.php');
require_once('include/conversation.php');
@@ -151,6 +148,7 @@ class Wiki extends \Zotlabs\Web\Controller {
'$create' => t('Create New'),
'$submit' => t('Submit'),
'$wikiName' => array('wikiName', t('Wiki name')),
+ '$mimeType' => array('mimeType', t('Content type'), '', '', ['text/markdown' => 'Markdown', 'text/bbcode' => 'BB Code']),
'$name' => t('Name'),
'$lockstate' => $x['lockstate'],
'$acl' => $x['acl'],
@@ -315,17 +313,19 @@ class Wiki extends \Zotlabs\Web\Controller {
if (local_channel() !== intval($owner['channel_id'])) {
goaway('/' . argv(0) . '/' . $nick . '/');
}
-
$wiki = array();
// Generate new wiki info from input name
$wiki['postVisible'] = ((intval($_POST['postVisible']) === 0) ? 0 : 1);
$wiki['rawName'] = $_POST['wikiName'];
$wiki['htmlName'] = escape_tags($_POST['wikiName']);
$wiki['urlName'] = urlencode($_POST['wikiName']);
+ $wiki['mimeType'] = $_POST['mimeType'];
+
if($wiki['urlName'] === '') {
notice( t('Error creating wiki. Invalid name.') . EOL);
goaway('/wiki');
}
+
// Get ACL for permissions
$acl = new \Zotlabs\Access\AccessList($owner);
$acl->set_from_array($_POST);
@@ -387,7 +387,7 @@ class Wiki extends \Zotlabs\Web\Controller {
'commit_msg' => t('New page created'),
'resource_id' => $resource_id,
'observer' => $ob,
- 'files' => array($page['page']['urlName'].'.md')
+ 'files' => array($page['page']['fileName'])
));
if($commit['success']) {
json_return_and_die(array('url' => '/'.argv(0).'/'.argv(1).'/'.$page['wiki']['urlName'].'/'.$page['page']['urlName'], 'success' => true));
@@ -443,7 +443,7 @@ class Wiki extends \Zotlabs\Web\Controller {
'commit_msg' => $commitMsg,
'resource_id' => $resource_id,
'observer' => $ob,
- 'files' => array($pageUrlName.'.md')
+ 'files' => array($saved['fileName'])
));
if($commit['success']) {
json_return_and_die(array('message' => 'Wiki git repo commit made', 'success' => true));
@@ -582,7 +582,7 @@ class Wiki extends \Zotlabs\Web\Controller {
'commit_msg' => 'Renamed ' . urldecode($pageUrlName) . ' to ' . $renamed['page']['htmlName'],
'resource_id' => $resource_id,
'observer' => $ob,
- 'files' => array($pageUrlName . '.md', $renamed['page']['fileName']),
+ 'files' => array($pageUrlName . substr($renamed['page']['fileName'], -3), $renamed['page']['fileName']),
'all' => true
));
if($commit['success']) {