3
* Allow searching of address books from the portal.
5
* Copyright 2011-2013 Horde LLC (http://www.horde.org/)
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.
10
class Turba_Block_Minisearch extends Horde_Core_Block
13
* The available options for address book selection
17
protected $_options = array();
21
public function __construct($app, $params = array())
23
parent::__construct($app, $params);
24
foreach (Turba::getAddressBooks(Horde_Perms::READ) as $key => $addressbook) {
25
$this->_options[$key] = $addressbook['title'];
27
$this->_name = _("Contact Search");
32
protected function _title()
34
return Horde::url($GLOBALS['registry']->getInitialPage(), true)->link()
35
. $this->getName() . '</a>';
40
protected function _params()
43
'addressbooks' => array(
44
'type' => 'multienum',
45
'name' => _("Address Books"),
46
'values' => $this->_options
52
protected function _content()
54
global $page_output, $registry;
56
$abooks = empty($this->_params['addressbooks'])
57
? array_keys($this->_options)
58
: $this->_params['addressbooks'];
60
$page_output->addInlineJsVars(array(
61
'TurbaMinisearch.abooks' => $abooks,
62
'TurbaMinisearch.URI_AJAX' => $registry->getServiceLink('ajax', 'turba')->url
64
$page_output->addScriptFile('minisearch.js');
67
include TURBA_TEMPLATES . '/block/minisearch.inc';
68
return Horde::endBuffer();