function showEntry()
 {
     global $_ARRAYLANG, $_CORELANG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     //get ids
     $intCategoryId = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
     $intLevelId = isset($_GET['lid']) ? intval($_GET['lid']) : 0;
     $intEntryId = isset($_GET['eid']) ? intval($_GET['eid']) : 0;
     // load source code if cmd value is integer
     if ($this->_objTpl->placeholderExists('APPLICATION_DATA')) {
         $page = new \Cx\Core\ContentManager\Model\Entity\Page();
         $page->setVirtual(true);
         $page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION);
         $page->setModule('MediaDir');
         $page->setCmd('detail');
         // load source code
         $applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page);
         \LinkGenerator::parseTemplate($applicationTemplate);
         $this->_objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate);
     }
     //get navtree
     if ($this->_objTpl->blockExists($this->moduleNameLC . 'Navtree') && ($intCategoryId != 0 || $intLevelId != 0)) {
         $this->getNavtree($intCategoryId, $intLevelId);
     }
     if ($intEntryId != 0 && $this->_objTpl->blockExists($this->moduleNameLC . 'EntryList')) {
         $objEntry = new MediaDirectoryEntry($this->moduleName);
         $objEntry->getEntries($intEntryId, $intLevelId, $intCategoryId, null, null, null, 1, null, 1);
         $objEntry->listEntries($this->_objTpl, 2);
         $objEntry->updateHits($intEntryId);
         //set meta title
         $this->metaTitle .= " - " . $objEntry->arrEntries[$intEntryId]['entryFields'][0];
         $this->pageTitle = $objEntry->arrEntries[$intEntryId]['entryFields'][0];
         if (empty($objEntry->arrEntries)) {
             $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryList');
             $this->_objTpl->clearVariables();
             header("Location: index.php?section=" . $this->moduleName);
             exit;
         }
     } else {
         header("Location: index.php?section=" . $this->moduleName);
         exit;
     }
 }
 function showEntry()
 {
     global $_ARRAYLANG, $_CORELANG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     //get ids
     $intCategoryId = isset($_GET['cid']) ? intval($_GET['cid']) : 0;
     $intLevelId = isset($_GET['lid']) ? intval($_GET['lid']) : 0;
     $intEntryId = isset($_GET['eid']) ? intval($_GET['eid']) : 0;
     // load source code if cmd value is integer
     if ($this->_objTpl->placeholderExists('APPLICATION_DATA')) {
         $page = new \Cx\Core\ContentManager\Model\Entity\Page();
         $page->setVirtual(true);
         $page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION);
         $page->setModule('MediaDir');
         $page->setCmd('detail');
         // load source code
         $applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page);
         \LinkGenerator::parseTemplate($applicationTemplate);
         $this->_objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate);
     }
     //get navtree
     if ($this->_objTpl->blockExists($this->moduleNameLC . 'Navtree') && ($intCategoryId != 0 || $intLevelId != 0)) {
         $this->getNavtree($intCategoryId, $intLevelId);
     }
     if ($intEntryId != 0 && $this->_objTpl->blockExists($this->moduleNameLC . 'EntryList')) {
         $objEntry = new MediaDirectoryEntry($this->moduleName);
         $objEntry->getEntries($intEntryId, $intLevelId, $intCategoryId, null, null, null, 1, null, 1);
         $objEntry->listEntries($this->_objTpl, 2);
         $objEntry->updateHits($intEntryId);
         //set meta attributes
         $entries = new MediaDirectoryEntry($this->moduleName);
         $entries->getEntries($intEntryId, $intLevelId, $intCategoryId, null, null, null, 1, null, 1);
         $entry = $entries->arrEntries[$intEntryId];
         $objInputfields = new MediaDirectoryInputfield($entry['entryFormId'], false, $entry['entryTranslationStatus'], $this->moduleName);
         $inputFields = $objInputfields->getInputfields();
         $titleChanged = false;
         $contentChanged = false;
         foreach ($inputFields as $arrInputfield) {
             $contextType = isset($arrInputfield['context_type']) ? $arrInputfield['context_type'] : '';
             if (!in_array($contextType, array('title', 'content', 'image'))) {
                 continue;
             }
             $strType = isset($arrInputfield['type_name']) ? $arrInputfield['type_name'] : '';
             $strInputfieldClass = "\\Cx\\Modules\\MediaDir\\Model\\Entity\\MediaDirectoryInputfield" . ucfirst($strType);
             try {
                 $objInputfield = safeNew($strInputfieldClass, $this->moduleName);
                 $arrTranslationStatus = contrexx_input2int($arrInputfield['type_multi_lang']) == 1 ? $entry['entryTranslationStatus'] : null;
                 $arrInputfieldContent = $objInputfield->getContent($entry['entryId'], $arrInputfield, $arrTranslationStatus);
                 switch ($contextType) {
                     case 'title':
                         $inputfieldValue = $arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'];
                         if ($inputfieldValue) {
                             $this->metaTitle .= ' - ' . $inputfieldValue;
                             $this->pageTitle = $inputfieldValue;
                         }
                         $titleChanged = true;
                         break;
                     case 'content':
                         $inputfieldValue = $arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'];
                         if ($inputfieldValue) {
                             $this->metaDescription = $inputfieldValue;
                         }
                         $contentChanged = true;
                         break;
                     case 'image':
                         $inputfieldValue = $arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE_SRC'];
                         if ($inputfieldValue) {
                             $this->metaImage = $inputfieldValue;
                         }
                         break;
                     default:
                         break;
                 }
             } catch (\Exception $e) {
                 \DBG::log($e->getMessage());
                 continue;
             }
         }
         $firstInputfieldValue = $entries->arrEntries[$intEntryId]['entryFields'][0];
         if (!$titleChanged && $firstInputfieldValue) {
             $this->pageTitle = $firstInputfieldValue;
             $this->metaTitle = $firstInputfieldValue;
         }
         if (!$contentChanged && $firstInputfieldValue) {
             $this->metaDescription = $firstInputfieldValue;
         }
         if (empty($objEntry->arrEntries)) {
             $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryList');
             $this->_objTpl->clearVariables();
             header("Location: index.php?section=" . $this->moduleName);
             exit;
         }
     } else {
         header("Location: index.php?section=" . $this->moduleName);
         exit;
     }
 }