protected function renderContent() { $titleView = new TitleBarView(Zurmo::t('ZurmoModule', 'Global Search'), null, 1); $content = $titleView->render(); $model = new MixedModelsSearchForm(); $model->setGlobalSearchAttributeNamesAndLabelsAndAll($this->moduleNamesAndLabelsAndAll); $content .= "<div class='wide form'>"; $clipWidget = new ClipWidget(); list($form, $formStart) = $clipWidget->renderBeginWidget('NoRequiredsActiveForm', array('id' => $this->getSearchFormId(), 'action' => $this->sourceUrl, 'enableAjaxValidation' => false, 'clientOptions' => array(), 'focus' => array($model, 'term'), 'method' => 'get')); $content .= $formStart; //Scope search $content .= "<div class='search-view-0'>"; $scope = new MixedModelsSearchElement($model, 'term', $form, array('htmlOptions' => array('id' => 'term'))); $scope->setValue($this->term); if (isset($this->scopeData)) { $scope->setSelectedValue($this->scopeData); } $content .= $scope->render(); //Search button $params = array(); $params['label'] = Zurmo::t('Core', 'Search'); $params['htmlOptions'] = array('id' => $this->getSearchFormId() . '-search', 'onclick' => 'js:$(this).addClass("attachLoadingTarget");'); $element = new SaveButtonActionElement(null, null, null, $params); $content .= $element->render(); $content .= "</div>"; $clipWidget->renderEndWidget(); $content .= "</div>"; $this->renderScripts(); return $content; }
/** * makeViews * @return array moduleName => listView */ private function makeViews() { $globalSearchModuleNamesAndLabelsData = GlobalSearchUtil::getGlobalSearchScopingModuleNamesAndLabelsDataByUser($this->user); foreach ($globalSearchModuleNamesAndLabelsData as $moduleName => $label) { $titleView = new TitleBarView($label, null, 1); $iconClassName = Yii::app()->findModule($moduleName)->getSingularCamelCasedName(); $titleView->setCssClasses(array($iconClassName)); $this->views['titleBar-' . $moduleName] = $titleView; $this->views[$moduleName] = $this->getListView($moduleName, true); } }