* @category Horde * @copyright 2011-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP */ class IMP_Search_Element_Autogenerated extends IMP_Search_Element { /** * Constructor. * * @param boolean $not If true, do a 'NOT' search of $text. */ public function __construct($not = false) { /* Data element: (integer) Do a NOT search? */ $this->_data = intval(!empty($not)); } /** */ public function createQuery($mbox, $queryob) { $search_ob = new Horde_Imap_Client_Search_Query(); $ob1 = clone $search_ob; $ob1->headerText('auto-submitted', 'auto-generated', $this->_data); $ob2 = clone $search_ob; $ob2->headerText('auto-submitted', 'auto-replied', $this->_data); $queryob->orSearch(array($ob1, $ob2)); return $queryob; } /** */ public function queryText() { return ($this->_data ? _("not") . ' ' : '') . _("Automatically Generated Messages"); } }