diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-05-30 14:06:18 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-05-30 14:06:18 +0200 |
commit | 8d6441704bdc8d0628149dbb32321b6921f097ba (patch) | |
tree | cfa87c133ebadf47a1ae4d9961e1ff83ae3dee49 /Zotlabs/Widget/Activity_filter.php | |
parent | 9fcb3bf2e8fab84f9144eecceaf984b2026e6d08 (diff) | |
download | volse-hubzilla-8d6441704bdc8d0628149dbb32321b6921f097ba.tar.gz volse-hubzilla-8d6441704bdc8d0628149dbb32321b6921f097ba.tar.bz2 volse-hubzilla-8d6441704bdc8d0628149dbb32321b6921f097ba.zip |
add widget files and templates
Diffstat (limited to 'Zotlabs/Widget/Activity_filter.php')
-rw-r--r-- | Zotlabs/Widget/Activity_filter.php | 66 |
1 files changed, 66 insertions, 0 deletions
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 @@ +<?php + +namespace Zotlabs\Widget; + +class Activity_filter { + + function widget($arr) { + + if(! local_channel()) + return ''; + + $starred_active = ''; + $conv_active = ''; + + if(x($_GET,'star')) { + $starred_active = 'active'; + } + + if(x($_GET,'conv')) { + $conv_active = 'active'; + } + + $cmd = \App::$cmd; + + // tabs + $tabs = []; + + if(feature_enabled(local_channel(),'personal_tab')) { + $tabs[] = array( + 'label' => 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 ''; + } + } + +} |