aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Widget/Affinity.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-02-14 11:06:52 +0100
committerMario Vavti <mario@mariovavti.com>2019-02-14 11:06:52 +0100
commit5ab917f606aa8221b50e39b9ff0b5182d271fe51 (patch)
tree2f0d9cb756f301acb07bb7ded230b46cf2c38a1f /Zotlabs/Widget/Affinity.php
parentea541ca21b7983f7b8f17deb7452b1afed29547b (diff)
downloadvolse-hubzilla-5ab917f606aa8221b50e39b9ff0b5182d271fe51.tar.gz
volse-hubzilla-5ab917f606aa8221b50e39b9ff0b5182d271fe51.tar.bz2
volse-hubzilla-5ab917f606aa8221b50e39b9ff0b5182d271fe51.zip
affinity tool fixes
Diffstat (limited to 'Zotlabs/Widget/Affinity.php')
-rw-r--r--Zotlabs/Widget/Affinity.php78
1 files changed, 39 insertions, 39 deletions
diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php
index 140d8f8ca..572af0503 100644
--- a/Zotlabs/Widget/Affinity.php
+++ b/Zotlabs/Widget/Affinity.php
@@ -9,10 +9,10 @@ class Affinity {
function widget($arr) {
if(! local_channel())
- return '';
-
-// replace feature_enabled(local_channel() with
-// Apps::system_app_installed(local_channel()
+ 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);
@@ -20,47 +20,47 @@ class Affinity {
$cmin = ((x($_REQUEST,'cmin')) ? intval($_REQUEST['cmin']) : $default_cmin);
$cmax = ((x($_REQUEST,'cmax')) ? intval($_REQUEST['cmax']) : $default_cmax);
- if(Apps::system_app_installed(local_channel(),'Affinity Tool')) {
+ $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);
+ }
- $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);
- $labels = array(
- t('Me'),
- t('Family'),
- t('Friends'),
- t('Acquaintances'),
- t('All')
- );
- call_hooks('affinity_labels',$labels);
- $label_str = '';
+ $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'];
+
+
}
}