]> git.mxchange.org Git - friendica.git/blobdiff - include/acl_selectors.php
Merge branch 'develop' into rewrites/dbm_is_result
[friendica.git] / include / acl_selectors.php
index 71a42478ba92c06b80c02f6f3d332af6382deba4..c1edc8cc037927b5cdd5695cca2d663151bfe678 100644 (file)
@@ -33,7 +33,7 @@ function group_select($selname,$selclass,$preselected = false,$size = 4) {
 
        call_hooks($a->module . '_pre_' . $selname, $arr);
 
-       if(count($r)) {
+       if (dbm::is_result($r)) {
                foreach($r as $rr) {
                        if((is_array($preselected)) && in_array($rr['id'], $preselected))
                                $selected = " selected=\"selected\" ";
@@ -144,7 +144,7 @@ function contact_selector($selname, $selclass, $preselected = false, $options) {
 
        call_hooks($a->module . '_pre_' . $selname, $arr);
 
-       if(count($r)) {
+       if (dbm::is_result($r)) {
                foreach($r as $rr) {
                        if((is_array($preselected)) && in_array($rr['id'], $preselected))
                                $selected = " selected=\"selected\" ";
@@ -220,7 +220,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p
 
        $receiverlist = array();
 
-       if(count($r)) {
+       if (dbm::is_result($r)) {
                foreach($r as $rr) {
                        if((is_array($preselected)) && in_array($rr['id'], $preselected))
                                $selected = " selected=\"selected\" ";
@@ -314,7 +314,7 @@ function populate_acl($user = null, $show_jotnets = false) {
                        $r = q("SELECT `pubmail` FROM `mailacct` WHERE `uid` = %d AND `server` != '' LIMIT 1",
                                intval(local_user())
                        );
-                       if(count($r)) {
+                       if (dbm::is_result($r)) {
                                $mail_enabled = true;
                                if(intval($r[0]['pubmail']))
                                        $pubmail_enabled = true;
@@ -392,8 +392,9 @@ function construct_acl_data(&$a, $user) {
 
 function acl_lookup(&$a, $out_type = 'json') {
 
-       if(!local_user())
-               return "";
+       if (!local_user()) {
+               return '';
+       }
 
        $start  =       (x($_REQUEST,'start')           ? $_REQUEST['start']            : 0);
        $count  =       (x($_REQUEST,'count')           ? $_REQUEST['count']            : 100);
@@ -577,7 +578,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                $r = array();
 
 
-       if(count($r)) {
+       if (dbm::is_result($r)) {
                foreach($r as $g){
                        $contacts[] = array(
                                "type"  => "c",
@@ -612,7 +613,7 @@ function acl_lookup(&$a, $out_type = 'json') {
                                dbesc($search),
                                implode("','", $known_contacts)
                );
-               if (is_array($r) && count($r)){
+               if (dbm::is_result($r)){
                        foreach($r as $row) {
                                // nickname..
                                $up = parse_url($row['author-link']);
@@ -678,7 +679,7 @@ function acl_lookup(&$a, $out_type = 'json') {
  * @param App $a
  * @return array with the search results
  */
-function navbar_complete(&$a) {
+function navbar_complete(App &$a) {
 
 //     logger('navbar_complete');