source: trunk/prototype/services/ImapServiceAdapter.php @ 5749

Revision 5749, 22.3 KB checked in by douglasz, 12 years ago (diff)

Ticket #2486 - Adicionado os icones na tela de anexar mensagens

Line 
1<?php
2
3include_once ROOTPATH."/../expressoMail1_2/inc/class.imap_functions.inc.php";
4require_once ROOTPATH.'/library/uuid/class.uuid.php';
5
6
7class ImapServiceAdapter extends imap_functions/* implements Service*/
8{
9    public function open( $config )
10    {
11                $this->init();
12    }
13
14//     public function connect( $config )
15//     {
16//                      $this->init();
17//     }
18       
19    public function find( $URI, $justthese = false, $criteria = false )
20        {
21                //require_once dirname(__FILE__) . '/../api/controller.php';
22                $context = $justthese['context'];
23                $URI = $URI['concept'];
24
25                switch( $URI )
26                {
27                        case 'folder':
28                        {
29                                $result = $this->to_utf8($this->get_folders_list());
30
31                                foreach ($result as $res) {
32
33                                        $response[] = array(
34                                                        'id' => $res['folder_id'],
35                                                        'commonName' => $res['folder_name'],
36                                                        'parentFolder' => $res['folder_parent'],
37                                                        'messageCount' => array('unseen' => isset($res['folder_unseen']) ? $res['folder_unseen'] : null, 'total' => null)
38                                                );
39                                }
40
41                                return $response;
42                        }
43                        case 'message':
44                        {
45                                //begin: for grid       
46                                $page  = $criteria['page']; //{1}    get the requested page
47                                $limit = $criteria['rows']; //{10}   get how many rows we want to have into the grid
48                                $sidx  = $criteria['sidx']; //{id}   get index row - i.e. user click to sort
49                                $sord  = $criteria['sord']; //{desc} get the direction
50
51                                $filter = $criteria['filter'];
52
53                                if( !$sidx ) $sidx = 1;
54
55                                $folder_name = str_replace( '.', $this->imap_delimiter, $context['folder'] );
56                               
57                                $count = imap_num_msg( $this->open_mbox( $folder_name ) );
58
59                                $total_pages = $count > 0 ? ceil( $count/$limit ) : 0;
60
61                                if( $page > $total_pages )
62                                        $page = $total_pages;
63
64                                $start = $limit * $page - $limit;
65
66                                // do not put $limit*($page - 1)
67                                //end: for grid
68
69                                if( $filter )
70                                {
71                                        if( $filter[0] !== 'msgNumber' )
72                                        {
73                                        for( $i = 0; $i < count($filter); $i++ )
74                                        {
75                                                if( count( $filter[$i] ) === 4 )
76                                                $criteria['isExact'] = ( array_shift( $filter[$i] ) === 'AND' );
77
78                                                $criteria[ $filter[$i][0] ] = array( 'criteria' => $filter[$i][2], 'filter' => $filter[$i][1] );
79                                        }
80
81                                        return $this->searchSieveRule($criteria);
82                                        }
83
84                                        $msgNumber = array();
85
86                                        for( $i = $start; $i < $start + $limit && isset( $filter[2][$i] ); $i++ )
87                                          $msgNumber[] = $filter[2][$i];
88
89                                        if( empty( $msgNumber ) )
90                                        return( false );
91
92                                        $result = $this->get_info_msgs( array( 'folder' => $folder_name,
93                                                                           'msgs_number' => implode( ',', $msgNumber ) ) );
94
95                                        foreach( $result as $i => $val )
96                                                $result[$i] = unserialize( $val );
97                                }
98                                else
99                                {
100                                        $result = $this->get_range_msgs2(
101                                                array(
102                                                        'folder' => $folder_name, //INBOX
103                                                        'msg_range_begin' => $start + 1, //??
104                                                        'msg_range_end' => $start + $limit, //$limit = $_GET['rows']; // get how many rows we want to have into the grid
105                                                        'sort_box_type' => 'SORTARRIVAL',
106                                                        'search_box_type' => 'ALL',
107                                                        'sort_box_reverse' => 1
108                                                )
109                                        );
110                                }
111                                //return var_export($result);
112                               
113                                $response = array( "page" => $page, "total" => $total_pages, "records" => $count );
114
115                               
116                                for ($i=0; $i<count($result); $i++)
117                                {
118                                        $flags_enum = array('Unseen'=> 1,  'Answered'=> 1, 'Forwarded'=> 1, 'Flagged'=> 1, 'Recent'=> 1, 'Draft'=> 1 );
119
120                                        foreach ($flags_enum as $key => $flag)
121                                        {
122                                                if ( !isset($result[$i][$key]) || !trim($result[$i][$key]) || trim($result[$i][$key]) == '')
123                                                        $flags_enum[$key] = 0;
124                                                        //unset($flags_enum[$key]);
125
126                                                unset($result[$i][$flag]);
127                                        }                                       
128                                        if (array_key_exists($i, $result))
129                                        {
130                                                $response["rows"][$i] = $result[$i];
131                                                $response["rows"][$i]['timestamp'] = ( ( $result[$i]['udate'] + $this->functions->CalculateDateOffset() ) * 1000 );
132                                                $response["rows"][$i]['flags'] = implode(',', $flags_enum);
133                                                $response["rows"][$i]['size'] = $response["rows"][$i]['Size'];
134                                                $response["rows"][$i]['folder'] = $folder_name;
135                                                $filter = array('AND', array('=', 'folderName', $folder_name), array('=','messageNumber', $result[$i]['msg_number']));
136                                                $followupflagged = Controller::find(
137                                                        array('concept' => 'followupflagged'),
138                                                        false,
139                                                        array('filter' => $filter, 'criteria' => array('deepness' => '2'))
140                                                );
141
142
143                                                if(isset($followupflagged[0]['followupflagId']))
144                                                {
145                                                        $followupflag = Controller::read( array( 'concept' => 'followupflag', 'id' => $followupflagged[0]['followupflagId'] ));     
146                                                        $followupflagged[0]['followupflag'] = $followupflag;
147                                                        $response["rows"][$i]['followupflagged'] = $followupflagged[0];
148
149                                                }
150
151                                                $labeleds = Controller::find(
152                                                        array('concept' => 'labeled'),
153                                                        false,
154                                                        array('filter' => $filter, 'criteria' => array('deepness' => '2'))
155                                                );
156                                                foreach ($labeleds as $e){
157                                                        $labels = Controller::read( array( 'concept' => 'label', 'id' =>  $e['labelId']));     
158                                                        $response["rows"][$i]['labels'][$e['labelId']] = $labels;
159                                                }       
160                                                //$response["rows"][$i]['udate'] = ( $result[$i]['udate'] + $this->functions->CalculateDateOffset()  * 1000 );
161                                                unset($response["rows"][$i]['Size']);
162                                        }
163                                 }                                       
164                                return $this->to_utf8($response);
165                        }
166                       
167                        /**
168                         * Filtros suportados:
169                         * - ['=', 'folderName', $X]
170                         * - [
171                         *              'AND',
172                         *              [
173                         *                      'AND',
174                         *                      ['=', 'folderName', $X],
175                         *                      ['IN', 'messageNumber', $Ys]
176                         *              ],
177                         *              ['IN', 'labelId', $Zs]
178                         * ]
179                         * - ['=', 'labelId', $X]
180                         * - [
181                         *              'AND',
182                         *              ['=', 'folderName', $X],
183                         *              ['=', 'labelId', $Y]
184                         * ]
185                         * - ['IN', 'labelId', $Ys]
186                         * - [
187                         *              'AND',
188                         *              ['=', 'folderName', $X],
189                         *              ['IN', 'labelId', $Ys]
190                         * ]                   
191                         */
192                        case 'labeled':
193                        {
194                                $result = array ( );
195                                if (isset($criteria["filter"]) && is_array($criteria['filter'])) {
196                                        //TODO - melhorar o tratamento do filter com a lista de todos os labelIds dado pelo interceptor
197                                        $map = array(
198                                                'id' => array(),
199                                                'folderName' => array(),
200                                                'messageNumber' => array(),
201                                                'labelId' => array()
202                                        );
203                                       
204                                        self::parseFilter($criteria["filter"], &$map);
205                                       
206                                        if (count($map['folderName']) == 0) {
207                                                $folders = $this->get_folders_list();
208                                                foreach ($folders as $folder)
209                                                        if (isset($folder['folder_id']))
210                                                                $map['folderName'][] = $folder['folder_id'];
211                                        }
212
213                                        foreach ($map['folderName'] as $folder) {
214                                                $this->mbox = $this->open_mbox($folder);
215                                               
216                                                foreach ($map['labelId'] as $label) {
217                                                        $messagesLabeleds = imap_search($this->mbox, 'UNDELETED KEYWORD "$Label'.$label.'"', SE_UID);
218                                                       
219                                                        foreach ($messagesLabeleds as $messageLabeled) {
220                                                                if (count($map['messageNumber']) > 0 && !in_array($messageLabeled, $map['messageNumber']))
221                                                                        continue;
222                                                                       
223                                                                $result[] = array (
224                                                                        'id' => $folder . '/' . $messageLabeled . '#' . $label,
225                                                                        'folderName' => $folder,
226                                                                        'messageNumber' => $messageLabeled,
227                                                                        'labelId' => $label
228                                                                );
229                                                        }
230                                                }
231                                               
232                                                imap_close($this->mbox);
233                                                $this->mbox = false;
234                                        }
235                                }
236                               
237                                return $result;
238                        }
239                       
240                        case 'followupflagged':
241                        {
242                       
243                                $result = array ( );
244                                if (isset($criteria["filter"]) && is_array($criteria['filter'])) {
245                                        //TODO - melhorar o tratamento do filter com a lista de todos os labelIds dado pelo interceptor
246                                        $map = array(
247                                                'id' => array(),
248                                                'folderName' => array(),
249                                                'messageNumber' => array()
250                                        );
251                                       
252                                        self::parseFilter($criteria["filter"], &$map);
253                                       
254                                        if (empty($map['folderName'])) {
255                                                $folders = $this->get_folders_list();
256                                                foreach ($folders as $folder)
257                                                        if (isset($folder['folder_id']))
258                                                                $map['folderName'][] = $folder['folder_id'];
259                                        }
260
261                                        foreach ($map['folderName'] as $folder) {
262                                                $this->mbox = $this->open_mbox($folder);
263                                               
264                                                /**
265                                                 * Caso não tenha sido passado id no filtro
266                                                 */
267                                                if (!$map['id']) {
268                                                        $messagesFlaggeds = imap_search($this->mbox, 'UNDELETED KEYWORD "$Followupflagged"', SE_UID);
269
270                                                        foreach ($messagesFlaggeds as $messageFlagged) {
271                                                                if (count($map['messageNumber']) > 0 && !in_array($messageFlagged, $map['messageNumber']))
272                                                                        continue;
273                                                                       
274                                                                $result[] = array (
275                                                                        'folderName' => $folder,
276                                                                        'messageNumber' => $messageFlagged
277                                                                );
278                                                        }
279                                                       
280                                                } else {
281                                                        foreach ($map['id'] as $followupflagged) {
282                                                                $messagesFlaggeds = imap_search($this->mbox, 'UNDELETED KEYWORD "$Followupflag'.$followupflagged.'"', SE_UID);
283                                                               
284                                                                foreach ($messagesFlaggeds as $messageFlagged) {
285                                                                        if (count($map['messageNumber']) > 0 && !in_array($messageFlagged, $map['messageNumber']))
286                                                                                continue;
287                                                                               
288                                                                        $result[] = array (
289                                                                                'id' => $folder . '/' . $messageFlagged . '#' . $followupflagged,
290                                                                                'folderName' => $folder,
291                                                                                'messageNumber' => $messageFlagged
292                                                                        );
293                                                                }
294                                                        }
295                                                }
296                                               
297                                                imap_close($this->mbox);
298                                                $this->mbox = false;
299                                        }
300                                }
301                                               
302                                return $result;                         
303                        }
304                }
305    }
306
307    public function read( $URI, $justthese = false )
308    {
309
310                switch( $URI['concept'] )
311                {
312                        case 'message':
313                        {
314                                return $this->to_utf8(
315                                        $this->get_info_msg( array('msg_number'=>$URI['id'],
316                                        'msg_folder'=>str_replace( '.', $this->imap_delimiter, $justthese['context']['folder'] )) )
317                                );
318                        }
319                        case 'labeled':
320                        {
321                                /**
322                                 * id looks like 'folder/subfolder/subsubfolder/65#13', meaning messageId#labelId
323                                 */
324                                list($messageId, $labelId) = explode('#', $URI['id']);
325                                $folderName = basename($messageId);
326                                $messageNumber = dirname($messageId);
327                               
328                                $result = array();
329
330                                if ($folderName && $messageNumber && $labelId) {
331                                        $this->mbox = $this->open_mbox($folderName);
332                                        $messagesLabeleds = imap_search($this->mbox, 'UNDELETED KEYWORD "$Label'.$labelId.'"', SE_UID);
333                                       
334                                        if (in_array($messageNumber, $messagesLabeleds)) {
335                                                $result = array (
336                                                        'id' => $URI['id'],
337                                                        'folderName' => $folderName,
338                                                        'messageNumber' => $messageNumber,
339                                                        'labelId' => $labelId
340                                                );
341                                        }
342                                        imap_close($this->mbox);
343                                        $this->mbox = false;
344                                }
345                               
346                                return $result;
347                        }
348                       
349                        case 'followupflagged':
350                        {
351                                /**
352                                 * id looks like 'folder/subfolder/subsubfolder/65#13', meaning messageId#followupflaggedId
353                                 */
354                                list($messageId, $followupflaggedId) = explode('#', $URI['id']);
355                                $folderName = dirname($messageId);
356                                $messageNumber = basename($messageId);
357                               
358                                $result = array();
359
360                                if ($folderName && $messageNumber && $followupflaggedId) {
361                                        $this->mbox = $this->open_mbox($folderName);
362                                        $messagesFlaggeds = imap_search($this->mbox, 'UNDELETED KEYWORD "$Followupflag'.$followupflaggedId.'"', SE_UID);
363                                       
364                                        if (in_array($messageNumber, $messagesFlaggeds)) {
365                                                $result = array (
366                                                        'id' => $URI['id'],
367                                                        'folderName' => $folderName,
368                                                        'messageNumber' => $messageNumber
369                                                );
370                                        }
371                                        imap_close($this->mbox);
372                                        $this->mbox = false;
373                                }
374                               
375                                return $result;
376                        }
377                }
378    }
379
380    public function create( $URI, $data)
381    {               
382                switch( $URI['concept'] )
383                {
384                        case 'labeled':
385                        {
386                                if (isset($data['folderName']) && isset($data['messageNumber']) && isset($data['labelId'])) {
387                                        $this->mbox = $this->open_mbox($data['folderName']);
388                                        imap_setflag_full($this->mbox, $data['messageNumber'], '$Label' . $data['labelId'], ST_UID);
389
390                                        imap_close($this->mbox);
391                                        $this->mbox = false;
392
393                                        return array ('id' => $data['folderName'].'/'.$data['messageNumber'].'#'.$data['labelId']);
394                                }
395                                return array ();
396                        }
397                        case 'followupflagged':
398                        {
399                                //deve ser gravado no banco primeiro, obtido o id e, depois, gravado no imap passando o id no parametro $data
400                                if (isset($data['folderName']) && isset($data['messageNumber']) && isset($data['id'])) {
401                                        list($messageId, $followupflaggedId) = explode('#', $data['id']);
402                                       
403                                        $this->mbox = $this->open_mbox($data['folderName']);
404                                        $s = imap_setflag_full($this->mbox, $data['messageNumber'], '$Followupflagged $Followupflag' . $followupflaggedId, ST_UID);
405                                                                               
406                                        imap_close($this->mbox);
407                                        $this->mbox = false;
408
409                                        return ($s) ? $data : array();
410
411                                }
412                                return array ();
413                        }
414                       
415                        case 'message':
416                        {
417                                $GLOBALS['phpgw_info']['flags'] = array( 'noheader' => true, 'nonavbar' => true,'currentapp' => 'expressoMail1_2','enable_nextmatchs_class' => True );
418                                $return = array();
419
420                                require_once dirname(__FILE__) . '/../../services/class.servicelocator.php';
421                                $mailService = ServiceLocator::getService('mail');
422
423                                $msg_uid = $data['msg_id'];
424                                $body = $data['body'];
425                                $body = str_replace("%nbsp;","&nbsp;",$body);
426                                //$body = preg_replace("/\n/"," ",$body);
427                                //$body = preg_replace("/\r/","" ,$body);
428                                $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );                                       
429
430                                $folder = mb_convert_encoding($data['folder'], "UTF7-IMAP","ISO-8859-1, UTF-8");
431                                $folder = @eregi_replace("INBOX[/.]", "INBOX".$this->imap_delimiter, $folder);
432
433                                                                /**
434                                                                 * Gera e preenche o field Message-Id do header
435                                                                 */
436                                                                $mailService->addHeaderField('Message-Id', UUID::generate( UUID::UUID_RANDOM, UUID::FMT_STRING ) . '@Draft');
437                                                               
438                                $mailService->addTo($data['input_to']);
439                                $mailService->addCc( $data['input_cc']);
440                                $mailService->addBcc($data['input_cco']);
441                                $mailService->setSubject($data['input_subject']);
442                                if(isset($data['input_important_message']))
443                                        $mailService->addHeaderField('Importance','High');
444
445                                if(isset($data['input_return_receipt']))
446                                        $mailService->addHeaderField('Disposition-Notification-To', Config::me('mail'));
447
448                                $isHTML = ( isset($data['type']) && $data['type'] == 'html' )?  true : false;
449                                                                 
450                                if (!$body) $body = ' ';
451                               
452
453                                $mbox_stream = $this->open_mbox($folder);
454
455                                $attachment = json_decode($data['attachments'],TRUE);
456                               
457
458                                foreach ($attachment as &$value)
459                                {
460
461                                    if((int)$value > 0) //BD attachment
462                                    {
463                                         $att = Controller::read(array('id'=> $value , 'concept' => 'mailAttachment'));
464                                         
465                                         
466                                         if($att['disposition'] == 'embedded')
467                                         {
468                                             $body = str_replace('"../prototype/getArchive.php?mailAttachment='.$att['id'].'"', $att['name'], $body);
469                                             $mailService->addStringImage(base64_decode($att['source']), $att['type'], $att['name']);
470                                         }
471                                         else
472                                             $mailService->addStringAttachment(base64_decode($att['source']), $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' );
473                                         
474                                         unset($att);
475                                    }
476                                    else
477                                    {
478                                        $value = json_decode($value, true);
479                                       
480                                        switch ($value['type']) {
481                                            case 'imapPart':
482                                                    $att = $this->getForwardingAttachment($value['folder'],$value['uid'], $value['part']);
483                                                    if(strstr($body,'<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />') !== false)//Embeded IMG
484                                                    {   
485                                                        $body = str_ireplace('<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />' , '<img src="'.$att['name'].'" />', $body);
486                                                        $mailService->addStringImage($att['source'], $att['type'], $att['name']);
487                                                    }
488                                                    else
489                                                        $mailService->addStringAttachment($att['source'], $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' );
490                                                    unset($att);
491                                                break;
492                                              case 'imapMSG':
493                                                    $sub =  $value['name'] ? $value['name'].'.eml' :'no title.eml';
494                                                    $mbox_stream = $this->open_mbox($value['folder']);
495                                                    $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']);
496                                                    $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' );
497                                                    unset($rawmsg);
498                                                break;
499
500                                            default:
501                                                break;
502                                        }
503                                    }
504
505                                }
506                               
507                                if($isHTML) $mailService->setBodyHtml($body); else $mailService->setBodyText($body);
508 
509                                if(imap_append($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, $mailService->getMessage(), "\\Seen \\Draft"))
510                                {
511                                    $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, SA_UIDNEXT);
512                                    $return['id'] = $status->uidnext - 1;
513                                       
514                                    if($data['uidsSave'] )
515                                        $this->delete_msgs(array('folder'=> $folder , 'msgs_number' => $data['uidsSave']));
516                       
517                                }
518                 
519                                if($mbox_stream) imap_close($mbox_stream);
520
521                                return $return;
522                        }
523                }
524        }
525
526    public function delete( $URI, $justthese = false, $criteria = false )
527    {
528                switch( $URI['concept'] )
529                {
530                        case 'labeled':
531                        {
532                                list($messageId, $labelId) = explode('#', $URI['id']);
533                                $folderName = dirname($messageId);
534                                $messageNumber = basename($messageId);
535
536                                if ($folderName && $messageNumber && $labelId) {
537                                        $this->mbox = $this->open_mbox($folderName);
538                                        imap_clearflag_full($this->mbox, $messageNumber, '$Label' . $labelId, ST_UID);
539
540                                        imap_close($this->mbox);
541                                        $this->mbox = false;
542                                }
543                        }
544                        case 'followupflagged':
545                        {
546                                list($messageId, $followupflaggedId) = explode('#', $URI['id']);
547                               
548                                $folderName = dirname($messageId);
549                                $messageNumber = basename($messageId);
550                       
551                                if ($folderName && $messageNumber && $followupflaggedId) {
552
553                                        $this->mbox = $this->open_mbox($folderName);
554                                        $f1 = imap_clearflag_full($this->mbox, $messageNumber, '$Followupflag' . $followupflaggedId, ST_UID);
555
556                                        /**
557                                         * implementa a possibilidade de listar todas as mensagens sinalizadas através da busca
558                                         */
559                                        $f2 = imap_clearflag_full($this->mbox, $messageNumber, '$Followupflagged', ST_UID);
560
561                                        imap_close($this->mbox, CL_EXPUNGE);
562                                        $this->mbox = false;
563                                       
564                                        return ($f1 && $f2);
565                                }
566                               
567                                return false;
568                        }
569                }
570
571                //TODO - return
572        }
573
574    public function deleteAll( $URI, $justthese = false, $criteria = false ) // avaliar
575    {}
576
577    public function update( $URI, $data, $criteria = false )
578    {
579                /**
580                 * Os únicos atributos que podem ser alterados no IMAP são folderName e messageId,
581                 * porém a operação de update desses atributos não faz sentido para o usuário da DataLayer,
582                 * pois na prática elas são executadas através das operações de CREATE e DELETE.
583                 * Assim, para os conceitos "labeled" e "followupflagged", só faz sentido o update de
584                 * atributos gravados no banco de dados e nunca no IMAP.
585                 */
586        }
587
588//     public function retrieve( $concept, $id, $parents, $justthese = false, $criteria = false )
589//     {
590//                      return $this->read( array( 'id' => $id,
591//                          'concept' => $concept,
592//                          'context' => $parents ), $justthese );
593//     }
594
595    public function replace( $URI, $data, $criteria = false )
596    {}
597
598    public function close()
599    {}
600
601    public function setup()
602    {}
603
604    public function commit( $uri )
605    { return( true ); }
606
607    public function rollback( $uri )
608    {}
609
610    public function begin( $uri )
611    {}
612
613
614    public function teardown()
615    {}
616
617    function to_utf8($in)
618    {
619                if (is_array($in)) {
620                        foreach ($in as $key => $value) {
621                                $out[$this->to_utf8($key)] = $this->to_utf8($value);
622                        }
623                } elseif(is_string($in)) {
624                                return mb_convert_encoding( $in , 'UTF-8' , 'UTF-8 , ISO-8859-1' );
625                } else {
626                        return $in;
627                }
628                return $out;
629    }
630       
631           
632    private static function parseFilter($filter ,&$map){
633               
634                if( !is_array( $filter ) || count($filter) <= 0) return null;
635                                       
636                $op = array_shift( $filter );
637                switch(strtolower($op))
638                {
639                        case 'and': {
640                                foreach ($filter as $term)
641                                        self::parseFilter($term ,&$map);
642                                return;
643                        }
644                        case 'in': {
645                                if(is_array($map[$filter[0]]) && is_array($filter[1]))
646                                        $map[$filter[0]] = array_unique(array_merge($map[$filter[0]], $filter[1]));
647                                return;
648                        }
649                        case '=': {
650                                $map[$filter[0]][] = $filter[1];
651                        }
652                }
653        }
654
655}
Note: See TracBrowser for help on using the repository browser.