From 8d6441704bdc8d0628149dbb32321b6921f097ba Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 30 May 2018 14:06:18 +0200 Subject: add widget files and templates --- Zotlabs/Widget/Activity_filter.php | 66 ++++++++++++++++++++++ Zotlabs/Widget/Activity_order.php | 111 +++++++++++++++++++++++++++++++++++++ view/tpl/common_pills.tpl | 8 +++ 3 files changed, 185 insertions(+) create mode 100644 Zotlabs/Widget/Activity_filter.php create mode 100644 Zotlabs/Widget/Activity_order.php create mode 100755 view/tpl/common_pills.tpl diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php new file mode 100644 index 000000000..a60144239 --- /dev/null +++ b/Zotlabs/Widget/Activity_filter.php @@ -0,0 +1,66 @@ + t('Personal Posts'), + 'icon' => 'user-circle', + 'url' => z_root() . '/' . $cmd . '?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&conv=1', + 'sel' => $conv_active, + 'title' => t('Posts that mention or involve you'), + ); + } + + if(feature_enabled(local_channel(),'star_posts')) { + $tabs[] = array( + 'label' => t('Starred Posts'), + 'icon' => 'star', + 'url'=>z_root() . '/' . $cmd . '/?f=' . ((x($_GET,'order')) ? '&order=' . $_GET['order'] : '') . '&star=1', + 'sel'=>$starred_active, + 'title' => t('Favourite Posts'), + ); + } + + + $arr = ['tabs' => $tabs]; + + call_hooks('network_tabs', $arr); + + $tpl = get_markup_template('common_pills.tpl'); + + if($arr['tabs']) { + return replace_macros($tpl, [ + '$title' => t('Additional Filters'), + '$tabs' => $arr['tabs'], + ]); + } + else { + return ''; + } + } + +} diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php new file mode 100644 index 000000000..ba288965f --- /dev/null +++ b/Zotlabs/Widget/Activity_order.php @@ -0,0 +1,111 @@ + t('Commented Date'), + 'url'=>z_root() . '/' . $cmd . '?f=&order=comment' . $filter, + 'sel'=> $commentord_active, + 'title' => t('Sort by Comment Date'), + ]; + $tabs[] = [ + 'label' => t('Posted Date'), + 'url'=>z_root() . '/' . $cmd . '?f=&order=post' . $filter, + 'sel'=> $postord_active, + 'title' => t('Sort by Post Date'), + ]; + $tabs[] = array( + 'label' => t('Date Unthreaded'), + 'url' => z_root() . '/' . $cmd . '?f=&order=unthreaded' . $filter, + 'sel' => $unthreaded_active, + 'title' => t('Activity Stream - by date'), + ); + + $arr = ['tabs' => $tabs]; + + call_hooks('network_tabs', $arr); + + $tpl = get_markup_template('common_pills.tpl'); + + if($arr['tabs']) { + return replace_macros($tpl, [ + '$title' => t('Order Activity by'), + '$tabs' => $arr['tabs'], + ]); + } + else { + return ''; + } + } + +} diff --git a/view/tpl/common_pills.tpl b/view/tpl/common_pills.tpl new file mode 100755 index 000000000..d10aa365b --- /dev/null +++ b/view/tpl/common_pills.tpl @@ -0,0 +1,8 @@ +
+

{{$title}}

+ +
-- cgit v1.2.3