diff options
-rw-r--r-- | include/acl_selectors.php | 97 |
1 files changed, 1 insertions, 96 deletions
diff --git a/include/acl_selectors.php b/include/acl_selectors.php index 4e203074b..bada3e528 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -5,104 +5,9 @@ * @package acl_selectors */ -/** - * @brief - * - * @param string $selname - * @param string $selclass - * @param mixed $preselected - * @param number $size - * @return string - */ -function group_select($selname, $selclass, $preselected = false, $size = 4) { - - $o = ''; - - $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\">\r\n"; - - $r = q("SELECT * FROM groups WHERE deleted = 0 AND uid = %d ORDER BY gname ASC", - intval(local_channel()) - ); - - - $arr = array('group' => $r, 'entry' => $o); - - // e.g. 'network_pre_group_deny', 'profile_pre_group_allow' - - call_hooks(App::$module . '_pre_' . $selname, $arr); - - if($r) { - foreach($r as $rr) { - if((is_array($preselected)) && in_array($rr['id'], $preselected)) - $selected = " selected=\"selected\" "; - else - $selected = ''; - $trimmed = mb_substr($rr['gname'],0,12); - - $o .= "<option value=\"{$rr['id']}\" $selected title=\"{$rr['name']}\" >$trimmed</option>\r\n"; - } - - } - $o .= "</select>\r\n"; - - call_hooks(App::$module . '_post_' . $selname, $o); - - return $o; -} - -function contact_select($selname, $selclass, $preselected = false, $size = 4, $privmail = false, $celeb = false, $privatenet = false, $tabindex = null) { - - $o = ''; - - // When used for private messages, we limit correspondence to mutual DFRN/Friendica friends and the selector - // to one recipient. By default our selector allows multiple selects amongst all contacts. - - $sql_extra = ''; - - $tabindex = ($tabindex > 0 ? 'tabindex="$tabindex"' : ''); - - if($privmail) - $o .= "<select name=\"$selname\" id=\"$selclass\" class=\"$selclass\" size=\"$size\" $tabindex >\r\n"; - else - $o .= "<select name=\"{$selname}[]\" id=\"$selclass\" class=\"$selclass\" multiple=\"multiple\" size=\"$size\" $tabindex>\r\n"; - - $r = q("SELECT abook_id, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash - where abook_self = 0 and abook_channel = %d - $sql_extra - ORDER BY xchan_name ASC", - intval(local_channel()) - ); - - - $arr = array('contact' => $r, 'entry' => $o); - - // e.g. 'network_pre_contact_deny', 'profile_pre_contact_allow' - - call_hooks(App::$module . '_pre_' . $selname, $arr); - - if($r) { - foreach($r as $rr) { - if((is_array($preselected)) && in_array($rr['id'], $preselected)) - $selected = ' selected="selected" '; - else - $selected = ''; - - $trimmed = mb_substr($rr['xchan_name'], 0, 20); - - $o .= "<option value=\"{$rr['abook_id']}\" $selected title=\"{$rr['xchan_name']}|{$rr['xchan_url']}\" >$trimmed</option>\r\n"; - } - } - - $o .= "</select>\r\n"; - - call_hooks(App::$module . '_post_' . $selname, $o); - - return $o; -} - function fixacl(&$item) { - $item = str_replace(array('<', '>'), array('', ''), $item); + $item = str_replace( [ '<', '>' ], [ '', '' ], $item); } /** |