public function initContent($full_url, $sectionName, $tagName) { $this->requestURI = $this->apacheRewriteUsed ? $full_url : false; // seciton ... $this->sections = BertaContent::getSections(); if (!$sectionName || empty($this->sections[$sectionName])) { if ($this->environment == 'engine') { list($sectionName, ) = each($this->sections); } else { foreach ($this->sections as $sName => $s) { if (!empty($s['@attributes']['published'])) { $sectionName = $sName; break; } } } } $this->sectionName = $sectionName; // content ... $this->content = BertaContent::loadBlog($sectionName); $this->allContent = array($this->sectionName => $this->content); //var_dump($this->sectionName, $this->sections[$this->sectionName]['get_all_entries_by_section']); if (!empty($this->sections[$this->sectionName]['get_all_entries_by_section']) && $this->sections[$this->sectionName]['get_all_entries_by_section']['value'] == 'yes') { foreach ($this->sections as $sName => $s) { if ($this->sectionName != $sName) { $this->allContent[$sName] = BertaContent::loadBlog($sName); } } } //BertaEditor::populateSubSections($this->sectionName, $this->content); // subsections ... $this->tags = BertaContent::getTags(); $this->tagName = $tagName; if (!isset($this->tags[$this->sectionName][$this->tagName])) { $this->tagName = false; } // in the engine mode one can view all entries for a section, even if the section has subsections // but in the front-ends mode, if there are subsections, the first of them is automatically selected. if ($this->environment != 'engine' && !empty($this->tags[$this->sectionName]) && empty($this->tagName) && empty($this->sections[$this->sectionName]['@attributes']['has_direct_content']) && $this->settings->get('navigation', 'alwaysSelectTag') == 'yes') { $this->tagName = reset(array_keys($this->tags[$this->sectionName])); } // tags .... /*$this->tags = BertaContent::getTags($sectionName); //asort($this->tags); $this->tagName = $tagName; if(!isset($this->tags[$this->tagName])) $this->tagName = false;*/ // template ... $this->template->addContent($this->requestURI, $this->sectionName, $this->sections, $this->tagName, $this->tags, $this->content, $this->allContent); }
<?php define('AUTH_AUTHREQUIRED', true); define('BERTA_ENVIRONMENT', 'engine'); include 'inc.page.php'; $loggedIn = $berta->security->userLoggedIn; include_once $ENGINE_ROOT . '_classes/class.bertaeditor.php'; $allSections = BertaContent::getSections(); $topPanelHTML = BertaEditor::getTopPanelHTML('sections'); $int_version = BertaEditor::$options['int_version']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title><?php echo $berta->settings->get('texts', 'pageTitle'); ?> / <?php echo I18n::_('Sections'); ?> </title> <link rel="SHORTCUT ICON" href="favicon.ico"/> <link rel="stylesheet" href="<?php echo $ENGINE_ABS_ROOT; ?> css/backend.min.css?<?php echo $int_version; ?> " type="text/css" charset="utf-8" /> <link rel="stylesheet" href="<?php