Only show wiki delete control if channel owner

This commit is contained in:
Andrew Manning
2016-05-29 20:39:19 -04:00
parent fad27fc1e7
commit 00d32f6b94
4 changed files with 16 additions and 7 deletions

View File

@@ -857,19 +857,25 @@ function widget_chatroom_members() {
function widget_wiki_list($arr) {
require_once("include/wiki.php");
if(argc()>1) {
if (argc() > 1) {
$nick = argv(1);
$channel = get_channel_by_nick($nick);
} else {
$channel = \App::get_channel();
$nick = $channel['channel_address'];
}
$wikis = wiki_list($nick, get_observer_hash());
if($wikis) {
$wikis = wiki_list($channel, get_observer_hash());
if (local_channel() === intval($channel['channel_id'])) {
$showControls = true;
} else {
$showControls = false;
}
if ($wikis) {
return replace_macros(get_markup_template('wikilist.tpl'), array(
'$header' => t('Wiki List'),
'$channel' => $nick,
'$wikis' => $wikis['wikis']
'$wikis' => $wikis['wikis'],
'$showControls' => $showControls
));
}
}