1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10: class Turba_Block_Minisearch extends Horde_Core_Block
11: {
12: 13: 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: