diff options
author | Andrew Manning <tamanning@zoho.com> | 2016-05-28 07:17:42 -0400 |
---|---|---|
committer | Andrew Manning <tamanning@zoho.com> | 2016-05-28 07:17:42 -0400 |
commit | f884fa66782544cd6fc44a81b978a905d4755cea (patch) | |
tree | 8330844f0e1c2f6b2ab6b80836fc3437bc38dc12 /include/widgets.php | |
parent | 4691c3ec01eda972e7b4cae4ec940c8c24d51b5a (diff) | |
download | volse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.tar.gz volse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.tar.bz2 volse-hubzilla-f884fa66782544cd6fc44a81b978a905d4755cea.zip |
Wiki page list is fetched and the page widget is updated
Diffstat (limited to 'include/widgets.php')
-rw-r--r-- | include/widgets.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/include/widgets.php b/include/widgets.php index 1cc6dfc28..0d734d6cf 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -877,14 +877,21 @@ function widget_wiki_list($arr) { 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'] - )); + $pages = array(); + if (!array_key_exists('resource_id', $arr)) { + $hide = true; + } else { + $p = wiki_page_list($arr['resource_id']); + if ($p['pages']) { + $pages = $p['pages']; + } } + return replace_macros(get_markup_template('wiki_page_list.tpl'), array( + '$hide' => $hide, + '$header' => t('Wiki Pages'), + '$pages' => $pages + )); } function widget_bookmarkedchats($arr) { |