diff options
author | Friendika <info@friendika.com> | 2011-06-29 20:42:16 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-06-29 20:42:16 -0700 |
commit | 58d474aa2df712e402b6c5fd1ade98df51adaa93 (patch) | |
tree | a80b2670e51a37140c462d261513be44b7712c35 | |
parent | ae0275ec2ce65dd4ae89a6d5ba5822318e8e5f55 (diff) | |
download | volse-hubzilla-58d474aa2df712e402b6c5fd1ade98df51adaa93.tar.gz volse-hubzilla-58d474aa2df712e402b6c5fd1ade98df51adaa93.tar.bz2 volse-hubzilla-58d474aa2df712e402b6c5fd1ade98df51adaa93.zip |
switch to text mode group editor after 'n' contacts
-rw-r--r-- | mod/group.php | 14 | ||||
-rw-r--r-- | mod/profperm.php | 17 |
2 files changed, 27 insertions, 4 deletions
diff --git a/mod/group.php b/mod/group.php index 2d7ea8c11..fd54b0eff 100644 --- a/mod/group.php +++ b/mod/group.php @@ -68,6 +68,14 @@ function group_content(&$a) { return; } + // Switch to text mod interface if we have more than 'n' contacts or group members + + $switchtotext = get_pconfig(local_user(),'system','groupedit_image_limit'); + if($switchtotext === false) + $switchtotext = get_config('system','groupedit_image_limit'); + if($switchtotext === false) + $switchtotext = 400; + if(($a->argc == 2) && ($a->argv[1] === 'new')) { $tpl = get_markup_template('group_new.tpl'); $o .= replace_macros($tpl,array( @@ -170,10 +178,11 @@ function group_content(&$a) { $o .= '<div id="group-members">'; $o .= '<h3>' . t('Members') . '</h3>'; + $textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false); foreach($members as $member) { if($member['url']) { $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpgroup'); + $o .= micropro($member,true,'mpgroup', $textmode); } else group_rmv_member(local_user(),$group['name'],$member['id']); @@ -189,10 +198,11 @@ function group_content(&$a) { ); if(count($r)) { + $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); foreach($r as $member) { if(! in_array($member['id'],$preselected)) { $member['click'] = 'groupChangeMember(' . $group['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpall'); + $o .= micropro($member,true,'mpall', $textmode); } } } diff --git a/mod/profperm.php b/mod/profperm.php index e70992a2b..33479cad1 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -26,6 +26,15 @@ function profperm_content(&$a) { return; } + // Switch to text mod interface if we have more than 'n' contacts or group members + + $switchtotext = get_pconfig(local_user(),'system','groupedit_image_limit'); + if($switchtotext === false) + $switchtotext = get_config('system','groupedit_image_limit'); + if($switchtotext === false) + $switchtotext = 400; + + if(($a->argc > 2) && intval($a->argv[1]) && intval($a->argv[2])) { $r = q("SELECT `id` FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `self` = 0 AND `network` = 'dfrn' AND `id` = %d AND `uid` = %d LIMIT 1", @@ -103,10 +112,13 @@ function profperm_content(&$a) { $o .= '<div id="prof-members">'; $o .= '<h3>' . t('Visible To') . '</h3>'; + + $textmode = (($switchtotext && (count($members) > $switchtotext)) ? true : false); + foreach($members as $member) { if($member['url']) { $member['click'] = 'profChangeMember(' . $profile['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpprof'); + $o .= micropro($member,true,'mpprof', $textmode); } } $o .= '</div><div id="prof-members-end"></div>'; @@ -120,10 +132,11 @@ function profperm_content(&$a) { ); if(count($r)) { + $textmode = (($switchtotext && (count($r) > $switchtotext)) ? true : false); foreach($r as $member) { if(! in_array($member['id'],$ingroup)) { $member['click'] = 'profChangeMember(' . $profile['id'] . ',' . $member['id'] . '); return true;'; - $o .= micropro($member,true,'mpprof'); + $o .= micropro($member,true,'mpprof',$textmode); } } } |