aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-28 19:23:39 -0800
committerfriendica <info@friendica.com>2012-11-28 19:23:39 -0800
commite1380525841509ae9bf05c11bf27f655567e63ae (patch)
tree6b35beb1b89acbac1d115f127c8b6932eed9acb1 /mod
parent05e08cb5d2967a12c479ab94187b1ef1bde0a094 (diff)
downloadvolse-hubzilla-e1380525841509ae9bf05c11bf27f655567e63ae.tar.gz
volse-hubzilla-e1380525841509ae9bf05c11bf27f655567e63ae.tar.bz2
volse-hubzilla-e1380525841509ae9bf05c11bf27f655567e63ae.zip
backport features categories and add some new ones like the affinity slider
Diffstat (limited to 'mod')
-rw-r--r--mod/connections.php23
-rw-r--r--mod/network.php39
-rw-r--r--mod/settings.php13
3 files changed, 42 insertions, 33 deletions
diff --git a/mod/connections.php b/mod/connections.php
index addebc9cd..877d5d5c3 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -359,16 +359,19 @@ EOT;
$tpl = get_markup_template("abook_edit.tpl");
- $slider_tpl = get_markup_template('contact_slider.tpl');
- $slide = replace_macros($slider_tpl,array(
- '$me' => t('Me'),
- '$val' => $contact['abook_closeness'],
- '$intimate' => t('Best Friends'),
- '$friends' => t('Friends'),
- '$oldfriends' => t('Former Friends'),
- '$acquaintances' => t('Acquaintances'),
- '$world' => t('Unknown')
- ));
+ if(feature_enabled(local_user(),'affinity')) {
+
+ $slider_tpl = get_markup_template('contact_slider.tpl');
+ $slide = replace_macros($slider_tpl,array(
+ '$me' => t('Me'),
+ '$val' => $contact['abook_closeness'],
+ '$intimate' => t('Best Friends'),
+ '$friends' => t('Friends'),
+ '$oldfriends' => t('Former Friends'),
+ '$acquaintances' => t('Acquaintances'),
+ '$world' => t('Unknown')
+ ));
+ }
$perms = array();
$channel = $a->get_channel();
diff --git a/mod/network.php b/mod/network.php
index a0f4ab354..c86bbc261 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -368,26 +368,27 @@ function network_content(&$a, $update = 0, $load = false) {
if(! $update) {
-
- $tpl = get_markup_template('main_slider.tpl');
- $o .= replace_macros($tpl,array(
- '$val' => intval($cmin) . ';' . intval($cmax),
- '$refresh' => t('Refresh'),
- '$me' => t('Me'),
- '$intimate' => t('Best Friends'),
- '$friends' => t('Friends'),
- '$coworkers' => t('Co-workers'),
- '$oldfriends' => t('Former Friends'),
- '$acquaintances' => t('Acquaintances'),
- '$world' => t('Everybody')
- ));
+ if(feature_enabled(local_user(),'affinity')) {
+ $tpl = get_markup_template('main_slider.tpl');
+ $o .= replace_macros($tpl,array(
+ '$val' => intval($cmin) . ';' . intval($cmax),
+ '$refresh' => t('Refresh'),
+ '$me' => t('Me'),
+ '$intimate' => t('Best Friends'),
+ '$friends' => t('Friends'),
+ '$coworkers' => t('Co-workers'),
+ '$oldfriends' => t('Former Friends'),
+ '$acquaintances' => t('Acquaintances'),
+ '$world' => t('Everybody')
+ ));
+ }
- $arr = array('tabs' => $tabs);
- call_hooks('network_tabs', $arr);
+ $arr = array('tabs' => $tabs);
+ call_hooks('network_tabs', $arr);
- $o .= replace_macros(get_markup_template('common_tabs.tpl'), array('$tabs'=> $arr['tabs']));
+ $o .= replace_macros(get_markup_template('common_tabs.tpl'), array('$tabs'=> $arr['tabs']));
- // --- end item filter tabs
+ // --- end item filter tabs
// search terms header
@@ -666,7 +667,7 @@ function network_content(&$a, $update = 0, $load = false) {
);
}
else {
-dbg(1);
+
$r = q("SELECT item.id AS item_id FROM item
left join abook on item.author_xchan = abook.abook_xchan
WHERE item.uid = %d AND item.item_restrict = 0
@@ -677,7 +678,7 @@ dbg(1);
intval(local_user()),
intval(ABOOK_FLAG_BLOCKED)
);
-dbg(0);
+
}
// Then fetch all the children of the parents that are on this page
diff --git a/mod/settings.php b/mod/settings.php
index 5c3d7dead..ef52388e2 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -654,17 +654,22 @@ function settings_content(&$a) {
$arr = array();
$features = get_features();
- foreach($features as $f) {
- $arr[] = array('feature_' .$f[0],$f[1],((intval(get_pconfig(local_user(),'feature',$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
+
+ foreach($features as $fname => $fdata) {
+ $arr[$fname] = array();
+ $arr[$fname][0] = $fdata[0];
+ foreach(array_slice($fdata,1) as $f) {
+ $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(get_pconfig(local_user(),'feature',$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
+ }
}
-
$tpl = get_markup_template("settings_features.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_features"),
'$title' => t('Additional Features'),
'$features' => $arr,
- '$submit' => t('Submit')
+ '$submit' => t('Submit'),
+ '$field_yesno' => 'field_yesno.tpl',
));
return $o;
}