diff --git a/include/widgets.php b/include/widgets.php index 071622387..86f0305df 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -917,7 +917,11 @@ function widget_wiki_list($arr) { '$channel' => $channel['channel_address'], '$wikis' => $wikis['wikis'], // If the observer is the local channel owner, show the wiki controls - '$owner' => ((local_channel() === intval($channel['channel_id'])) ? true : false) + '$owner' => ((local_channel() && local_channel() === intval(\App::$profile['uid'])) ? true : false), + '$edit' => t('Edit'), + '$download' => t('Download'), + '$view' => t('View'), + '$addnew' => t('Add new wiki') )); } return ''; @@ -948,13 +952,17 @@ function widget_wiki_pages($arr) { } } } + $can_create = perm_is_allowed(\App::$profile['uid'],get_observer_hash(),'write_pages'); + return replace_macros(get_markup_template('wiki_page_list.tpl'), array( '$hide' => $hide, '$not_refresh' => $not_refresh, '$header' => t('Wiki Pages'), '$channel' => $channelname, '$wikiname' => $wikiname, - '$pages' => $pages + '$pages' => $pages, + '$canadd' => $can_create, + '$addnew' => t('Add new page'), )); } diff --git a/view/css/widgets.css b/view/css/widgets.css index 2a7c57f53..10c66c213 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -151,3 +151,7 @@ li:hover .group-edit-icon { .cover-photo-subtitle { font-size: 20px; } + +a.wikilist { + z-index: 1; +} diff --git a/view/tpl/wiki_page_list.tpl b/view/tpl/wiki_page_list.tpl index c5f3ec9a0..c020f2520 100644 --- a/view/tpl/wiki_page_list.tpl +++ b/view/tpl/wiki_page_list.tpl @@ -1,12 +1,14 @@ {{if $not_refresh}}{{/if}} diff --git a/view/tpl/wikilist.tpl b/view/tpl/wikilist.tpl index 42452eb12..da4c4b615 100644 --- a/view/tpl/wikilist.tpl +++ b/view/tpl/wikilist.tpl @@ -1,17 +1,15 @@
- -

{{$header}} - -

- -
+

{{$header}}

+
+ {{/if}} + {{if $owner}}
  •  {{$addnew}}
  • {{/if}} +