Пример #1
0
 /**
  * Get all pages codenames for website
  *
  * @return array(codename => pageId)
  * @access public
  */
 function getAllPagesCodenames()
 {
     $pageIds = CMS_tree::getAllSiblings($this->_root->getID(), false, true);
     if (!is_array($pageIds)) {
         $pageIds = array();
     }
     $pageIds[] = $this->_root->getID();
     //pr($pagesIds);
     $q = new CMS_query("\n\t\t\tselect\n\t\t\t\tpage_pbd, codename_pbd\n\t\t\tfrom\n\t\t\t\tpagesBaseData_edited\n\t\t\twhere\n\t\t\t\tpage_pbd in (" . implode(',', $pageIds) . ")\n\t\t\t\tand codename_pbd != ''\n\t\t");
     $pagesCodenames = $q->getAll();
     $codenames = array();
     foreach ($pagesCodenames as $pageCodename) {
         $codenames[$pageCodename['codename_pbd']] = $pageCodename['page_pbd'];
     }
     return $codenames;
 }
Пример #2
0
 /**
  * Get the content of the template for the specified page and visualization mode.
  * Doesn't translates the atm-linx tags.
  *
  * @param CMS_language $language The language of the administration frontend (for FORM visualization mode)
  * @param CMS_page $page The page we want the content of
  * @param integer $visualizationMode The visualization mode of the page
  * @return string the content
  * @access private
  */
 function getContent(&$language, &$page, $visualizationMode)
 {
     if (!$page instanceof CMS_page || !SensitiveIO::isInSet($visualizationMode, CMS_page::getAllvisualizationModes())) {
         $this->raiseError("Page must be a CMS_page and visualization mode in the possibles");
         return false;
     }
     $returnIndexableContent = false;
     if ($visualizationMode == PAGE_VISUALMODE_HTML_PUBLIC_INDEXABLE) {
         $visualizationMode = PAGE_VISUALMODE_PRINT;
         $returnIndexableContent = true;
     }
     $modulesTreatment = new CMS_modulesTags(MODULE_TREATMENT_CLIENTSPACE_TAGS, $visualizationMode, $this);
     $modulesTreatment->setTreatmentParameters(array("page" => $page, "language" => $language));
     if ($this->_parseDefinitionFile($modulesTreatment) === true) {
         if ($visualizationMode == PAGE_VISUALMODE_PRINT || $returnIndexableContent) {
             $data = '';
             $tags = $modulesTreatment->getTags(array(), true);
             foreach ($tags as $tag) {
                 $data .= $modulesTreatment->treatWantedTag($tag);
             }
         } else {
             $data = $modulesTreatment->treatContent(true);
         }
         //if we only need indexable content, return data here without any treatment on template
         if ($returnIndexableContent) {
             return '<html><body>' . $data . '</body></html>';
         }
         //separate processing for PRINT visualmode
         if ($visualizationMode == PAGE_VISUALMODE_PRINT) {
             //now put the data inside the template
             $template_data = file_get_contents(PATH_PRINT_TEMPLATES_FS);
             //we need to remove doctype if any
             $template_data = preg_replace('#<!doctype[^>]*>#siU', '', $template_data);
             return '<?php /* Template [' . str_replace(PATH_TEMPLATES_FS . '/', '', PATH_PRINT_TEMPLATES_FS) . '] */?>' . str_replace("{{data}}", $data, $template_data);
         } else {
             return '<?php /* Template [' . $this->getLabel() . ' - ' . $this->getDefinitionFile() . '] */?>' . $data;
         }
         return false;
     } else {
         return false;
     }
 }
Пример #3
0
 /**
  * Duplicate current page into another one
  * All contents and external datas are duplicated too
  *
  * @param CMS_user user, the user processing to creation
  * @param integer templateID, a new template to duplicate the page with
  * @param boolean $dontDuplicateContent If true, the content of the page is not duplicated
  * @return CMS_page newly created, or null on error
  */
 function duplicate(&$user, $templateID = 0, $dontDuplicateContent = false)
 {
     $pg = null;
     if ($user->hasPageClearance($this->getID(), CLEARANCE_PAGE_VIEW) && $user->hasModuleClearance(MOD_STANDARD_CODENAME, CLEARANCE_MODULE_EDIT)) {
         $pg = new CMS_page();
         $pg->lock($user);
         $pg->addEdition(RESOURCE_EDITION_CONTENT, $user);
         //Which template to use?
         if (!$templateID) {
             $newTpl = CMS_pageTemplatesCatalog::getCloneFromID($this->_templateID, false, true, false, $this->_templateID);
         } else {
             $newTpl = CMS_pageTemplatesCatalog::getCloneFromID($templateID, false, true, false, $this->_templateID);
         }
         if (!is_a($newTpl, 'CMS_pageTemplate') || $newTpl->hasError()) {
             $this->raiseError("Error during template clone creation.");
         } else {
             $pg->setTemplate($newTpl->getID());
         }
         //Duplicate page base datas
         $pg->setTitle($this->getTitle(), $user);
         $pg->setLinkTitle($this->getLinkTitle(), $user);
         $pg->setDescription($this->getDescription(false, false), $user);
         $pg->setKeywords($this->getKeywords(false, false), $user);
         $pg->setPublicationDates($this->getPublicationDateStart(false), $this->getPublicationDateEnd(false));
         $pg->setReminderOn($this->getReminderOn(false, false), $user);
         $pg->setReminderOnMessage($this->getReminderOnMessage(false, false), $user);
         $pg->setCategory($this->getCategory(false, false), $user);
         $pg->setAuthor($this->getAuthor(false, false), $user);
         $pg->setReplyto($this->getReplyto(false, false), $user);
         $pg->setCopyright($this->getCopyright(false, false), $user);
         $pg->setLanguage($this->getLanguage(false, false), $user);
         $pg->setRobots($this->getRobots(false, false), $user);
         $pg->setPragma($this->getPragma(false, false), $user);
         $pg->setRefresh($this->getRefresh(false, false), $user);
         $pg->setRedirectLink($this->getRedirectLink(), $user);
         $pg->setMetas($this->getMetas(false, false), $user);
         $pg->setCodename($this->getCodename(), $user, false);
         if (SensitiveIO::isPositiveInteger($this->getReminderPeriodicity())) {
             $pg->setReminderPeriodicity($this->getReminderPeriodicity(), $user);
         }
         $pg->writeToPersistence();
         $pg->unlock();
         //Duplicate contents, get all blocks and duplicate them
         if (!$dontDuplicateContent) {
             $this->duplicateContent($user, $pg);
         }
     } else {
         $this->raiseError("User doesn't have rights to do this creation");
     }
     return $pg;
 }
Пример #4
0
 /**
  * Get the HTML display for a page, if it passes the condition of course.
  *
  * @param CMS_page $parsedPage The page in which the linx tag is
  * @param CMS_page $page The page to get the display of
  * @param boolean $public Is the page data to show the public or edited one ?
  * @param integer $rank The rank of the page in the linx targets
  * @param boolean $noerror : Hide all link error (default : false)
  * @return string The html or false if page fails to pass the condition
  * @access public
  */
 function getOutput(&$parsedPage, &$page, $public, $rank, $noerror = false, $noselection = false)
 {
     if (!is_a($page, "CMS_page")) {
         if (!$noerror) {
             $tpl = $parsedPage->getTemplate();
             if (is_a($tpl, 'CMS_pageTemplate')) {
                 $tplName = $tpl->getID() . "\t : " . $tpl->getLabel();
             } else {
                 $tplName = 'No template set !';
             }
             $this->raiseError("Page parameter not defined\n - Page : " . $parsedPage->getID() . "\n - Template : " . $tplName . "\n");
         }
         return false;
     }
     if (!$this->hasCondition() || $this->pagePassesConditions($parsedPage, $page, $public, $rank)) {
         //get pages infos
         $linkTitle = $page->getLinkTitle($public);
         $title = $page->getTitle($public);
         $replace = array("{{title}}" => io::sanitizeHTMLString($linkTitle), "{{jstitle}}" => io::sanitizeHTMLString($linkTitle), "{{pagetitle}}" => io::sanitizeHTMLString($title), "{{jspagetitle}}" => io::sanitizeHTMLString($title), "{{desc}}" => io::sanitizeHTMLString($page->getDescription($public)), "{{href}}" => $page->getURL(), "{{id}}" => $page->getID(), "{{codename}}" => $page->getCodename($public), "{{number}}" => $rank - 1, "{{modulo}}" => ($rank - 1) % 2, "{{currentClass}}" => $parsedPage->getID() == $page->getID() ? "CMS_current" : "", 'id="{{currentID}}"' => $parsedPage->getID() == $page->getID() ? 'id="CMS_current"' : "");
         if (io::strpos($this->_htmlTemplate, '{{isParent}}') !== false) {
             //only if needed because getLineage require a lot of query
             $lineage = CMS_tree::getLineage($page->getID(), $parsedPage->getID(), false, $public);
             $replace['class="{{isParent}}"'] = is_array($lineage) && in_array($parsedPage->getID(), $lineage) ? 'class="CMS_parent"' : "";
             $replace['{{isParent}}'] = is_array($lineage) && in_array($parsedPage->getID(), $lineage) ? 'CMS_parent' : "";
             $replace['id="{{isParent}}"'] = is_array($lineage) && in_array($parsedPage->getID(), $lineage) ? 'id="CMS_parent"' : "";
         }
         if (io::strpos($this->_htmlTemplate, '{{website') !== false) {
             //only if needed because getWebsite require a lot of query
             $website = $page->getWebsite();
             $replace['{{websitetitle}}'] = $website->getLabel();
             $replace['{{websitecodename}}'] = $website->getCodename($public);
         }
         $html = str_replace(array_keys($replace), $replace, $this->_htmlTemplate);
         if (APPLICATION_ENFORCES_ACCESS_CONTROL && $public) {
             $html = $this->_addSlashAroundPHPContent($html);
             //pr($html);
             $replace = array("<?php" => "';", "?>" => "echo '");
             $html = str_replace(array_keys($replace), $replace, $html);
             //if link has noselection flag, use alternative when user has no right on linked page
             if (is_object($noselection)) {
                 $noSelectionContent = $this->_addSlashAroundPHPContent(CMS_DOMDocument::DOMElementToString($noselection, true));
                 $html = '<?php if ($cms_user->hasPageClearance(' . $page->getID() . ', CLEARANCE_PAGE_VIEW)) {' . "\n" . 'echo \'' . $html . '\';' . "\n" . '} else {' . "\n" . 'echo \'' . $noSelectionContent . '\';' . "\n" . '}' . "\n" . '?>';
             } else {
                 $html = '<?php if ($cms_user->hasPageClearance(' . $page->getID() . ', CLEARANCE_PAGE_VIEW)) {' . "\n" . 'echo \'' . $html . '\';' . "\n" . '}' . "\n" . '?>';
             }
         }
         return $html;
     } else {
         return false;
     }
 }
Пример #5
0
 /**
  * Computes the target of the tag.
  *
  * @param CMS_page $page The page where the linx tag is.
  * @param string $publicTree Is the calculus made in the public or edited tree ?
  * @return CMS_page The target page, of false if no target.
  * @access public
  */
 function getTarget(&$page, $publicTree)
 {
     $pg = false;
     switch ($this->_type) {
         case "node":
             $pg = CMS_tree::getPageByID($this->_value);
             if ($pg && !$pg->hasError()) {
                 return $pg;
             } else {
                 return false;
             }
             break;
         case "codename":
             if ($this->_website) {
                 $website = CMS_websitesCatalog::getByCodename($this->_website);
                 if ($website) {
                     $pg = CMS_tree::getPageByCodename($this->_value, $website, $publicTree, true);
                 }
             } else {
                 if ($this->_crosswebsite) {
                     return CMS_tree::getPagesByCodename($this->_value, $publicTree, true);
                 } else {
                     $pg = CMS_tree::getPageByCodename($this->_value, $page->getWebsite(), $publicTree, true);
                 }
             }
             if ($pg && !$pg->hasError()) {
                 return $pg;
             } else {
                 return false;
             }
             break;
         case "relative":
             switch ($this->_value) {
                 case "root":
                     if ($this->_website) {
                         $website = CMS_websitesCatalog::getByCodename($this->_website);
                         if ($website) {
                             $pg = $website->getRoot();
                         }
                     } else {
                         $offset = abs($this->_relativeOffset) * -1;
                         $pg = CMS_tree::getAncestor($page, $offset, !$this->_crosswebsite, false);
                         //here we do not want to use public tree because, in public tree, some page may be unpublished or in this case, it break the lineage and root page cannot be found
                     }
                     break;
                 case "father":
                     $offset = abs($this->_relativeOffset);
                     $pg = CMS_tree::getAncestor($page, $offset, !$this->_crosswebsite, $publicTree);
                     break;
                 case "self":
                     $pg = $page;
                     break;
                 case "brother":
                     $pg = CMS_tree::getBrother($page, $this->_relativeOffset, $publicTree);
                     break;
             }
             if ($this->_website && is_a($pg, 'CMS_page') && !$pg->hasError()) {
                 if ($pg->getCodename()) {
                     $website = CMS_websitesCatalog::getByCodename($this->_website);
                     $pg = $website ? CMS_tree::getPageByCodename($pg->getCodename(), $website, $publicTree, true) : false;
                 } else {
                     $pg = false;
                 }
             }
             if (is_a($pg, 'CMS_page') && !$pg->hasError()) {
                 return $pg;
             } else {
                 return false;
             }
             break;
     }
 }
Пример #6
0
$view->addCSSFile('main');
$view->addCSSFile('info');
//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">
Пример #7
0
 /**
  * Create datas from definition.
  * Parse definition and create PHP / HTML string
  *
  * @param serialized datas $rawDatas : The user specified parameters for the row
  * @param CMS_page $page The reference of the current page using block
  * @param boolean $public The needed precision for USERSPACE location (default : false)
  * @param constant $type The needed return type of datas (default : CMS_polymod_definition_parsing::OUTPUT_RESULT)
  * @return string The PHP / HTML datas
  * @access private
  */
 protected function _createDatasFromDefinition($rawDatas, &$page, $visualizationMode, $type = CMS_polymod_definition_parsing::OUTPUT_RESULT)
 {
     $public = $visualizationMode == PAGE_VISUALMODE_PRINT || $visualizationMode == PAGE_VISUALMODE_HTML_PUBLIC;
     $parameters = $rawDatas ? array_merge($rawDatas, $this->_attributes) : $this->_attributes;
     // If no language parameter : set page language
     $parameters['language'] = isset($parameters['language']) && $parameters['language'] ? $parameters['language'] : $page->getLanguage();
     $parameters = array('block_attributes' => $parameters, 'module' => $this->_attributes['module'], 'language' => $parameters['language'], 'pageID' => $page->getID(), 'public' => $public);
     $polymodParsing = new CMS_polymod_definition_parsing($this->_definition, true, CMS_polymod_definition_parsing::PARSE_MODE, $this->_attributes['module'], $visualizationMode);
     $content = $polymodParsing->getContent($type, $parameters);
     if (!$public) {
         return $content;
     }
     //Cache management
     $cacheHash = md5(serialize(array('definition' => $content, 'parameters' => $parameters)));
     $lifetime = isset($this->_attributes['cache']) ? $this->_attributes['cache'] : 'auto';
     $content = CMS_cache::wrapCode($cacheHash, $content, $lifetime);
     return $content;
 }
Пример #8
0
 /**
  * Get all edited blocks found for a given page
  * Detect all blocks
  * Sends an array of all blocks of given page
  * 
  * @param CMS_page $page the page we want data from
  * @param boolean $public, if only public datas are concerned
  * @return array of CMS_block
  */
 function getAllBlocksForPage(&$page, $public = false)
 {
     $_blocks = array();
     //@var : array ( array(Table prefix, Class name) )
     $_blockTypes = array(array('blocksRawDatas', false), array('blocksImages', 'CMS_block_image'), array('blocksFlashes', 'CMS_block_flash'), array('blocksFiles', 'CMS_block_file'), array('blocksTexts', 'CMS_block_text'), array('blocksVarchars', 'CMS_block_varchar'));
     //Rotate all block types availables
     foreach ($_blockTypes as $b) {
         $table = $public ? $b[0] . '_public' : $b[0] . '_edited';
         $class = $b[1];
         $sql = "\n\t\t\t\tselect\n\t\t\t\t\t*\n\t\t\t\tfrom\n\t\t\t\t\t" . $table . "\n\t\t\t\twhere\n\t\t\t\t\tpage=" . $page->getID() . "\n\t\t\t\t";
         $q = new CMS_query($sql);
         while ($r = $q->getArray()) {
             if (isset($r['type']) && $r['type'] && class_exists($r['type'])) {
                 $_blocks[] = new $r['type']($r['id'], RESOURCE_LOCATION_USERSPACE, $public);
             } elseif ($class && class_exists($class)) {
                 $_blocks[] = new $class($r['id'], RESOURCE_LOCATION_USERSPACE, $public);
             }
         }
     }
     return $_blocks;
 }
Пример #9
0
    }
}
if (!isset($cms_page) || !is_object($cms_page)) {
    CMS_grandFather::raiseError('Error, can\'t get a valid page to work with.');
    $view->show();
}
//check if page is useable (public or edited at least)
if (!$cms_page->isUseable() || $followRedirect) {
    if (!$cms_page->isUseable()) {
        //page is deleted, go to root
        $cms_page = CMS_tree::getRoot();
    }
    //redirect to subpage if any redirection exists
    $redirectlink = $cms_page->getRedirectLink(true);
    while ($redirectlink->hasValidHREF() && sensitiveIO::IsPositiveInteger($redirectlink->getInternalLink())) {
        $cms_page = new CMS_page($redirectlink->getInternalLink());
        $redirectlink = $cms_page->getRedirectLink(true);
    }
    $pageId = $cms_page->getID();
}
pr('View page : ' . $cms_page->getID() . ($reload ? ' (Force reload queried by interface)' : ''));
//set page into user context
CMS_session::setPage($cms_page);
//for the page, create all javascript informations needed
$hasPreviz = $hasPublic = $hasDraft = $isEditable = $hasLock = $hasRedirect = false;
//which panels can be seen by user (according to his rights)
//this array represent the order of each panel (left to right)
$userPanels = array('search' => array('type' => 'searchPanel', 'visible' => true), 'tree' => array('type' => 'winPanel', 'visible' => false), 'favorite' => array('type' => 'favoritePanel', 'visible' => $cms_user->hasModuleClearance(MOD_STANDARD_CODENAME, CLEARANCE_MODULE_VIEW)), 'action' => array('type' => 'menuPanel', 'visible' => false), 'add' => array('type' => 'winPanel', 'visible' => false), 'properties' => array('type' => 'winPanel', 'visible' => false), 'edit' => array('type' => 'framePanel', 'visible' => false), 'edited' => array('type' => 'framePanel', 'visible' => false), 'public' => array('type' => 'framePanel', 'visible' => true), 'nopages' => array('type' => 'framePanel', 'visible' => false), 'norights' => array('type' => 'framePanel', 'visible' => false));
//check for public page
if ($cms_user->hasPageClearance($cms_page->getID(), CLEARANCE_PAGE_VIEW)) {
    if ($cms_page->getPublication() == RESOURCE_PUBLICATION_PUBLIC) {
Пример #10
0
 /**
  * Set Page
  *
  * @param CMS_page $page
  * @return void
  * @access public
  */
 public static function setPage(&$page)
 {
     if ($page instanceof CMS_page) {
         $sessionNS = new Zend_Session_Namespace('atm-page');
         $sessionNS->pageId = $page->getID();
     } else {
         $this->raiseError("Incorrect Page type");
     }
 }
Пример #11
0
        $lockuser = CMS_profile_usersCatalog::getByID($cms_page->getLock());
        $view->setActionMessage($cms_language->getMessage(MESSAGE_PAGE_ERROR_LOCKED, array($lockuser->getFullName())));
        $view->show();
    }
}
$initialStatus = $cms_page->getStatus()->getHTML(false, $cms_user, MOD_STANDARD_CODENAME, $cms_page->getID());
//page edited status
$edited = $logAction = false;
switch ($action) {
    case 'creation':
        $father = sensitiveIO::request('father', 'sensitiveIO::isPositiveInteger', false);
        $template = sensitiveIO::request('template', 'sensitiveIO::isPositiveInteger', false);
        $title = sensitiveIO::request('title');
        $linktitle = sensitiveIO::request('linktitle');
        $emptytpl = sensitiveIO::request('emptytpl') == 1 ? true : false;
        $cms_page = new CMS_page();
        $cms_father = CMS_tree::getPageByID($father);
        if (!$cms_father || $cms_father->hasError()) {
            CMS_grandFather::raiseError('Page creation : Father page (' . $father . ') has error ...');
            $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ERROR_CREATION);
            break;
        }
        if (!$cms_user->hasPageClearance($father, CLEARANCE_PAGE_EDIT)) {
            $cms_message = $cms_language->getMessage(MESSAGE_PAGE_ERROR_FATHER_PAGE);
            break;
        }
        //must set the lastReminder to today
        $cms_page->touchLastReminder();
        $cms_page->setTitle($title, $cms_user);
        if ($linktitle) {
            $cms_page->setLinkTitle($linktitle, $cms_user);
Пример #12
0
$pageTplId = CMS_pageTemplatesCatalog::getTemplateIDForCloneID($pageTemplate->getID());
$pageTplLabel = $pageTemplate->getLabel();
//print
$print = $cms_page->getPrintStatus() ? $cms_language->getMessage(MESSAGE_PAGE_FIELD_YES) : $cms_language->getMessage(MESSAGE_PAGE_FIELD_NO);
//page relations
$linksFrom = CMS_linxesCatalog::searchRelations(CMS_linxesCatalog::PAGE_LINK_FROM, $cms_page->getID());
$linksTo = CMS_linxesCatalog::searchRelations(CMS_linxesCatalog::PAGE_LINK_TO, $cms_page->getID());
//page redirection
$redirectlink = $cms_page->getRedirectLink();
$redirectValue = '';
$module = MOD_STANDARD_CODENAME;
$visualmode = RESOURCE_DATA_LOCATION_EDITED;
if ($redirectlink->hasValidHREF()) {
    $redirect = $cms_language->getMessage(MESSAGE_PAGE_FIELD_YES) . ' ' . $cms_language->getMessage(MESSAGE_PAGE_FIELD_TO) . ' : ';
    if ($redirectlink->getLinkType() == RESOURCE_LINK_TYPE_INTERNAL) {
        $redirectPage = new CMS_page($redirectlink->getInternalLink());
        if (!$redirectPage->hasError()) {
            $label = $cms_language->getMessage(MESSAGE_PAGE_FIELD_PAGE) . ' "' . $redirectPage->getTitle() . '" (' . $redirectPage->getID() . ')';
        }
    } else {
        $label = $redirectlink->getExternalLink();
    }
    $redirectlink->setTarget('_blank');
    $redirect .= $redirectlink->getHTML($label, MOD_STANDARD_CODENAME, RESOURCE_DATA_LOCATION_EDITED, 'class="admin"', false);
    $redirectValue = sensitiveIO::sanitizeJSString($redirectlink->getTextDefinition());
} else {
    $redirect = $cms_language->getMessage(MESSAGE_PAGE_FIELD_NO);
}
//page URL
if ($cms_page->getURL()) {
    $pageUrl = '<a href="' . $cms_page->getURL() . '" target="_blank">' . $cms_page->getURL() . '</a>' . ($cms_page->getRefreshURL() ? ' (<em>' . $cms_language->getMessage(MESSAGE_PAGE_UPDATE_NEXT_VALIDATION) . '</em>)' : '');
Пример #13
0
             if (is_a($date, "CMS_date")) {
                 $date->setFormat($cms_language->getDateFormat());
                 $property = '(' . $date->getLocalizedDate() . ')';
             }
             break;
         case "template":
             $tmp = $sibling->getTemplate();
             $property = '(' . (is_a($tmp, "CMS_pageTemplate") ? $tmp->getLabel() : '???') . ')';
             break;
     }
 } else {
     $property = '(' . $sibling->getID() . ')';
     $redirectlink = $sibling->getRedirectLink(true);
     if ($redirectlink->hasValidHREF()) {
         if ($redirectlink->getLinkType() == RESOURCE_LINK_TYPE_INTERNAL) {
             $redirectPage = new CMS_page($redirectlink->getInternalLink());
             if (!$redirectPage->hasError()) {
                 $property .= '<small class="atm-help" ext:qtip="' . $cms_language->getMessage(MESSAGE_PAGE_REDIRECT, array('\'' . $redirectPage->getTitle(true) . '\' (' . $redirectPage->getID() . ')')) . '"> &rArr; ' . $redirectPage->getID() . '</small>';
             }
         } else {
             $label = $redirectlink->getExternalLink();
             $property .= '<small class="atm-help" ext:qtip="' . $cms_language->getMessage(MESSAGE_PAGE_REDIRECT, array(io::ellipsis($label, '80'))) . '"> &rArr; ' . io::ellipsis($label, '50') . '</small>';
         }
     }
 }
 $pageTitle = PAGE_LINK_NAME_IN_TREE ? $sibling->getLinkTitle() : $sibling->getTitle();
 $hasSiblings = CMS_tree::hasSiblings($sibling) ? true : false;
 $ddtext = '';
 $draggable = $allowDrop = false;
 $editableSibling = $cms_user->hasPageClearance($sibling->getId(), CLEARANCE_PAGE_EDIT);
 if ($enableDD) {
Пример #14
0
}
//search page id by domain address
$website = CMS_websitesCatalog::getWebsiteFromDomain($httpHost, '', $isAlt);
//redirect to website main domain if current domain is an altdomain and need redirection
if ($website && $isAlt && $website->redirectAltDomain()) {
    CMS_view::redirect($website->getURL(), true, 301);
}
if (!$website) {
    $website = CMS_websitesCatalog::getMainWebsite();
}
$rootPage = $website->getRoot();
if ($rootPage->getPublication() == RESOURCE_PUBLICATION_PUBLIC) {
    //redirect to subpage if any
    $redirectlink = $rootPage->getRedirectLink(true);
    while ($redirectlink && $redirectlink->hasValidHREF() && sensitiveIO::IsPositiveInteger($redirectlink->getInternalLink())) {
        $rootPage = new CMS_page($redirectlink->getInternalLink());
        if ($rootPage->getPublication() == RESOURCE_PUBLICATION_PUBLIC) {
            $redirectlink = $rootPage->getRedirectLink(true);
        } else {
            $redirectlink = '';
        }
    }
}
$pPath = $rootPage->getHTMLURL(false, false, PATH_RELATIVETO_FILESYSTEM);
if ($pPath) {
    if (file_exists($pPath)) {
        $cms_page_included = true;
        require $pPath;
        exit;
    } elseif ($rootPage->regenerate(true)) {
        clearstatcache();