8 require_once(
'inc/header.inc.php');
9 require_once(CH_DIRECTORY_PATH_INC .
'design.inc.php');
10 require_once(CH_DIRECTORY_PATH_INC .
'languages.inc.php');
19 $_page[
'css_name'] = array(
'searchKeyword.css',
'plugins/fancybox/|jquery.fancybox.css');
20 $_page[
'js_name'] = array(
'plugins/fancybox/|jquery.fancybox.js');
27 <script language=
"javascript">
28 function toggleState(sItem) {
29 $(
'#'+sItem).toggleClass(
'ch-btn-disabled', !$(
'#'+sItem).hasClass(
'ch-btn-disabled'));
31 function serializeButtons() {
33 $(
'button',
'#buttonArea').each(
function(index) {
34 if (!$(
this).hasClass(
'ch-btn-disabled')) {
35 sQuery +=
'§ion[]=' + $(
this).prop(
'id');
41 $(
'#searchForm').bind(
'submit',
function() {
42 ch_loading(
'searchForm',
true);
43 var sQuery = $(
'input',
'#searchForm').serialize();
44 sQuery += serializeButtons();
45 $.post(
'searchKeywordContent.php', sQuery,
function(data) {
46 $(
'#searchArea').html(data);
47 ch_loading(
'searchForm',
false);
62 if (mb_strlen(
$sCode) == 0)
78 $aList =
$GLOBALS[
'MySQL']->fromCache(
'sys_objects_search',
'getAllWithKey',
81 `ClassName` as `class`,
82 `ClassPath` as `file`,
84 FROM `sys_objects_search`',
'ObjectName'
87 foreach ($aList
as $sKey => $aValue) {
88 $aValues[$sKey] =
_t($aValue[
'title']);
89 if (!class_exists($aValue[
'class'])) {
90 $sPath = CH_DIRECTORY_PATH_ROOT . str_replace(
'{tmpl}',
$GLOBALS[
'tmpl'], $aValue[
'file']);
93 $oClass =
new $aValue[
'class']();
94 $oClass->addCustomParts();
97 $sButtons =
'<div id="buttonArea" class="ch-btn-area clearfix">';
98 foreach ($aList
as $sKey => $aValue) {
100 if (isset(
$_GET[
'type']))
101 $sClassAdd =
$_GET[
'type'] == $sKey ?
'' :
'ch-btn-disabled';
102 $sButtons .=
'<button class="ch-btn ch-btn-centered ' . $sClassAdd .
'" type="button" id="' . $sKey .
'" onclick="toggleState(\'' . $sKey .
'\');
">' . _t($aValue['title']) . '</button>';
104 $sButtons .= '</div>';
107 'form_attrs' => array(
108 'id' => 'searchForm',
117 'caption' => _t('_Keyword')
122 'value' => _t('_Search')
127 $oForm = new ChTemplFormView($aForm);
128 $sFormVal = $oForm->getCode();
130 return DesignBoxContent(_t( "_Search
" ), $sButtons . $sFormVal, 11);