diff options
Diffstat (limited to 'Zotlabs/Widget')
-rw-r--r-- | Zotlabs/Widget/Affinity.php | 84 | ||||
-rw-r--r-- | Zotlabs/Widget/Notifications.php | 8 | ||||
-rw-r--r-- | Zotlabs/Widget/Settings_menu.php | 7 |
3 files changed, 51 insertions, 48 deletions
diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php index 4fb2874ae..572af0503 100644 --- a/Zotlabs/Widget/Affinity.php +++ b/Zotlabs/Widget/Affinity.php @@ -2,55 +2,65 @@ namespace Zotlabs\Widget; +use Zotlabs\Lib\Apps; + class Affinity { function widget($arr) { if(! local_channel()) - return ''; - - $default_cmin = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0); - $default_cmax = ((feature_enabled(local_channel(),'affinity')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99); + return; + + if(! Apps::system_app_installed(local_channel(),'Affinity Tool')) + return; + + $default_cmin = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmin',0) : 0); + $default_cmax = ((Apps::system_app_installed(local_channel(),'Affinity Tool')) ? get_pconfig(local_channel(),'affinity','cmax',99) : 99); $cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin); $cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax); + $affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1)); + if ($affinity_locked) { + set_pconfig(local_channel(),'affinity','cmin',$cmin); + set_pconfig(local_channel(),'affinity','cmax',$cmax); + } + + $labels = array( + t('Me'), + t('Family'), + t('Friends'), + t('Acquaintances'), + t('All') + ); + call_hooks('affinity_labels',$labels); + + $label_str = ''; - if(feature_enabled(local_channel(),'affinity')) { - - $labels = array( - t('Me'), - t('Family'), - t('Friends'), - t('Acquaintances'), - t('All') - ); - call_hooks('affinity_labels',$labels); - $label_str = ''; - - if($labels) { - foreach($labels as $l) { - if($label_str) { - $label_str .= ", '|'"; - $label_str .= ", '" . $l . "'"; - } - else - $label_str .= "'" . $l . "'"; + if($labels) { + foreach($labels as $l) { + if($label_str) { + $label_str .= ", '|'"; + $label_str .= ", '" . $l . "'"; } + else + $label_str .= "'" . $l . "'"; } - - $tpl = get_markup_template('main_slider.tpl'); - $x = replace_macros($tpl,array( - '$val' => $cmin . ',' . $cmax, - '$refresh' => t('Refresh'), - '$labels' => $label_str, - )); - - $arr = array('html' => $x); - call_hooks('main_slider',$arr); - return $arr['html']; } - return ''; + + $tpl = get_markup_template('main_slider.tpl'); + $x = replace_macros($tpl,array( + '$val' => $cmin . ',' . $cmax, + '$refresh' => t('Refresh'), + '$labels' => $label_str, + )); + + $arr = array('html' => $x); + call_hooks('main_slider',$arr); + + return $arr['html']; + + } } -
\ No newline at end of file + diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php index 0f9f609e4..37d9139ec 100644 --- a/Zotlabs/Widget/Notifications.php +++ b/Zotlabs/Widget/Notifications.php @@ -24,7 +24,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; @@ -43,7 +43,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; @@ -119,7 +119,7 @@ class Notifications { 'label' => t('Forums'), 'title' => t('Forums'), 'filter' => [ - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; } @@ -150,7 +150,7 @@ class Notifications { ], 'filter' => [ 'posts_label' => t('Show new posts only'), - 'name_label' => t('Filter by name') + 'name_label' => t('Filter by name or address') ] ]; } diff --git a/Zotlabs/Widget/Settings_menu.php b/Zotlabs/Widget/Settings_menu.php index c537c3835..25b80a4b4 100644 --- a/Zotlabs/Widget/Settings_menu.php +++ b/Zotlabs/Widget/Settings_menu.php @@ -42,19 +42,12 @@ class Settings_menu { ); - $tabs[] = array( 'label' => t('Display settings'), 'url' => z_root().'/settings/display', 'selected' => ((argv(1) === 'display') ? 'active' : ''), ); - $tabs[] = array( - 'label' => t('Addon settings'), - 'url' => z_root().'/settings/featured', - 'selected' => ((argv(1) === 'featured') ? 'active' : ''), - ); - if($hublocs) { $tabs[] = array( 'label' => t('Manage locations'), |