1: <?php
  2:   3:   4:   5:   6:   7:   8:   9:  10:  11:  12:  13:  14: 
 15: abstract class IMP_Minimal_Base
 16: {
 17:      18:  19: 
 20:     public $indices;
 21: 
 22:      23:  24: 
 25:     public $title;
 26: 
 27:      28:  29: 
 30:     public $vars;
 31: 
 32:      33:  34: 
 35:     public $view;
 36: 
 37:      38:  39: 
 40:     protected $_pages = array(
 41:         'header'
 42:     );
 43: 
 44:      45: 
 46:     public function __construct(Horde_Variables $vars)
 47:     {
 48:         $this->vars = $vars;
 49: 
 50:         $this->indices = new IMP_Indices_Mailbox($vars);
 51: 
 52:         $this->view = new Horde_View(array(
 53:             'templatePath' => IMP_TEMPLATES . '/minimal'
 54:         ));
 55:         $this->view->addHelper('Text');
 56: 
 57:         $this->_init();
 58:     }
 59: 
 60:      61: 
 62:     public function render()
 63:     {
 64:         foreach ($this->_pages as $val) {
 65:             echo $this->view->render($val);
 66:         }
 67:     }
 68: 
 69:      70:  71:  72:  73:  74:  75:  76:  77:  78: 
 79:     public function ($page, $items = array())
 80:     {
 81:         if (!in_array($page, array('mailbox', 'message')) ||
 82:             !$this->indices->mailbox->inbox) {
 83:             $items[] = array(_("Inbox"), IMP_Minimal_Mailbox::url(array('mailbox' => 'INBOX')));
 84:         }
 85: 
 86:         if (!in_array($page, array('compose', 'search')) &&
 87:             IMP_Compose::canCompose()) {
 88:             $items[] = array(_("New Message"), IMP_Minimal_Compose::url());
 89:         }
 90: 
 91:         if (!in_array($page, array('folders', 'search')) &&
 92:             $GLOBALS['injector']->getInstance('IMP_Factory_Imap')->create()->access(IMP_Imap::ACCESS_FOLDERS)) {
 93:             $items[] = array(_("Folders"), IMP_Minimal_Folders::url());
 94:         }
 95: 
 96:         $items[] = array(_("Log out"), $GLOBALS['registry']->getServiceLink('logout', 'imp')->setRaw(false));
 97: 
 98:         $menu = new Horde_Menu();
 99:         foreach ($menu->getSiteLinks() as $menuitem) {
100:             if ($menuitem != 'separator') {
101:                 $items[] = array($menuitem['text'], $menuitem['url']);
102:             }
103:         }
104: 
105:         return $items;
106:     }
107: 
108:     109: 
110:     abstract protected function _init();
111: 
112:     113: 
114:     public static function url(array $opts = array())
115:     {
116:     }
117: 
118: }
119: