コード例 #1
0
ファイル: QuickSearch_0.php プロジェクト: 62BRAINS/EPESI
 public function applet($conf, &$opts)
 {
     $recordset = "quick_search";
     $theme = $this->init_module('Base/Theme');
     $form = $this->init_module('Libs/QuickForm');
     $txtQuery = 'query_text';
     $txtLabel = 'query_label';
     $btnQuery = 'query_button';
     $id = $conf['criteria'];
     $searchPrompt = Applets_QuickSearchCommon::getSearchPromptById($id);
     $conf['a_title'] = $conf['a_title'] == "Quick Search" ? Applets_QuickSearchCommon::getPresetNameById($id) : $conf['a_title'];
     $placeholder = $searchPrompt == "" ? "" : $searchPrompt;
     $opts['title'] = $conf['a_title'];
     $opts['go'] = false;
     load_css('modules/Applets/QuickSearch/theme/quick_form.css');
     load_js('modules/Applets/QuickSearch/js/quicksearch.js');
     //$js ='setDelayOnSearch()';
     //eval_js($js);
     $txt = $form->addElement('text', $txtQuery, __('Search'));
     $txt->setAttribute('id', $txtQuery . "_" . $id);
     $txt->setAttribute('class', 'QuickSearch_text');
     $txt->setAttribute('onkeypress', 'setDelayOnSearch(\'' . $id . '\')');
     $txt->setAttribute('placeholder', _V($placeholder));
     $theme->assign($txtLabel, __('Search'));
     $theme->assign($txtQuery, $txt->toHtml());
     $theme->assign('search_id', $conf['criteria']);
     $theme->display('quick_form');
     return true;
 }