?> <div class="one-third column"> <div class="indent-top4 indent-left1"> <h1><?php echo $title; ?> </h1> </div> </div> <div class="two-thirds column"> <nav> <ul class="menu-page"> <?php foreach ($pages as $p) { $current = false; if (Document::getStatus($p->getId()) != UtilsHelper::STATUS_ACTIVE) { continue; } //if (Document::hasTag($p, 'website_page_index')) continue; $page = Document::getDocumentByCulture($p, null, true); if (!$page) { continue; } if ($sf_params->get('pageref') == $page->getId()) { $current = true; } ?> <li> <a <?php if ($current) { ?>
echo $sf_params->get('m'); ?> &id=<?php echo $id; ?> " title="Edit" class="edit"></a> <?php } else { ?> <a href="javascript:void(0);" onclick="return noEdit();" title="Edit" class="edit"></a> <?php } ?> </div> <div class="col-f"><a href="javascript:void(0);" title="Status" class="status <?php if (Document::getStatus($item) != UtilsHelper::STATUS_ACTIVE) { echo 'offline'; } ?> "></a></div> <div class="clear"></div> </div> </li> <?php } } ?> </ul> <div id="delete-all" title="Delete All Items"> <p>
public static function getSiteMap($root = null, &$sitemap, $depth = 1000, $level = 1, $path = null, $getIndex = false, $getInvisible = false) { if ($level > $depth) { return array(); } $nolabel = UtilsHelper::Localize("website.frontend.nolabel"); if (!$root) { $root = Rootfolder::getRootfolderByModule("website"); if (!$root) { return; } } if (is_object($root)) { $root = $root->getId(); } $pathSet = false; if (Document::hasChildren($root)) { // $oldRelationsFlag = sfConfig::get('sf_cache_relations'); // sfConfig::set('sf_cache_relations', false); try { $children = Document::getChildrenOf($root, null, true, false); foreach ($children as $child) { // skip Urlrewrite objects if (get_class($child) == "Urlrewrite" || get_class($child) == "Media") { continue; } $href = ""; $label = $nolabel; $childId = $child->getId(); $class = get_class($child); $showItem = true; if (Document::getStatus($child) != UtilsHelper::STATUS_ACTIVE) { continue; } if (!$getIndex && Document::hasTag($child, "website_page_index")) { continue; } if (!$getInvisible) { if ($class == 'Page' && Document::hasTag($child, "website_page_nonvisible") || $class == 'Topic' && Document::hasTag($child, "website_topic_nonvisible")) { $id = $childId; $showItem = false; //continue; } } if ($showItem) { if ($class == "Page") { $type = $child->getPageType(); $secure = $child->getIsSecure(); //$label = $child->getLabel(); $label = $child->getNavigationTitle(); $href = $child->getHref(); $id = $childId; } elseif ($class == "Topic") { $label .= $child->getLabel(); // " (".$child->getLabel().")"; $indexPage = $child->getIndexPage(); $id = 0; if ($indexPage) { //$id = $indexPage->getId(); $id = $childId; $href = $indexPage->getHref(); $label = $indexPage->getLabel(); $type = $indexPage->getPageType(); // if ($type == "REFERENCE") // { // //echo "--- Topic: ".$id." ---\n"; // $pg = Document::getDocumentByCulture($indexPage->getPageId(), null, true); // get PageI18n object // if($pg) // { // $id = $pg->getId(); // $href = $pg->getHref(); // $secure = $pg->getIsSecure(); // } // } } } else { $id = $childId; $label = $child->getLabel(); } } if ($id && !$pathSet) { $path[] = $id; $pathSet = true; } else { $c = count($path); $path[$c - 1] = $id; } $sitemap[$root][$childId]['path'] = $path; $sitemap[$root][$childId]['id'] = $id; $sitemap[$root][$childId]['href'] = $href; $sitemap[$root][$childId]['label'] = $label; if (array_key_exists('secure', $sitemap[$root][$childId])) { $sitemap[$root][$childId]['secure'] = $secure; } $sitemap[$root][$childId]['level'] = $level; $sitemap[$root][$childId]['model'] = $class; $sitemap[$root][$childId]['show'] = $showItem; self::getSiteMap($child->getId(), $sitemap, $depth, $level + 1, $path, $getIndex, $getInvisible); } } catch (Exception $e) { return null; } // sfConfig::set('sf_cache_relations', $oldRelationsFlag); } return $sitemap; }
echo '<option value=' . $val . '>' . $name . '</option>'; } } } ?> </select> </td> </tr> <tr> <th><label for="status">Status:</label></th> <td> <select id="status" name="status"> <?php foreach (DocStatus::getAllTypes() as $val => $status) { if ($val != 0) { if ($document->getStatus()->getStatus() == $val) { echo '<option value=' . $val . ' selected>' . $status . '</option>'; } else { echo '<option value=' . $val . '>' . $status . '</option>'; } } } ?> </select> </td> </tr> <tr> <th><label for="prefix">Prefix:</label></th> <td> <select id="prefix" name="prefix"> <?php
<div class="indent-top4 indent-left1"> <h1><?php echo $title; ?> </h1> </div> </div> <div class="one-third column"> <nav> <ul class="menu-page"> <?php //var_dump($pages); foreach ($topics as $t) { $topicId = $t->getId(); $current = false; if (Document::getStatus($topicId) != UtilsHelper::STATUS_ACTIVE) { continue; } // if (Document::hasTag($p, 'website_page_index')) continue; $page = $t->getIndexPage(); // $page = Document::getDocumentByCulture($p, null, true); if (!$page) { continue; } if ($sf_params->get('pageref') == $page->getId()) { $current = true; } if (in_array($sf_params->get('pageref'), $pages[$topicId])) { $current = true; } ?>
public function executeDisplay() { $parameters = $this->getRequest()->getParameterHolder()->getAll(); $culture = $this->getUser()->getCulture(); $user = $this->getUser()->getSubscriber(); if (isset($parameters['rewriteUrl'])) { if (isset($parameters['pageref'])) { $document = Document::getDocumentInstance($parameters['pageref']); } else { if (BackendService::loadUrlRelations()) { if (array_key_exists('urlRelations', $_SESSION) && array_key_exists($parameters['rewriteUrl'], $_SESSION['urlRelations'])) { $documentId = $_SESSION['urlRelations'][$parameters['rewriteUrl']]; $document = Document::getDocumentInstance($documentId); } } else { $c = new Criteria(); $c->add(UrlrewritePeer::LABEL, $parameters['rewriteUrl']); $rewriteUrl = UrlrewritePeer::doSelectOne($c); /*if ($rewriteUrl && array_key_exists('sf_culture', $parameters)) { $document = Document::getDocumentInstance($rewriteUrl->getPageId()); if(substr(get_class($document), -4) == "I18n") { $parent = Document::getParentOf($rewriteUrl->getPageId()); $document = Document::getDocumentInstance($parent->getId()); } } else*/ if ($rewriteUrl) { $document = Document::getDocumentInstance($rewriteUrl->getPageId()); } } } if (!isset($document)) { $elements = explode("_", substr($parameters['rewriteUrl'], 0, -5)); $id = array_pop($elements); $key = $elements[0]; if (Document::getStatus($id) == UtilsHelper::STATUS_ACTIVE) { if ($key == "news") { if ($document = Document::getDocumentByExclusiveTag("website_page_newslist")) { $this->getRequest()->setParameter("month", $id); $this->getRequest()->setParameter("year", $elements[2]); $this->pageTitle = "News - " . $elements[1] . " " . $elements[2]; } } else { $rewritedDoc = Document::getDocumentInstance($id); if ($rewritedDoc) { $documentClass = get_class($rewritedDoc); if ($document = Document::getDocumentByExclusiveTag("website_page_" . $documentClass . "_detail")) { $this->getRequest()->setParameter($documentClass . "_id", $id); /*if(class_exists($documentClass."I18n")) $this->pageTitle = $rewritedDoc->getLabelI18n(); else*/ $this->pageTitle = $rewritedDoc->getLabel(); } } } } } } else { if (array_key_exists('pageref', $parameters) && is_numeric($parameters['pageref'])) { $document = Document::getDocumentInstance($parameters['pageref']); } else { $document = Document::getDocumentByExclusiveTag('website_page_home'); } } if (isset($document)) { //$page = Document::getDocumentByCulture($document, $culture); //if(Document::getStatus($document->getId()) != UtilsHelper::STATUS_ACTIVE) $this->forward404(); $page = $document; if ($page->getPublicationStatus() != UtilsHelper::STATUS_ACTIVE) { $this->forward404(); } } if (isset($page) && get_class($page) == "Page") { //$culture = $pageI18n->getCulture(); //$this->getUser()->setCulture($culture); } else { $page = null; } if ($page && $page->getIsSecure() && !$this->getUser()->isAuthenticated()) { $page = Document::getDocumentByExclusiveTag('website_page_login'); } $this->pageDocument = $page; $this->forward404Unless($page); $this->getRequest()->setParameter('pageref', $page->getId()); $this->getRequest()->setParameter('rewriteUrl', null); switch ($page->getPageType()) { // case "ACTIONPAGE": return $this->redirect($page->getActionName()); case "EXTERNAL": return $this->redirect($page->getUrl()); case "REFERENCE": $this->redirect(Document::getDocumentInstance($page->getPageId())->getHref()); break; } if (is_object($user)) { if ($user->getBackend()) { $this->setLayout('editPageContent'); $this->content = $this->getContent(true); } else { $this->content = $this->getContent(); } $this->setResponseParams($user); } else { $this->content = $this->getContent(); $this->setResponseParams(); } }