From 3fd2e4b716aaf4626b774ac5d808cc4088e6f3f2 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 9 Apr 2015 19:51:58 -0700 Subject: program the affinity slider labels --- mod/connedit.php | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index 2c4c0cef8..70839e373 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -558,16 +558,32 @@ function connedit_content(&$a) { 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 . "'"; + } + } + $slider_tpl = get_markup_template('contact_slider.tpl'); $slide = replace_macros($slider_tpl,array( - '$me' => t('Me'), '$min' => 1, '$val' => (($contact['abook_closeness']) ? $contact['abook_closeness'] : 99), - '$intimate' => t('Best Friends'), - '$friends' => t('Friends'), - '$oldfriends' => t('Former Friends'), - '$acquaintances' => t('Acquaintances'), - '$world' => t('Unknown') + '$labels' => $label_str, )); } -- cgit v1.2.3 From 3a45206b9971ee981ea61de31c8413350ebcdd7b Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 14 Apr 2015 16:22:33 -0700 Subject: default perms not being set in some cases --- mod/connedit.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mod/connedit.php') diff --git a/mod/connedit.php b/mod/connedit.php index 70839e373..8ae1707ae 100644 --- a/mod/connedit.php +++ b/mod/connedit.php @@ -177,7 +177,17 @@ function connedit_post(&$a) { if(($_REQUEST['pending']) && ($abook_flags & ABOOK_FLAG_PENDING)) { $abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING ); $new_friend = true; + if(! $abook_my_perms) { + $abook_my_perms = get_channel_default_perms(local_channel()); + + $role = get_pconfig(local_channel(),'system','permissions_role'); + if($role) { + $x = get_role_perms($role); + if($x['perms_accept']) + $abook_my_perms = $x['perms_accept']; + } + } } $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_flags = %d -- cgit v1.2.3