/** * get admin object description * * @param mixed $language the language code (string) or the CMS_language (object) to use for description * @return string, the description * @access public */ function getDescription($language) { if (is_a($language, "CMS_language")) { return $language->getMessage($this->_objectDescription, false, $this->_messagesModule); } else { $tmplanguage = new CMS_language($language); return $tmplanguage->getMessage($this->_objectDescription, false, $this->_messagesModule); } }
//force language if none exists if (!isset($cms_language) || !is_object($cms_language)) { $cms_language = new CMS_language(ADMINISTRATION_DEFAULT_LANGUAGE); } //get page if (isset($_GET['pageId']) && sensitiveIO::isPositiveInteger($_GET['pageId'])) { $page = CMS_tree::getPageById($_GET['pageId']); } if (isset($page) && !$page->hasError()) { $redirect = ''; $redirectlink = $page->getRedirectLink(true); if ($redirectlink->hasValidHREF()) { if ($redirectlink->getLinkType() == RESOURCE_LINK_TYPE_INTERNAL) { $redirectPage = new CMS_page($redirectlink->getInternalLink()); if (!$redirectPage->hasError()) { $label = $cms_language->getMessage(MESSAGE_PAGE_PAGE) . ' "' . $redirectPage->getTitle() . '" (' . $redirectPage->getID() . ')'; } $redirect = '<a href="' . $redirectPage->getURL(false, false, PATH_RELATIVETO_WEBROOT, true) . '">' . io::htmlspecialchars($label) . '</a>'; } else { $label = $redirectlink->getExternalLink(); $redirectlink->setTarget('_blank'); $redirect = $redirectlink->getHTML(io::ellipsis($label, '80'), MOD_STANDARD_CODENAME, RESOURCE_DATA_LOCATION_EDITED); } } else { $label = $cms_language->getMessage(MESSAGE_PAGE_PAGE) . ' "' . $page->getTitle() . '" (' . $page->getID() . ')'; $redirect = '<a href="' . $page->getURL(false, false, PATH_RELATIVETO_WEBROOT, true) . '">' . io::htmlspecialchars($label) . '</a>'; } $content = ' <div id="atm-center"> <div class="atm-alert">' . $cms_language->getMessage(MESSAGE_PAGE_REDIRECT, array($redirect)) . '</div> </div>';
/** * get object description * * @param mixed $language the language code (string) or the CMS_language (object) to use for description * @return string, the description * @access public */ function getDescription($language) { //get object definition $objectDef = $this->getObjectDefinition(); $description = new CMS_object_i18nm($objectDef->getValue("descriptionID")); if (is_a($language, "CMS_language")) { $subdesc = $description->getValue($language->getCode()); return $language->getMessage($this->_objectDescription, array($subdesc), MOD_POLYMOD_CODENAME); } else { $subdesc = $description->getValue($language); $tmplanguage = new CMS_language($language); return $tmplanguage->getMessage($this->_objectDescription, array($subdesc), MOD_POLYMOD_CODENAME); } }
/** * Returns the label for current status. * * @param CMS_language $language : Current language to get label * @return string label * @access public */ function getStatusLabel($language) { //Hack : check for non-sense status (usually it is a page which creation is not properly done) if ($this->_publication == RESOURCE_PUBLICATION_NEVERVALIDATED && !$this->_editions) { $this->addEdition(RESOURCE_EDITION_CONTENT, $user); $this->writeToPersistence(); } $img_status = $this->_publication == RESOURCE_PUBLICATION_NEVERVALIDATED ? "rond" : "carre"; if ($this->_publication == RESOURCE_PUBLICATION_PUBLIC) { $img_status .= "_pub"; } if ($this->_proposedFor == RESOURCE_LOCATION_DELETED) { $img_status .= "_sup"; } if ($this->_proposedFor == RESOURCE_LOCATION_ARCHIVED) { $img_status .= "_arc"; } if (($this->_editions & RESOURCE_EDITION_BASEDATA || $this->_editions & RESOURCE_EDITION_CONTENT) && !($this->_validationsRefused & RESOURCE_EDITION_BASEDATA) && !($this->_validationsRefused & RESOURCE_EDITION_CONTENT)) { $img_status .= "-o"; } elseif ($this->_validationsRefused & RESOURCE_EDITION_BASEDATA || $this->_validationsRefused & RESOURCE_EDITION_CONTENT || $this->_validationsRefused & RESOURCE_EDITION_LOCATION) { $img_status .= "-r"; } else { $img_status .= "-v"; } if ($this->_editions & RESOURCE_EDITION_SIBLINGSORDER) { if ($this->_validationsRefused & RESOURCE_EDITION_SIBLINGSORDER) { $img_siblings = "orderefuse"; } else { $img_siblings = "ordervalider"; } } if ($this->_editions & RESOURCE_EDITION_MOVE) { if ($this->_validationsRefused & RESOURCE_EDITION_MOVE) { $img_siblings = "mouvrefuse"; } else { $img_siblings = "mouvalider"; } } if ($this->getDraft() && $img_status == 'rond-o') { $img_status = 'draft'; } $label = $this->_getStatusLabel($img_status); $label .= isset($img_siblings) ? ', ' . $this->_getStatusLabel($img_siblings) : ''; if ($lockUserId = $this->getLock()) { $lockUser = CMS_profile_usersCatalog::getById($lockUserId); $lockDate = $this->getLockDate(); if (is_object($lockUser) && is_object($lockDate)) { $label .= ' - ' . $language->getMessage(self::MESSAGE_STATUS_LOCKEDBY) . ' ' . $lockUser->getFullName() . ' (' . $lockDate->getLocalizedDate($language->getDateFormat() . ' - H:i:s') . ')'; } else { $label .= ' - ' . $language->getMessage(self::MESSAGE_STATUS_LOCKED); } } if ($this->getDraft()) { $label .= $img_status != 'draft' ? ' - ' . $language->getMessage(self::MESSAGE_STATUS_DRAFT) : $language->getMessage(self::MESSAGE_STATUS_DRAFT); } /*if ($this->getDraft() && $img_status == 'rond-o') { $label .= $language->getMessage(self::MESSAGE_STATUS_DRAFT); }*/ return $label; }