Esempio n. 1
0
     foreach ($availableLanguagesCodes as $aLanguageCode) {
         $label->setValue($aLanguageCode, $_POST["label" . $aLanguageCode]);
     }
     if ($_POST["cms_action"] == 'validate') {
         $label->writeToPersistence();
     }
 }
 if ($_POST["description" . $availableLanguagesCodes[0]]) {
     foreach ($availableLanguagesCodes as $aLanguageCode) {
         $description->setValue($aLanguageCode, $_POST["description" . $aLanguageCode]);
     }
     if ($_POST["cms_action"] == 'validate') {
         $description->writeToPersistence();
     }
 }
 if (!$field->setValue("labelID", $label->getID())) {
     $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_TITLE)));
 }
 if (!$field->setValue("descriptionID", $description->getID())) {
     $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_DESCRIPTION)));
 }
 if ($_POST["type"]) {
     $field->setValue("type", $_POST["type"]);
     $typeObject = $field->getTypeObject(true);
     if (is_object($typeObject) && $typeObject->hasParameters()) {
         $params = $typeObject->treatParams($_POST, 'type');
     }
 } else {
     $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_TYPE)));
 }
 if (!$field->setValue("required", $_POST["required"])) {
Esempio n. 2
0
define("MESSAGE_PAGE_RSS_DEFINITIONS", 290);
define("MESSAGE_PAGE_ACTION_DELETERSSCONFIRM", 291);
define("MESSAGE_PAGE_FIELD_OBJECT_INDEXABLE", 322);
//Polymod message
define("MESSAGE_PAGE_FIELD_INDEXABLE", 322);
if (sensitiveIO::IsPositiveInteger($objectID)) {
    $object = new CMS_poly_object_definition($objectID);
}
// ****************************************************************
// ** ACTIONS MANAGEMENT                                         **
// ****************************************************************
switch ($_POST["cms_action"]) {
    case 'index':
        $field = new CMS_poly_object_field($_POST["field"]);
        if (!$field->hasError()) {
            if (!$field->setValue("indexable", $_POST["indexable"])) {
                $cms_message .= "\n" . $cms_language->getMessage(MESSAGE_FORM_ERROR_MALFORMED_FIELD, array($cms_language->getMessage(MESSAGE_PAGE_FIELD_FRONTEND)));
            } else {
                //save the data
                $field->writeToPersistence();
                $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE);
            }
        }
        break;
    case 'deleteObject':
        if ($object->destroy()) {
            unset($object);
            unset($objectID);
            //unset fields catalog in cache
            CMS_cache::clearTypeCacheByMetas('atm-polymod-structure', array('type' => 'fields'));
            $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE);