diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-30 14:59:33 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-30 14:59:33 -0400 |
commit | a52cdcb2410fc67823a3dab62b413d70ec57cdec (patch) | |
tree | db3e9309d7892644bc2055296e3bc0ef5a37fea2 /Zotlabs | |
parent | 8f0c3f0e9be676e08b886af2d872cf9d544680bd (diff) | |
download | volse-hubzilla-a52cdcb2410fc67823a3dab62b413d70ec57cdec.tar.gz volse-hubzilla-a52cdcb2410fc67823a3dab62b413d70ec57cdec.tar.bz2 volse-hubzilla-a52cdcb2410fc67823a3dab62b413d70ec57cdec.zip |
Replaced wiki item record object field with ActivityStreams information. Wiki git repo path is stored in iconfig instead.
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Wiki.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 030e34cf6..d6acbf6b0 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -27,6 +27,7 @@ class Wiki extends \Zotlabs\Web\Controller { require_once('include/wiki.php'); require_once('include/acl_selectors.php'); $wiki_owner = false; + $showNewWikiButton = false; if(local_channel()) { $channel = \App::get_channel(); } @@ -47,15 +48,16 @@ class Wiki extends \Zotlabs\Web\Controller { $resource_id = ''; $pagename = ''; - + if(argc() > 1) { + $channel = get_channel_by_nick(argv(1)); + if(local_channel() === intval($channel['channel_id'])) { + $wiki_owner = true; + } + } // GET https://hubzilla.hub/argv(0)/argv(1)/argv(2)/argv(3)/argv(4)/... if(argc() > 2) { // GET /wiki/channel/wiki // Check if wiki exists andr redirect if it does not - $channel = get_channel_by_nick(argv(1)); - if(local_channel() === intval($channel['channel_id'])) { - $wiki_owner = true; - } $w = wiki_exists_by_name($channel['channel_id'], argv(2)); if(!$w['resource_id']) { notice('Wiki not found' . EOL); @@ -81,6 +83,7 @@ class Wiki extends \Zotlabs\Web\Controller { $content = '"# Wiki Sandbox\n\nContent you **edit** and **preview** here *will not be saved*."'; $hide_editor = false; $showPageControls = false; + $showNewWikiButton = $wiki_owner; } elseif (argc()<4) { // GET /wiki/channel/wiki // No page was specified, so redirect to Home.md @@ -90,7 +93,8 @@ class Wiki extends \Zotlabs\Web\Controller { $hide_editor = true; // Until separate read and write permissions are implemented, only allow // the wiki owner to see page controls - $showPageControls = $wiki_owner; + $showPageControls = $wiki_owner; + $showNewWikiButton = $wiki_owner; } elseif (argc()<5) { // GET /wiki/channel/wiki/page $pagename = argv(3); @@ -102,6 +106,7 @@ class Wiki extends \Zotlabs\Web\Controller { $content = ($p['content'] !== '' ? $p['content'] : '"# New page\n"'); $hide_editor = false; $showPageControls = $wiki_owner; + $showNewWikiButton = $wiki_owner; } require_once('library/markdown.php'); $renderedContent = Markdown(json_decode($content)); @@ -110,6 +115,7 @@ class Wiki extends \Zotlabs\Web\Controller { '$wikiheader' => $wikiheader, '$hideEditor' => $hide_editor, '$showPageControls' => $showPageControls, + '$showNewWikiButton'=> $showNewWikiButton, '$channel' => $channel['channel_address'], '$resource_id' => $resource_id, '$page' => $pagename, |