$searchParamContent[] = array('fieldLabel' => $mandatory . $cms_language->getMessage(MESSAGE_PAGE_FIELD_LIMIT, false, MOD_POLYMOD_CODENAME), 'name' => 'value[search][' . $searchName . '][' . $paramType . ']', 'anchor' => '99%', 'allowNegative' => false, 'allowDecimals' => false, 'xtype' => 'numberfield', 'allowBlank' => !$mandatory, 'value' => $value);
     break;
 case 'order':
     if (sizeof($paramValue)) {
         $orderNameList = array('objectID' => MESSAGE_PAGE_FIELD_ORDER_OBJECTID, 'random' => MESSAGE_PAGE_FIELD_ORDER_RANDOM, 'publication date after' => MESSAGE_PAGE_FIELD_ORDER_PUBLICATION_START, 'publication date before' => MESSAGE_PAGE_FIELD_ORDER_PUBLICATION_END);
         $searchOrderContent = array();
         foreach ($paramValue as $orderName => $orderValue) {
             $fieldLabel = '';
             if (in_array($orderName, CMS_object_search::getStaticOrderConditionTypes())) {
                 $fieldLabel = $cms_language->getMessage($orderNameList[$orderName], false, MOD_POLYMOD_CODENAME);
             } else {
                 $orderName = trim($orderName, '()');
                 if (io::isPositiveInteger($orderName)) {
                     $field = new CMS_poly_object_field($orderName);
                     if ($field && !$field->hasError()) {
                         $label = new CMS_object_i18nm($field->getValue('labelID'));
                         $fieldLabel = $label->getValue($cms_language->getCode());
                     }
                 }
             }
             if ($fieldLabel) {
                 // Order direction
                 $mandatory = $paramValue == true ? '<span class="atm-red">*</span> ' : '';
                 $value = isset($data["value"]['search'][$searchName][$paramType][$orderName]) ? $data["value"]['search'][$searchName][$paramType][$orderName] : '';
                 $searchOrderContent[] = array('xtype' => 'atmCombo', 'fieldLabel' => $mandatory . $fieldLabel, 'name' => 'value[search][' . $searchName . '][' . $paramType . '][' . $orderName . ']', 'hiddenName' => 'value[search][' . $searchName . '][' . $paramType . '][' . $orderName . ']', 'forceSelection' => true, 'mode' => 'local', 'valueField' => 'id', 'displayField' => 'name', 'triggerAction' => 'all', 'allowBlank' => !$mandatory, 'selectOnFocus' => true, 'editable' => false, 'value' => $value, 'store' => array('xtype' => 'arraystore', 'fields' => array('id', 'name'), 'data' => array(array('', '-'), array('asc', $cms_language->getMessage(MESSAGE_PAGE_FIELD_ORDER_ASC, false, MOD_POLYMOD_CODENAME)), array('desc', $cms_language->getMessage(MESSAGE_PAGE_FIELD_ORDER_DESC, false, MOD_POLYMOD_CODENAME)))));
             } else {
                 $cms_message .= $cms_language->getMessage(MESSAGE_PAGE_SEARCH_ORDERTYPE_ERROR, array($searchName, $row->getLabel(), $orderName), MOD_POLYMOD_CODENAME) . "\n";
             }
         }
         $searchParamContent[] = array('title' => $cms_language->getMessage(MESSAGE_PAGE_FIELD_ORDER, false, MOD_POLYMOD_CODENAME), 'xtype' => 'fieldset', 'autoHeight' => true, 'defaults' => array('anchor' => '97%'), 'items' => $searchOrderContent);
     }
define("MESSAGE_PAGE_FIELD_DESCRIPTION", 139);
define("MESSAGE_PAGE_TREEH1", 1049);
define("MESSAGE_FIELD_NO", 1083);
define("MESSAGE_FIELD_YES", 1082);
//Polymod messages
define("MESSAGE_PAGE_FIELD_INDEXABLE", 322);
//checks rights
if (!$cms_user->hasAdminClearance(CLEARANCE_ADMINISTRATION_EDITVALIDATEALL)) {
    header("Location: " . PATH_ADMIN_SPECIAL_ENTRY_WR . "?cms_message_id=" . MESSAGE_PAGE_CLEARANCE_ERROR . "&" . session_name() . "=" . session_id());
    exit;
}
//load page objects and vars
$moduleCodename = $_POST["moduleCodename"] ? $_POST["moduleCodename"] : $_GET["moduleCodename"];
$object = new CMS_poly_object_definition($_POST["object"]);
$field = new CMS_poly_object_field($_POST["field"]);
$label = new CMS_object_i18nm($field->getValue("labelID"));
$description = new CMS_object_i18nm($field->getValue("descriptionID"));
$availableLanguagesCodes = CMS_object_i18nm::getAvailableLanguages();
$cms_message = "";
// ****************************************************************
// ** ACTIONS MANAGEMENT                                         **
// ****************************************************************
switch ($_POST["cms_action"]) {
    case "validate":
        //checks and assignments
        $field->setDebug(false);
        if (!$_POST["label" . $availableLanguagesCodes[0]] || !$_POST["type"]) {
            $cms_message .= $cms_language->getMessage(MESSAGE_FORM_ERROR_MANDATORY_FIELDS);
        }
    case 'switchexplanation':
    case "newtype":
        if (class_exists('CMS_module_ase') && CMS_module_ase::isActive()) {
            $content .= '
					<th width="70" class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_INDEXABLE, false, MOD_POLYMOD_CODENAME) . '</th>';
        }
        $content .= '
			<th width="150" class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_ACTIONS) . '</th>
			<th width="36" class="admin">' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_ORDER) . '</th>
		</tr>
		</table>
		<ul id="fields" class="sortable">
		';
        $count = 0;
        foreach ($fields as $field) {
            $count++;
            $td_class = $count % 2 == 0 ? "admin_lightgreybg" : "admin_darkgreybg";
            $type = $field->getValue("type");
            $label = new CMS_object_i18nm($field->getValue("labelID"));
            $typeObject = $field->getTypeObject(true);
            if (is_object($typeObject)) {
                $content .= '
				<li id="f' . $field->getID() . '" alt="ID : ' . $field->getID() . '" title="ID : ' . $field->getID() . '">
					<table border="0" cellpadding="2" cellspacing="2">
					<tr>
						<td width="150" class="' . $td_class . '">' . $label->getValue($cms_language->getCode());
                if (POLYMOD_DEBUG) {
                    $content .= ' <span class="admin_text_alert"><small>(FieldID : ' . $field->getID() . ')</small></span>';
                }
                $content .= '
						</td>
						<td width="150" class="' . $td_class . '">' . $typeObject->getObjectLabel($cms_language) . '</td>
						<td width="200" class="' . $td_class . '">' . $typeObject->getDescription($cms_language) . '</td>';