$_page['extra_js'] = ob_get_clean();
$_ni = $_page['name_index'];
$oZ = new BxDolSearch();
if ($_REQUEST['keyword']) {
$sCode = $oZ->response();
if (mb_strlen($sCode) == 0)
$sCode = $oZ->getEmptyResult();
}
$sForm = getSearchForm();
$sSearchArea = '
'.$sCode.'
';
$_page_cont[$_ni]['page_main_code'] = $sForm . $sSearchArea;
$aVars = array ();
$GLOBALS['oTopMenu']->setCustomSubActions($aVars, '');
PageCode();
function getSearchForm () {
$aList = $GLOBALS['MySQL']->fromCache('sys_objects_search', '');
$aValues = array();
foreach ($aList as $sKey => $aValue) {
$aValues[$sKey] = _t($aValue['title']);
if (!class_exists($aValue['class'])) {
$sPath = BX_DIRECTORY_PATH_ROOT . str_replace('{tmpl}', $GLOBALS['tmpl'], $aValue['file']);
require_once($sPath);
}
$oClass = new $aValue['class']();
$oClass->addCustomParts();
}
if (isset($_GET['type'])) {
$aValue = strip_tags($_GET['type']);
}
else
$aValue = array_keys($aValues);
$aForm = array(
'form_attrs' => array(
'id' => 'searchForm',
'action' => '',
'method' => 'post',
'onsubmit' => '',
),
'inputs' => array(
'section' => array(
'type' => 'checkbox_set',
'name' => 'section',
'caption' => _t('_Section'),
'values' => $aValues,
'value' => $aValue,
),
'keyword' => array(
'type' => 'text',
'name' => 'keyword',
'caption' => _t('_Keyword')
),
'search' => array(
'type' => 'submit',
'name' => 'search',
'value' => _t('_Search')
)
)
);
$oForm = new BxTemplFormView($aForm);
$sFormVal = $oForm->getCode();
return DesignBoxContent(_t( "_Search" ), $sFormVal, 1);
}
?>