roundcubemail/program/lib/Roundcube/rcube_user.php
function list_searches($type)
    {
        $plugin = $this->rc->plugins->exec_hook('saved_search_list', array('type' => $type));

        if ($plugin['abort']) {
            return (array) $plugin['result'];
        }

        $result = array();

        $sql_result = $this->db->query(
            "SELECT `search_id` AS id, `name`"
            ." FROM ".$this->db->table_name('searches', true)
            ." WHERE `user_id` = ? AND `type` = ?"
            ." ORDER BY `name`",
            (int) $this->ID, (int) $type);

        while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
            $sql_arr['data'] = unserialize($sql_arr['data']);
            $result[$sql_arr['id']] = $sql_arr;
        }

        return $result;
    }
function list_searches($type)
    {
        $plugin = $this->rc->plugins->exec_hook('saved_search_list', array('type' => $type));

        if ($plugin['abort']) {
            return (array) $plugin['result'];
        }

        $result = array();

        $sql_result = $this->db->query(
            "SELECT `search_id` AS id, `name`"
            ." FROM ".$this->db->table_name('searches', true)
            ." WHERE `user_id` = ? AND `type` = ?"
            ." ORDER BY `name`",
            (int) $this->ID, (int) $type);

        while ($sql_arr = $this->db->fetch_assoc($sql_result)) {
            $sql_arr['data'] = unserialize($sql_arr['data']);
            $result[$sql_arr['id']] = $sql_arr;
        }

        return $result;
    }
function list_searches ( $ type ) { $ plugin = $ this -> rc -> plugins -> exec_hook ( 'saved_search_list' , array ( 'type' => $ type ) ) ; if ( $ plugin [ 'abort' ] ) { return ( array ) $ plugin [ 'result' ] ; } $ result = array ( ) ; $ sql_result = $ this -> db -> query ( "SELECT `search_id` AS id, `name`" . " FROM " . $ this -> db -> table_name ( 'searches' , true ) . " WHERE `user_id` = ? AND `type` = ?" . " ORDER BY `name`" , ( int ) $ this -> ID , ( int ) $ type ) ; while ( $ sql_arr = $ this -> db -> fetch_assoc ( $ sql_result ) ) { $ sql_arr [ 'data' ] = unserialize ( $ sql_arr [ 'data' ] ) ; $ result [ $ sql_arr [ 'id' ] ] = $ sql_arr ; } return $ result ; }
Return a list of saved searches linked with this user

@param int  $type  Search type

@return array List of saved searches indexed by search ID
Return a list of saved searches linked with this user