// 'disable' => true
// ))
// ))
- 'value' => 'a:1:{i:0;C:25:"IMP_Search_Vfolder_Vinbox":175:{a:3:{s:1:"c";a:2:{i:0;C:23:"IMP_Search_Element_Flag":24:{[1,{"f":"\\seen","s":0}]}i:1;C:23:"IMP_Search_Element_Flag":27:{[1,{"f":"\\deleted","s":0}]}}s:1:"e";i:1;s:1:"v";i:1;}}}'
+ 'value' => 'a:1:{i:0;C:25:"IMP_Search_Vfolder_Vinbox":30:{a:2:{s:1:"e";i:1;s:1:"v";i:1;}}}'
);
$_prefs['filter'] = array(
// 'disable' => false
// ))
// ))
- 'value' => 'a:2:{i:0;C:22:"IMP_Search_Filter_Bulk":88:{a:3:{s:1:"c";a:1:{i:0;C:23:"IMP_Search_Element_Bulk":5:{[1,0]}}s:1:"e";i:1;s:1:"v";i:1;}}i:1;C:29:"IMP_Search_Filter_Mailinglist":95:{a:3:{s:1:"c";a:1:{i:0;C:30:"IMP_Search_Element_Mailinglist":5:{[1,0]}}s:1:"e";i:1;s:1:"v";i:1;}}}'
+ 'value' => 'a:2:{i:0;C:22:"IMP_Search_Filter_Bulk":30:{a:2:{s:1:"e";i:1;s:1:"v";i:1;}}i:1;C:29:"IMP_Search_Filter_Mailinglist":30:{a:2:{s:1:"e";i:1;s:1:"v";i:1;}}}'
);
--- /dev/null
+<?php
+/**
+ * This class provides the base definition for built-in filters.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/gpl.html GPL
+ * @package IMP
+ */
+abstract class IMP_Search_Filter_Builtin extends IMP_Search_Filter
+{
+ /**
+ * Can this query be edited?
+ *
+ * @var boolean
+ */
+ protected $_canEdit = false;
+
+ /**
+ * List of serialize entries not to save.
+ *
+ * @var array
+ */
+ protected $_nosave = array('c', 'i', 'l');
+
+ /**
+ * Constructor.
+ *
+ * The 'add', 'id', 'label', and 'mboxes' parameters are ignored.
+ *
+ * @see parent::__construct()
+ */
+ public function __construct(array $opts = array())
+ {
+ $this->enabled = empty($opts['disable']);
+
+ $this->_init();
+ }
+
+ /**
+ * Initialization tasks.
+ */
+ abstract protected function _init();
+
+ /**
+ * Unserialization.
+ *
+ * @param string $data Serialized data.
+ *
+ * @throws Exception
+ */
+ public function unserialize($data)
+ {
+ parent::unserialize($data);
+ $this->_init();
+ }
+
+}
* @license http://www.fsf.org/copyleft/gpl.html GPL
* @package IMP
*/
-class IMP_Search_Filter_Bulk extends IMP_Search_Filter
+class IMP_Search_Filter_Bulk extends IMP_Search_Filter_Builtin
{
/**
- * Can this query be edited?
- *
- * @var boolean
- */
- protected $_canEdit = false;
-
- /**
- * List of serialize entries not to save.
- *
- * @var array
- */
- protected $_nosave = array('i', 'l');
-
- /**
- * Constructor.
- *
- * The 'add', 'id', 'label', and 'mboxes' parameters are ignored.
- *
- * @see parent::__construct()
- */
- public function __construct(array $opts = array())
- {
- $this->enabled = empty($opts['disable']);
-
- $this->add(new IMP_Search_Element_Bulk());
-
- $this->_init();
- }
-
- /**
* Initialization tasks.
*/
protected function _init()
{
$this->_id = 'filter_bulk';
$this->_label = _("Bulk Messages");
- }
- /**
- * Unserialization.
- *
- * @param string $data Serialized data.
- *
- * @throws Exception
- */
- public function unserialize($data)
- {
- parent::unserialize($data);
- $this->_init();
+ $this->add(new IMP_Search_Element_Bulk());
}
}
* @license http://www.fsf.org/copyleft/gpl.html GPL
* @package IMP
*/
-class IMP_Search_Filter_Mailinglist extends IMP_Search_Filter
+class IMP_Search_Filter_Mailinglist extends IMP_Search_Filter_Builtin
{
/**
- * Can this query be edited?
- *
- * @var boolean
- */
- protected $_canEdit = false;
-
- /**
- * List of serialize entries not to save.
- *
- * @var array
- */
- protected $_nosave = array('i', 'l');
-
- /**
- * Constructor.
- *
- * The 'add', 'id', 'label', and 'mboxes' parameters are ignored.
- *
- * @see parent::__construct()
- */
- public function __construct(array $opts = array())
- {
- $this->enabled = empty($opts['disable']);
-
- $this->add(new IMP_Search_Element_Mailinglist());
-
- $this->_init();
- }
-
- /**
* Initialization tasks.
*/
protected function _init()
{
$this->_id = 'filter_mlist';
$this->_label = _("Mailing List Messages");
- }
- /**
- * Unserialization.
- *
- * @param string $data Serialized data.
- *
- * @throws Exception
- */
- public function unserialize($data)
- {
- parent::unserialize($data);
- $this->_init();
+ $this->add(new IMP_Search_Element_Mailinglist());
}
}
--- /dev/null
+<?php
+/**
+ * This class provides the base definition for built-in Virtual Folders.
+ *
+ * Copyright 2010 The Horde Project (http://www.horde.org/)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/gpl.html GPL
+ * @package IMP
+ */
+abstract class IMP_Search_Vfolder_Builtin extends IMP_Search_Vfolder
+{
+ /**
+ * Can this query be edited?
+ *
+ * @var boolean
+ */
+ protected $_canEdit = false;
+
+ /**
+ * List of serialize entries not to save.
+ *
+ * @var array
+ */
+ protected $_nosave = array('c', 'i', 'l', 'm');
+
+ /**
+ * Constructor.
+ *
+ * The 'add', 'id', 'label', and 'mboxes' parameters are not honored.
+ *
+ * @see parent::__construct()
+ */
+ public function __construct(array $opts = array())
+ {
+ $this->enabled = empty($opts['disable']);
+
+ $this->_init();
+ }
+
+ /**
+ * Initialization tasks.
+ */
+ abstract protected function _init();
+
+ /**
+ * Unserialization.
+ *
+ * @param string $data Serialized data.
+ *
+ * @throws Exception
+ */
+ public function unserialize($data)
+ {
+ parent::unserialize($data);
+ $this->_init();
+ }
+
+}
* @license http://www.fsf.org/copyleft/gpl.html GPL
* @package IMP
*/
-class IMP_Search_Vfolder_Vinbox extends IMP_Search_Vfolder
+class IMP_Search_Vfolder_Vinbox extends IMP_Search_Vfolder_Builtin
{
/**
- * Can this query be edited?
- *
- * @var boolean
- */
- protected $_canEdit = false;
-
- /**
- * List of serialize entries not to save.
- *
- * @var array
- */
- protected $_nosave = array('i', 'l', 'm');
-
- /**
- * Constructor.
- *
- * The 'add', 'id', 'label', and 'mboxes' parameters are not honored.
- *
- * @see parent::__construct()
+ * Initialization tasks.
*/
- public function __construct(array $opts = array())
+ protected function _init()
{
- $this->enabled = empty($opts['disable']);
+ $this->_id = 'vinbox';
+ $this->_label = _("Virtual Inbox");
$this->add(new IMP_Search_Element_Flag(
'\\seen',
'\\deleted',
false
));
-
- $this->_init();
- }
-
- /**
- * Initialization tasks.
- */
- protected function _init()
- {
- $this->_id = 'vinbox';
- $this->_label = _("Virtual Inbox");
}
/**
return parent::__get($name);
}
- /**
- * Unserialization.
- *
- * @param string $data Serialized data.
- *
- * @throws Exception
- */
- public function unserialize($data)
- {
- parent::unserialize($data);
- $this->_init();
- }
-
}
* @license http://www.fsf.org/copyleft/gpl.html GPL
* @package IMP
*/
-class IMP_Search_Vfolder_Vtrash extends IMP_Search_Vfolder
+class IMP_Search_Vfolder_Vtrash extends IMP_Search_Vfolder_Builtin
{
/**
- * Can this query be edited?
- *
- * @var boolean
- */
- public $canEdit = false;
-
- /**
* Display this virtual folder in the preferences screen?
*
* @var boolean
public $prefDisplay = false;
/**
- * List of serialize entries not to save.
- *
- * @var array
- */
- protected $_nosave = array('i', 'l', 'm');
-
- /**
- * Constructor.
- *
- * The 'add', 'id', 'label', and 'mboxes' parameters are not honored.
- *
- * @see parent::__construct()
+ * Initialization tasks.
*/
- public function __construct(array $opts = array())
+ protected function _init()
{
- $this->enabled = empty($opts['disable']);
+ $this->_id = 'vtrash';
+ $this->_label = _("Virtual Trash");
$this->add(new IMP_Search_Element_Flag(
'\\deleted',
true
));
-
- $this->_init();
- }
-
- /**
- * Initialization tasks.
- */
- protected function _init()
- {
- $this->_id = 'vtrash';
- $this->_label = _("Virtual Trash");
}
/**
return parent::__get($name);
}
- /**
- * Unserialization.
- *
- * @param string $data Serialized data.
- *
- * @throws Exception
- */
- public function unserialize($data)
- {
- parent::unserialize($data);
- $this->_init();
- }
-
}