diff options
Diffstat (limited to 'include/widgets.php')
-rw-r--r-- | include/widgets.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/widgets.php b/include/widgets.php index c4b80afd0..1cc6dfc28 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -854,6 +854,39 @@ function widget_chatroom_members() { return $o; } +function widget_wiki_list($arr) { + + require_once("include/wiki.php"); + if(argc()>1) { + $nick = argv(1); + } else { + $channel = \App::get_channel(); + $nick = $channel['channel_address']; + } + $wikis = wiki_list($nick, get_observer_hash()); + + if($wikis) { + return replace_macros(get_markup_template('wikilist.tpl'), array( + '$header' => t('Wiki List'), + '$channel' => $nick, + '$wikis' => $wikis['wikis'] + )); + } +} + +function widget_wiki_pages($arr) { + + require_once("include/wiki.php"); + $r = wiki_pages(App::$profile['channel_hash']); + + if($r) { + return replace_macros(get_markup_template('wiki_page_list.tpl'), array( + '$header' => t('Wiki Pages'), + '$pages' => $r['pages'] + )); + } +} + function widget_bookmarkedchats($arr) { if(! feature_enabled(App::$profile['profile_uid'],'ajaxchat')) |