示例#1
0
     $value = isset($data["value"]['search'][$searchName][$paramType]) ? $data["value"]['search'][$searchName][$paramType] : '';
     $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);
示例#2
0
     }
     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);
     } else {
         $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_DELETE_OBJECT_ERROR);
     }
     break;
 case "delete":
     $field = new CMS_poly_object_field($_POST["field"]);
     if (!$field->hasError() && $field->destroy()) {
         //then reload object
         if (sensitiveIO::IsPositiveInteger($objectID)) {
             $object = new CMS_poly_object_definition($objectID);
         }
         $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE);
     } else {
         $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_DELETE_FIELD_ERROR);
     }
     break;
 case 'deleteRSS':
     $RSSDefinition = new CMS_poly_rss_definitions($_POST['RSSDefinition']);
     $RSSDefinition->destroy();
     $cms_message .= $cms_language->getMessage(MESSAGE_ACTION_OPERATION_DONE);
     break;
 case 'deletePlugin':