Mercurial > hg > rc1
comparison plugins/thunderbird_labels/thunderbird_labels.php @ 27:e097905863b9
turn off logging
author | Charlie Root |
---|---|
date | Sun, 28 Jan 2018 11:37:00 -0500 |
parents | b2b6c0af2383 |
children | ea061c743982 |
comparison
equal
deleted
inserted
replaced
26:b2b6c0af2383 | 27:e097905863b9 |
---|---|
93 && $this->require_plugin('contextmenu') | 93 && $this->require_plugin('contextmenu') |
94 && $this->rc->config->get('tb_label_enable_contextmenu')) | 94 && $this->rc->config->get('tb_label_enable_contextmenu')) |
95 { | 95 { |
96 if ($this->rc->action == 'list') | 96 if ($this->rc->action == 'list') |
97 $this->add_hook('render_mailboxlist', array($this, 'show_tb_label_contextmenu')); | 97 $this->add_hook('render_mailboxlist', array($this, 'show_tb_label_contextmenu')); |
98 rcube::write_log('lab','ctxt: '.$this->rc->action); | 98 #rcube::write_log('lab','ctxt: '.$this->rc->action); |
99 } | 99 } |
100 else { | 100 else { |
101 rcube::write_log('lab','no ctxt'); | 101 #rcube::write_log('lab','no ctxt'); |
102 } | 102 } |
103 } | 103 } |
104 elseif ($this->rc->task == 'settings') | 104 elseif ($this->rc->task == 'settings') |
105 { | 105 { |
106 $this->include_stylesheet($this->local_skin_path() . '/tb_label.css'); | 106 $this->include_stylesheet($this->local_skin_path() . '/tb_label.css'); |
438 } | 438 } |
439 else { | 439 else { |
440 $rm[]=$m; | 440 $rm[]=$m; |
441 } | 441 } |
442 } | 442 } |
443 rcube::write_log($this->name,"ts0: |".$rm[0]->depth."| |".($rm[0]->depth===0)."|"); | 443 #rcube::write_log($this->name,"ts0: |".$rm[0]->depth."| |".($rm[0]->depth===0)."|"); |
444 usort($sm,$datesSort); | 444 usort($sm,$datesSort); |
445 $depth=0; | 445 $depth=0; |
446 $foundSome=true; | 446 $foundSome=true; |
447 while ($foundSome) { | 447 while ($foundSome) { |
448 rcube::write_log($this->name,"ts: $depth ".count($sm).' '.count($rm)); | 448 #rcube::write_log($this->name,"ts: $depth ".count($sm).' '.count($rm)); |
449 $foundSome=false; | 449 $foundSome=false; |
450 $tsm = array(); | 450 $tsm = array(); |
451 $trm = array(); | 451 $trm = array(); |
452 foreach ($sm as $m) { | 452 foreach ($sm as $m) { |
453 $tsm[]=$m; | 453 $tsm[]=$m; |
503 | 503 |
504 $imap->set_flag($flag_uids, $toggle_label, $mbox); | 504 $imap->set_flag($flag_uids, $toggle_label, $mbox); |
505 // belt and braces | 505 // belt and braces |
506 if (count($unflag_uids)>0) { | 506 if (count($unflag_uids)>0) { |
507 $flaggedMsgs = $imap->list_flags($mbox,$unflag_uids); | 507 $flaggedMsgs = $imap->list_flags($mbox,$unflag_uids); |
508 rcube::write_log($this->name,'oldFlags: '.print_r($flaggedMsgs,true)); | 508 #rcube::write_log($this->name,'oldFlags: '.print_r($flaggedMsgs,true)); |
509 $fullFlags=array(); | 509 $fullFlags=array(); |
510 foreach ($flaggedMsgs as $uid => $flags) { | 510 foreach ($flaggedMsgs as $uid => $flags) { |
511 foreach ($flags as $flag => $x) { | 511 foreach ($flags as $flag => $x) { |
512 $pos=strpos(strtolower($flag),$toggle_label); | 512 $pos=strpos(strtolower($flag),$toggle_label); |
513 rcube::write_log($this->name,"flag?: $flag $toggle_label $pos"); | 513 #rcube::write_log($this->name,"flag?: $flag $toggle_label $pos"); |
514 if ($pos>-1 && $pos<2 && !in_array($flag,$fullFlags)) { | 514 if ($pos>-1 && $pos<2 && !in_array($flag,$fullFlags)) { |
515 $fullFlags[]=$flag; | 515 $fullFlags[]=$flag; |
516 } | 516 } |
517 } | 517 } |
518 } | 518 } |
519 if (count($fullFlags)==0) { | 519 if (count($fullFlags)==0) { |
520 rcube::write_log('errors',"no full flags for $toggle_label in ".print_r($flaggedMsgs,true)); | 520 #rcube::write_log('errors',"no full flags for $toggle_label in ".print_r($flaggedMsgs,true)); |
521 $imap->set_flag($unflag_uids, "UN$toggle_label", $mbox); | 521 $imap->set_flag($unflag_uids, "UN$toggle_label", $mbox); |
522 } | 522 } |
523 else { | 523 else { |
524 foreach ($fullFlags as $flag) { | 524 foreach ($fullFlags as $flag) { |
525 rcube::write_log($this->name,"UNsetting $flag in $mbox for ".join(',',$unflag_uids)); | 525 #rcube::write_log($this->name,"UNsetting $flag in $mbox for ".join(',',$unflag_uids)); |
526 $imap->set_flag($unflag_uids, "UN$flag", $mbox); | 526 $imap->set_flag($unflag_uids, "UN$flag", $mbox); |
527 } | 527 } |
528 } | 528 } |
529 } | 529 } |
530 $this->api->output->send(); | 530 $this->api->output->send(); |
542 $out .= '<li class="label'.$i.$separator.'"><a href="#" id="tblabel'.$i.'" class="active">'.$i.' '.$custom_labels[$i].'</a></li>'; | 542 $out .= '<li class="label'.$i.$separator.'"><a href="#" id="tblabel'.$i.'" class="active">'.$i.' '.$custom_labels[$i].'</a></li>'; |
543 } | 543 } |
544 $out .= '</ul> | 544 $out .= '</ul> |
545 </div>'; | 545 </div>'; |
546 $this->rc->output->add_gui_object('tblabelpopup_obj', 'tblabelpopup'); | 546 $this->rc->output->add_gui_object('tblabelpopup_obj', 'tblabelpopup'); |
547 rcube::write_log('lab',"tblp $out"); | 547 #rcube::write_log('lab',"tblp $out"); |
548 $this->rc->output->add_footer($out); | 548 $this->rc->output->add_footer($out); |
549 } | 549 } |
550 } | 550 } |
551 | 551 |