aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-12-14 11:55:52 +0100
committerMario Vavti <mario@mariovavti.com>2016-12-14 11:55:52 +0100
commit028935a318e5848542faa551f3d39bbe8b365447 (patch)
treebb9d6b47318393c94093d838364cd9f81d16cc22 /Zotlabs
parent62353191e8759263d6279822d369ac1ae22f0a5f (diff)
downloadvolse-hubzilla-028935a318e5848542faa551f3d39bbe8b365447.tar.gz
volse-hubzilla-028935a318e5848542faa551f3d39bbe8b365447.tar.bz2
volse-hubzilla-028935a318e5848542faa551f3d39bbe8b365447.zip
wiki: do not show revert buttons if we do not have write perms and minor cleanup
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Wiki.php15
1 files changed, 4 insertions, 11 deletions
diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php
index 01a1bdc41..06a4d0f24 100644
--- a/Zotlabs/Module/Wiki.php
+++ b/Zotlabs/Module/Wiki.php
@@ -222,11 +222,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$html = wiki_generate_toc(zidify_text(purify_html(Markdown(wiki_bbcode(json_decode($content))))));
$renderedContent = wiki_convert_links($html,argv(0).'/'.argv(1).'/'.$wikiUrlName);
}
- $hide_editor = false;
$showPageControls = $wiki_editor;
- $showNewWikiButton = $wiki_owner;
- $showNewPageButton = $wiki_editor;
- $pageHistory = wiki_page_history(array('resource_id' => $resource_id, 'pageUrlName' => $pageUrlName));
break;
default: // Strip the extraneous URL components
goaway('/' . argv(0) . '/' . argv(1) . '/' . $wikiUrlName . '/' . $pageUrlName);
@@ -238,7 +234,7 @@ class Wiki extends \Zotlabs\Web\Controller {
$wikiModal = replace_macros(get_markup_template('generic_modal.tpl'), array(
'$id' => $wikiModalID,
'$title' => t('Revision Comparison'),
- '$ok' => t('Revert'),
+ '$ok' => (($showPageControls) ? t('Revert') : ''),
'$cancel' => t('Cancel')
));
@@ -246,13 +242,10 @@ class Wiki extends \Zotlabs\Web\Controller {
'$wikiheaderName' => $wikiheaderName,
'$wikiheaderPage' => $wikiheaderPage,
'$renamePage' => $renamePage,
- '$hideEditor' => $hide_editor, // True will completely hide the content section and is used for the case of no wiki selected
'$chooseWikiMessage' => t('Choose an available wiki from the list on the left.'),
'$showPageControls' => $showPageControls,
'$editOrSourceLabel' => (($showPageControls) ? t('Edit') : t('Source')),
'$tools_label' => 'Page Tools',
- '$showNewWikiButton'=> $showNewWikiButton,
- '$showNewPageButton'=> $showNewPageButton,
'$channel' => $owner['channel_address'],
'$resource_id' => $resource_id,
'$page' => $pageUrlName,
@@ -268,7 +261,6 @@ class Wiki extends \Zotlabs\Web\Controller {
'$renderedContent' => $renderedContent,
'$pageRename' => array('pageRename', t('New page name'), '', ''),
'$commitMsg' => array('commitMsg', '', '', '', '', 'placeholder="Short description of your changes (optional)"'),
- '$pageHistory' => $pageHistory['history'],
'$wikiModal' => $wikiModal,
'$wikiModalID' => $wikiModalID,
'$commit' => 'HEAD',
@@ -495,8 +487,9 @@ class Wiki extends \Zotlabs\Web\Controller {
}
$historyHTML = widget_wiki_page_history(array(
- 'resource_id' => $resource_id,
- 'pageUrlName' => $pageUrlName
+ 'resource_id' => $resource_id,
+ 'pageUrlName' => $pageUrlName,
+ 'permsWrite' => $perms['write']
));
json_return_and_die(array('historyHTML' => $historyHTML, 'message' => '', 'success' => true));
}