define("MESSAGE_PAGE_FIELD_OBJECT_USEAGE", 1281); define("MESSAGE_PAGE_FIELD_OBJECT_USED", 1282); define("MESSAGE_PAGE_FIELD_OBJECT_GRAYED_INFOS", 1292); define("MESSAGE_PAGE_FIELD_COMPOSED_LABEL", 1294); define("MESSAGE_PAGE_FIELD_ONLY_FOR_ADMIN", 1276); //Polymod messages define("MESSAGE_PAGE_FIELD_MULTI", 190); //checks 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; } $moduleCodename = $_POST["moduleCodename"] ? $_POST["moduleCodename"] : $_GET["moduleCodename"]; $object = new CMS_poly_object_definition($_POST["object"]); $availableLanguagesCodes = CMS_object_i18nm::getAvailableLanguages(); $objectsStructure = CMS_poly_module_structure::getModuleStructure($moduleCodename, true); if ($moduleCodename) { $polymod = CMS_modulesCatalog::getByCodename($moduleCodename); } $dialog = new CMS_dialog(); $content = ''; $dialog->setTitle($cms_language->getMessage(MESSAGE_PAGE_TITLE_APPLICATIONS) . " :: " . $polymod->getLabel($cms_language) . " :: " . $cms_language->getMessage(MESSAGE_PAGE_TITLE, array($object->getLabel($cms_language))), 'picto_modules.gif'); $dialog->setBacklink("modules_admin.php?moduleCodename=" . $moduleCodename . "&object=" . $object->getID()); if ($cms_message) { $dialog->setActionMessage($cms_message); } $resourceStatus = array(0 => MESSAGE_PAGE_FIELD_RESOURCE_NONE, 1 => MESSAGE_PAGE_FIELD_RESOURCE_PRIMARY, 2 => MESSAGE_PAGE_FIELD_RESOURCE_SECONDARY); $adminEditableStatus = array(0 => MESSAGE_PAGE_FIELD_YES, 1 => MESSAGE_PAGE_FIELD_NO, 2 => MESSAGE_PAGE_FIELD_ONLY_FOR_ADMIN); $objectUseage = CMS_poly_object_catalog::getObjectUsage($object->getID(), true); if (!sizeof($objectUseage)) { $objectUseageLabel = $cms_language->getMessage(MESSAGE_PAGE_FIELD_NO) . '<br />';
/** * Return an options tag list (for select tag) of all module objects infos * * @param string $codename the module codename * @param CMS_language $language : current language * @param string $selectedValue : the current selected value of the list * @param integer $objectID : the module object ID to restrict the list (default false : all objects of the module) * @return string : the options tag list * @access public * @static */ function viewObjectInfosList($codename, &$language, $selectedValue, $objectID = false) { //get module structure $objectsStructure = CMS_poly_module_structure::getModuleStructure($codename, true); if ($objectID && isset($objectsStructure['object' . $objectID])) { $currentPath = '[\'object' . $objectID . '\']'; $selected = $currentPath == $selectedValue ? ' selected="selected"' : ''; $list = '<option value="' . $currentPath . '" style="font-weight: bold;"' . $selected . '>' . $objectsStructure['objectInfos']['object' . $objectID]->getObjectLabel($language) . '</option>'; $list .= CMS_poly_module_structure::_viewObjectInfosList($objectID, $language, $objectsStructure, $selectedValue, '[object' . $objectID . ']'); } else { $list = ''; foreach ($objectsStructure as $objectID => $objectStructure) { if ($objectID != 'objectInfos' && CMS_poly_object_catalog::getModuleCodenameForObjectType(io::substr($objectID, 6)) == $codename) { $currentPath = '[\'' . $objectID . '\']'; $selected = $currentPath == $selectedValue ? ' selected="selected"' : ''; $list .= '<option value="' . $currentPath . '" style="font-weight: bold;"' . $selected . '>' . $objectsStructure['objectInfos'][$objectID]->getObjectLabel($language) . '</option>'; $list .= CMS_poly_module_structure::_viewObjectInfosList(io::substr($objectID, 6), $language, $objectsStructure, $selectedValue, $currentPath); } } } return $list; }