-
Notifications
You must be signed in to change notification settings - Fork 1
/
FulltextsearchHelper.php
55 lines (46 loc) · 2.28 KB
/
FulltextsearchHelper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* This file is part of the {@link http://ontowiki.net OntoWiki} project.
*
* @copyright Copyright (c) 2013, {@link http://aksw.org AKSW}
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/
/**
* Helper class for the Fulltextsearch component.
*
* @category OntoWiki
* @package Extensions_Fulltextsearch
* @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
*/
class FulltextsearchHelper extends OntoWiki_Component_Helper
{
/**
* The module view
*
* @var Zend_View_Interface
*/
public $view = null;
public function init() {
$owApp = OntoWiki::getInstance();
// init view
if (null === $this->view) {
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
if (null === $viewRenderer->view) {
$viewRenderer->initView();
}
$this->view = clone $viewRenderer->view;
$this->view->clearVars();
}
if ($owApp->erfurt->isActionAllowed('Debug')) {
$extrasMenu = OntoWiki_Menu_Registry::getInstance()->getMenu('application')->getSubMenu('Extras');
$extrasMenu->setEntry('Configure Index', $owApp->config->urlBase . 'fulltextsearch/info');
}
$this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/js/typeahead.bundle.js');
$this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/js/handlebars.js');
$this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/js/search.js');
$this->view->headScript()->appendFile($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/js/info.js');
$this->view->headLink()->appendStylesheet($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/css/hint.min.css');
$this->view->headLink()->appendStylesheet($this->_config->urlBase . 'extensions/fulltextsearch/templates/fulltextsearch/css/fulltextsearch.css');
}
}