* @category Horde * @license http://www.horde.org/licenses/apache ASL * @package Ingo */ /** * Block to show filter information. * * @author Oliver Kuhl * @category Horde * @license http://www.horde.org/licenses/apache ASL * @package Ingo */ class Ingo_Block_Overview extends Horde_Core_Block { /** */ public function __construct($app, $params = array()) { parent::__construct($app, $params); $this->_name = _("Overview"); } /** */ protected function _title() { return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link() . $GLOBALS['registry']->get('name') . ''; } /** */ protected function _content() { /* Get list of filters */ $filters = $GLOBALS['injector']->getInstance('Ingo_Factory_Storage')->create()->retrieve(Ingo_Storage::ACTION_FILTERS); $html = ''; foreach ($filters->getFilterList() as $filter) { if (!empty($filter['disable'])) { $active = _("inactive"); } else { $active = _("active"); } $s_categories = $GLOBALS['session']->get('ingo', 'script_categories'); switch ($filter['name']) { case 'Vacation': if (in_array(Ingo_Storage::ACTION_VACATION, $s_categories)) { $html .= ''; } break; case 'Forward': if (in_array(Ingo_Storage::ACTION_FORWARD, $s_categories)) { $html .= ''; } break; case 'Whitelist': if (in_array(Ingo_Storage::ACTION_WHITELIST, $s_categories)) { $html .= ''; } break; case 'Blacklist': if (in_array(Ingo_Storage::ACTION_BLACKLIST, $s_categories)) { $html .= ''; } break; case 'Spam Filter': if (in_array(Ingo_Storage::ACTION_SPAM, $s_categories)) { $html .= ''; } break; } } return $html . '
' . '' . '' . Ingo_Basic_Vacation::url()->link(array('title' => _("Edit"))) . _("Vacation") . ' ' . $active . '
' . '' . '' . Ingo_Basic_Forward::url()->link(array('title' => _("Edit"))) . _("Forward") . ' ' . $active; $data = unserialize($GLOBALS['prefs']->getValue('forward')); if (!empty($data['a'])) { $html .= ':
' . implode('
', $data['a']); } $html .= '
' . '' . '' . Ingo_Basic_Whitelist::url()->link(array('title' => _("Edit"))) . _("Whitelist") . ' ' . $active . '
' . '' . '' . Ingo_Basic_Blacklist::url()->link(array('title' => _("Edit"))) . _("Blacklist") . ' ' . $active . '
' . '' . '' . Ingo_Basic_Spam::url()->link(array('title' => _("Edit"))) . _("Spam Filter") . ' ' . $active . '
'; } }