Overview

Packages

  • Horde
    • Icalendar
      • UnitTests
  • Ingo
    • UnitTests
  • None

Classes

  • Ingo_Application
  • Ingo_Block_Overview
  • Ingo_Script_Imap_Mock
  • Ingo_Test_Notification
  • ScriptTester
  • ScriptTester_all
  • ScriptTester_imap
  • ScriptTester_sieve
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Block to show filter information.
  4:  *
  5:  * See the enclosed file LICENSE for license information (ASL).  If you
  6:  * did not receive this file, see http://www.horde.org/licenses/apache.
  7:  *
  8:  * @author  Oliver Kuhl <okuhl@netcologne.de>
  9:  */
 10: class Ingo_Block_Overview extends Horde_Core_Block
 11: {
 12:     /**
 13:      */
 14:     public function __construct($app, $params = array())
 15:     {
 16:         parent::__construct($app, $params);
 17: 
 18:         $this->_name = _("Overview");
 19:     }
 20: 
 21:     /**
 22:      */
 23:     protected function _title()
 24:     {
 25:         return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link() . $GLOBALS['registry']->get('name') . '</a>';
 26:     }
 27: 
 28:     /**
 29:      */
 30:     protected function _content()
 31:     {
 32:         /* Get list of filters */
 33:         $filters = $GLOBALS['ingo_storage']->retrieve(Ingo_Storage::ACTION_FILTERS);
 34:         $html = '<table width="100%" height="100%">';
 35:         $html_pre = '<tr><td valign="top">';
 36:         $html_post = '</td></tr>';
 37:         foreach ($filters->getFilterList() as $filter) {
 38:             if (!empty($filter['disable'])) {
 39:                 $active = _("inactive");
 40:             } else {
 41:                 $active = _("active");
 42:             }
 43: 
 44:             $s_categories = $GLOBALS['session']->get('ingo', 'script_categories');
 45: 
 46:             switch ($filter['name']) {
 47:             case 'Vacation':
 48:                 if (in_array(Ingo_Storage::ACTION_VACATION, $s_categories)) {
 49:                     $html .= $html_pre .
 50:                         Horde::img('vacation.png', _("Vacation")) .
 51:                         '</td><td>' .
 52:                         Horde::url('vacation.php')->link(array('title' => _("Edit"))) .
 53:                         _("Vacation") . '</a> ' . $active . $html_post;
 54:                 }
 55:                 break;
 56: 
 57:             case 'Forward':
 58:                 if (in_array(Ingo_Storage::ACTION_FORWARD, $s_categories)) {
 59:                     $html .= $html_pre .
 60:                         Horde::img('forward.png', _("Forward")) . '</td><td>' .
 61:                         Horde::url('forward.php')->link(array('title' => _("Edit"))) .
 62:                         _("Forward") . '</a> ' . $active;
 63:                     $data = unserialize($GLOBALS['prefs']->getValue('forward'));
 64:                     if (!empty($data['a'])) {
 65:                         $html .= ':<br />' . implode('<br />', $data['a']);
 66:                     }
 67:                     $html .= $html_post;
 68:                 }
 69:                 break;
 70: 
 71:             case 'Whitelist':
 72:                 if (in_array(Ingo_Storage::ACTION_WHITELIST, $s_categories)) {
 73:                     $html .= $html_pre .
 74:                         Horde::img('whitelist.png', _("Whitelist")) .
 75:                         '</td><td>' .
 76:                         Horde::url('whitelist.php')->link(array('title' => _("Edit"))) .
 77:                         _("Whitelist") . '</a> ' . $active . $html_post;
 78:                 }
 79:                 break;
 80: 
 81:             case 'Blacklist':
 82:                 if (in_array(Ingo_Storage::ACTION_BLACKLIST, $s_categories)) {
 83:                     $html .= $html_pre .
 84:                         Horde::img('blacklist.png', _("Blacklist")) .
 85:                         '</td><td>' .
 86:                         Horde::url('blacklist.php')->link(array('title' => _("Edit"))) .
 87:                         _("Blacklist") . '</a> ' . $active . $html_post;
 88:                 }
 89:                 break;
 90: 
 91:             case 'Spam Filter':
 92:                 if (in_array(Ingo_Storage::ACTION_SPAM, $s_categories)) {
 93:                     $html .= $html_pre .
 94:                         Horde::img('spam.png', _("Spam Filter")) .
 95:                         '</td><td>' .
 96:                         Horde::url('spam.php')->link(array('title' => _("Edit"))) .
 97:                         _("Spam Filter") . '</a> ' . $active . $html_post;
 98:                 }
 99:                 break;
100:             }
101: 
102:         }
103: 
104:         return $html . '</table>';
105:     }
106: 
107: }
108: 
API documentation generated by ApiGen