Overview

Packages

  • Horde
    • Data
  • None
  • Turba

Classes

  • Turba_Application
  • Turba_Block_Minisearch
  • Turba_Exception_NotSupported
  • Turba_View_List_AlphaFilter
  • Turba_View_List_PageFilter
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * Allow searching of address books from the portal.
 4:  *
 5:  * Copyright 2011-2012 Horde LLC (http://www.horde.org/)
 6:  *
 7:  * See the enclosed file LICENSE for license information (ASL).  If you
 8:  * did not receive this file, see http://www.horde.org/licenses/apache.
 9:  */
10: class Turba_Block_Minisearch extends Horde_Core_Block
11: {
12:     /**
13:      * The available options for address book selection
14:      */
15:     protected $_options = array();
16: 
17:     /**
18:      */
19:     public function __construct($app, $params = array())
20:     {
21:         parent::__construct($app, $params);
22:         foreach (Turba::getAddressBooks(Horde_Perms::READ) as $key => $addressbook) {
23:              $this->_options[$key] = $addressbook['title'];
24:         }
25:         $this->_name = _("Contact Search");
26:     }
27: 
28:     /**
29:      */
30:     protected function _title()
31:     {
32:         return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link()
33:             . $this->getName() . '</a>';
34:     }
35: 
36:     /**
37:      */
38:     protected function _params()
39:     {
40:         return array(
41:             'addressbooks' => array(
42:                 'type' => 'multienum',
43:                 'name' => _("Address Books"),
44:                 'values' => $this->_options
45:             )
46:         );
47:     }
48:     /**
49:      */
50:     protected function _content()
51:     {
52:         if ($GLOBALS['browser']->hasFeature('iframes')) {
53:             if (!empty($this->_params['addressbooks'])) {
54:                 $imploded_calendars = implode(';', $this->_params['addressbooks']);
55:             } else {
56:                 $imploded_calendars = implode(';', array_keys($this->_options));
57:             }
58:             Horde::startBuffer();
59:             include TURBA_TEMPLATES . '/block/minisearch.inc';
60:             return Horde::endBuffer();
61:         }
62:         return '<em>' . _("A browser that supports iframes is required") . '</em>';
63:     }
64: 
65: }
66: 
API documentation generated by ApiGen