Exemple #1
0
$search_form->addElement($type_select);
if (!empty($mids)) {
    $mods_checkbox = new icms_form_elements_Checkbox(_SR_SEARCHIN, "mids[]", $mids);
} else {
    $mods_checkbox = new icms_form_elements_Checkbox(_SR_SEARCHIN, "mids[]", $mid);
}
if (empty($modules)) {
    $criteria = new icms_db_criteria_Compo();
    $criteria->add(new icms_db_criteria_Item('hassearch', 1));
    $criteria->add(new icms_db_criteria_Item('isactive', 1));
    if (!empty($available_modules)) {
        $criteria->add(new icms_db_criteria_Item('mid', "(" . implode(',', $available_modules) . ")", 'IN'));
    }
    $module_handler = icms::handler('icms_module');
    $mods_checkbox->addOptionArray($module_handler->getList($criteria));
} else {
    unset($module);
    foreach (array_keys($modules) as $mid) {
        $module_array[$mid] = $modules[$mid]->getVar('name');
    }
    $mods_checkbox->addOptionArray($module_array);
}
$search_form->addElement($mods_checkbox);
if ($icmsConfigSearch['keyword_min'] > 0) {
    $search_form->addElement(new icms_form_elements_Label(_SR_SEARCHRULE, sprintf(_SR_KEYIGNORE, icms_conv_nr2local($icmsConfigSearch['keyword_min']))));
}
$search_form->addElement(new icms_form_elements_Hidden("action", "results"));
$search_form->addElement(new icms_form_elements_Hiddentoken('id'));
$search_form->addElement(new icms_form_elements_Button("", "submit", _SR_SEARCH, "submit"));
return $search_form->render();
Exemple #2
0
/**
 * Adding an image for the Image manager
 *
 * @return	string    The constructed HTML form for the adding of an image
 */
function showAddImgForm($imgcat_id) {
	global $target, $type;
	$imgcat_handler = icms::handler('icms_image_category');
	$form = new icms_form_Theme(_ADDIMAGE, 'image_form', $_SERVER['SCRIPT_NAME'], 'post', TRUE);
	$form->setExtra('enctype="multipart/form-data"');
	$form->addElement(new icms_form_elements_Text(_IMAGENAME, 'image_nicename', 50, 255), TRUE);
	$select = new icms_form_elements_Select(_IMAGECAT, 'imgcat_id', (int) $imgcat_id);
	$select->addOptionArray($imgcat_handler->getCategList());
	$form->addElement($select, TRUE);
	$form->addElement(new icms_form_elements_File(_IMAGEFILE, 'image_file', 5000000));
	$form->addElement(new icms_form_elements_Text(_IMGWEIGHT, 'image_weight', 3, 4, 0));
	$form->addElement(new icms_form_elements_Radioyn(_IMGDISPLAY, 'image_display', 1, _YES, _NO));
	$form->addElement(new icms_form_elements_Hidden('imgcat_id', $imgcat_id));
	$form->addElement(new icms_form_elements_Hidden('op', 'addfile'));
	$form->addElement(new icms_form_elements_Hidden('target', $target));
	$form->addElement(new icms_form_elements_Hidden('type', $type));
	$tray = new icms_form_elements_Tray('' , '');
	$tray->addElement(new icms_form_elements_Button('', 'img_button', _SUBMIT, 'submit'));
	$btn = new icms_form_elements_Button('', 'reset', _CANCEL, 'button');
	$btn->setExtra('onclick="document.getElementById(\'addimgform\').style.display = \'none\'; return FALSE;"');
	$tray->addElement($btn);
	$form->addElement($tray);
	return $form->render();
}