diff options
Diffstat (limited to 'Zotlabs/Module/Wiki.php')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index f879e221a..4dc11c683 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -42,7 +42,7 @@ class Wiki extends \Zotlabs\Web\Controller { if(! feature_enabled(\App::$profile_uid,'wiki')) { notice( t('Not found') . EOL); - return; + return; } @@ -76,6 +76,8 @@ class Wiki extends \Zotlabs\Web\Controller { $wiki_owner = true; + nav_set_selected(t('Wiki')); + // Obtain the default permission settings of the channel $owner_acl = array( 'allow_cid' => $owner['channel_allow_cid'], @@ -192,6 +194,7 @@ class Wiki extends \Zotlabs\Web\Controller { goaway(z_root() . '/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/Home'); case 4: + default: // GET /wiki/channel/wiki/page // Fetch the wiki info and determine observer permissions @@ -243,9 +246,15 @@ class Wiki extends \Zotlabs\Web\Controller { $wikiheaderPage = urldecode($pageUrlName); $renamePage = (($wikiheaderPage === 'Home') ? '' : t('Rename page')); + $p = []; - $p = Zlib\NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); - if(! $p['success']) { + if(! $ignore_language) { + $p = Zlib\NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $langPageUrlName)); + } + if(! ($p && $p['success'])) { + $p = Zlib\NativeWikiPage::get_page_content(array('channel_id' => $owner['channel_id'], 'observer_hash' => $observer_hash, 'resource_id' => $resource_id, 'pageUrlName' => $pageUrlName)); + } + if(! ($p && $p['success'])) { notice( t('Error retrieving page content') . EOL); goaway(z_root() . '/' . argv(0) . '/' . argv(1) ); } @@ -267,8 +276,8 @@ class Wiki extends \Zotlabs\Web\Controller { } $showPageControls = $wiki_editor; break; - default: // Strip the extraneous URL components - goaway('/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName); +// default: // Strip the extraneous URL components +// goaway('/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName); } @@ -348,6 +357,7 @@ class Wiki extends \Zotlabs\Web\Controller { $html = Zlib\NativeWikiPage::convert_links(zidify_links(smilies(bbcode($content))),$wikiURL); } else { + $bb = Zlib\NativeWikiPage::bbcode($content); $x = new ZLib\MarkdownSoap($bb); $md = $x->clean(); |