1: <?php
2: /**
3: * This class handles the bulk message search query.
4: *
5: * Precedence is a non-standard, discouraged header pursuant to RFC 2076
6: * [3.9]. However, it is widely used and may be useful in sorting out
7: * unwanted e-mail.
8: *
9: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
10: *
11: * See the enclosed file COPYING for license information (GPL). If you
12: * did not receive this file, see http://www.horde.org/licenses/gpl.
13: *
14: * @author Michael Slusarz <slusarz@horde.org>
15: * @category Horde
16: * @license http://www.horde.org/licenses/gpl GPL
17: * @package IMP
18: */
19: class IMP_Search_Element_Bulk extends IMP_Search_Element
20: {
21: /**
22: * Constructor.
23: *
24: * @param boolean $not If true, do a 'NOT' search of $text.
25: */
26: public function __construct($not = false)
27: {
28: /* Data element: (integer) Do a NOT search? */
29: $this->_data = intval(!empty($not));
30: }
31:
32: /**
33: */
34: public function createQuery($mbox, $queryob)
35: {
36: $queryob->headerText('precedence', 'bulk', $this->_data);
37:
38: return $queryob;
39: }
40:
41: /**
42: */
43: public function queryText()
44: {
45: return ($this->_data ? _("not") . ' ' : '') . _("Bulk Messages");
46: }
47:
48: }
49: