Example #1
0
    if (is_object($object)) {
        $objectUseage = CMS_poly_object_catalog::getObjectUsage($object->getID(), true);
        if (!sizeof($objectUseage)) {
            $objectUseageLabel = $cms_language->getMessage(MESSAGE_PAGE_FIELD_NO) . '<br />';
        } else {
            $objectUseageLabel = $cms_language->getMessage(MESSAGE_PAGE_FIELD_OBJECT_USED) . ' : <ul>';
            foreach ($objectUseage as $anObjectWhichUse) {
                $objectUseageLabel .= '<li>' . $anObjectWhichUse->getLabel() . '</li>';
            }
            $objectUseageLabel .= '</ul>';
        }
        $fields = CMS_poly_object_catalog::getFieldsDefinition($object->getID(), true);
        //get all RSS def for object
        $RRSDefinitions = CMS_poly_object_catalog::getAllRSSDefinitionsForObject($object->getID());
        //get all plugin def for object
        $pluginDefinitions = CMS_poly_object_catalog::getAllPluginDefinitionsForObject($object->getID());
        $content .= '
		<strong>ID :</strong> ' . $object->getID() . '<br />
		<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_DESCRIPTION) . ' :</strong> ' . $object->getDescription($cms_language) . '<br />
		<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_RESOURCE) . ' :</strong> ' . $cms_language->getMessage($resourceStatus[$object->getValue("resourceUsage")]) . '<br />
		<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_EDITABLE) . ' :</strong> ' . $cms_language->getMessage($adminEditableStatus[$object->getValue("admineditable")]) . '<br />
		<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_COMPOSED_LABEL) . ' :</strong> ' . $cms_language->getMessage($adminEditableStatus[$object->getValue("composedLabel") ? 0 : 1]) . '<br />
		<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_OBJECT_USEAGE) . ' :</strong> ' . $objectUseageLabel;
        if (class_exists('CMS_module_ase') && CMS_module_ase::isActive()) {
            $content .= '<strong>' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_OBJECT_INDEXABLE, false, MOD_POLYMOD_CODENAME) . ' :</strong> ' . $cms_language->getMessage($adminIndexableStatus[$object->getValue("indexable") ? 0 : 1]) . '<br />';
        }
        $content .= '
		<form action="polymod_object.php" method="post">
		<td class="admin">
			<input type="hidden" name="moduleCodename" value="' . $moduleCodename . '" />
			<input type="hidden" name="object" value="' . $object->getID() . '" />
Example #2
0
$view->setDisplayMode(CMS_view::SHOW_RAW);
//This file is an admin file. Interface must be secure
$view->setSecure();
$winId = sensitiveIO::request('winId');
$id = sensitiveIO::request('id');
$content = sensitiveIO::request('content');
//get ids from wysiwyg
if ($id) {
    $ids = explode('-', $id);
    $selectedPluginID = (int) $ids[1];
    $selectedItem = (int) $ids[2];
} else {
    $selectedPluginID = $selectedItem = 0;
}
//Select WYSIWYG Plugin
$pluginDefinitions = CMS_poly_object_catalog::getAllPluginDefinitionsForObject();
//check for user rights
$availablePlugin = array();
$availablePluginCount = 0;
if (sizeof($pluginDefinitions)) {
    foreach ($pluginDefinitions as $id => $pluginDefinition) {
        $objectID = $pluginDefinition->getValue('objectID');
        $polyModuleCodename = CMS_poly_object_catalog::getModuleCodenameForObjectType($objectID);
        if ($cms_user->hasModuleClearance($polyModuleCodename, CLEARANCE_MODULE_EDIT)) {
            $availablePlugin[$polyModuleCodename][$id] = $pluginDefinition;
            $availablePluginCount++;
        }
    }
}
//if no plugin available, display error and quit
if (!sizeof($availablePlugin)) {
Example #3
0
 /**
  * Get object as an array structure used for export
  *
  * @param array $params The export parameters.
  *		array(
  *				objects	=> false|true : export module objects structures (default : true)
  *			)
  * @param array $files The reference to the found files used by object
  * @return array : the object array structure
  * @access public
  */
 public function asArray($params = array(), &$files)
 {
     $aModule = parent::asArray($params, $files);
     if (in_array('objects', $params)) {
         //get all objects definitions
         $objectsDefinitions = CMS_poly_object_catalog::getObjectsForModule($this->_codename);
         if ($objectsDefinitions) {
             $aModule['objects'] = array();
             foreach ($objectsDefinitions as $object) {
                 //objects structures
                 $objectDatas = $object->asArray($params, $files);
                 //rss structures
                 $rssFeeds = CMS_poly_object_catalog::getAllRSSDefinitionsForObject($object->getID());
                 if ($rssFeeds) {
                     $objectDatas['rss'] = array();
                     foreach ($rssFeeds as $rssFeed) {
                         $objectDatas['rss'][] = $rssFeed->asArray($params, $files);
                     }
                 }
                 //plugins structure
                 $plugins = CMS_poly_object_catalog::getAllPluginDefinitionsForObject($object->getID());
                 if ($plugins) {
                     $objectDatas['plugins'] = array();
                     foreach ($plugins as $plugin) {
                         $objectDatas['plugins'][] = $plugin->asArray($params, $files);
                     }
                 }
                 $aModule['objects'][] = $objectDatas;
             }
         }
     }
     $aModule['polymod'] = true;
     return $aModule;
 }