Exemplo n.º 1
0
 function modifyEntry()
 {
     global $_ARRAYLANG, $_CORELANG;
     $this->_objTpl->setTemplate($this->pageContent, true, true);
     parent::getSettings();
     $bolFileSizesStatus = true;
     $strOkMessage = '';
     $strErrMessage = '';
     $strOnSubmit = '';
     //count forms
     $objForms = new MediaDirectoryForm(null, $this->moduleName);
     $arrActiveForms = array();
     foreach ($objForms->arrForms as $intFormId => $arrForm) {
         if ($arrForm['formActive'] == 1) {
             $arrActiveForms[] = $intFormId;
         }
     }
     //check id and form
     if (!empty($_REQUEST['eid']) || !empty($_REQUEST['entryId'])) {
         if (!empty($_REQUEST['eid'])) {
             $intEntryId = intval($_REQUEST['eid']);
         }
         if (!empty($_REQUEST['entryId'])) {
             $intEntryId = intval($_REQUEST['entryId']);
         }
         $intFormId = intval(substr($_GET['cmd'], 4));
     } else {
         $intEntryId = null;
         $intFormId = intval(substr($_GET['cmd'], 3));
     }
     $intCountForms = count($arrActiveForms);
     if ($intCountForms > 0) {
         //check form
         if (intval($intEntryId) == 0 && empty($_REQUEST['selectedFormId']) && empty($_POST['formId']) && $intCountForms > 1 && $intFormId == 0) {
             $intFormId = null;
             //get form selector
             $objForms = new MediaDirectoryForm(null, $this->moduleName);
             $objForms->listForms($this->_objTpl, 3, $intFormId);
             //parse blocks
             $this->_objTpl->hideBlock($this->moduleNameLC . 'Inputfields');
         } else {
             //save entry data
             if (isset($_POST['submitEntryModfyForm'])) {
                 $objEntry = new MediaDirectoryEntry($this->moduleName);
                 $strStatus = $objEntry->saveEntry($_POST, intval($_POST['entryId']));
                 if (!empty($_POST['entryId'])) {
                     $objEntry->getEntries(intval($_POST['entryId']));
                     if ($strStatus == true) {
                         if (intval($_POST['readyToConfirm']) == 1) {
                             if ($objEntry->arrEntries[intval($_POST['entryId'])]['entryConfirmed'] == 1) {
                                 $bolReadyToConfirmMessage = false;
                                 $bolSaveOnlyMessage = false;
                             } else {
                                 $bolReadyToConfirmMessage = true;
                                 $bolSaveOnlyMessage = false;
                             }
                         } else {
                             $bolReadyToConfirmMessage = false;
                             $bolSaveOnlyMessage = true;
                         }
                         $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_EDITED'];
                     } else {
                         $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_EDITED'];
                     }
                 } else {
                     if ($strStatus == true) {
                         if (intval($_POST['readyToConfirm']) == 1) {
                             $bolReadyToConfirmMessage = true;
                             $bolSaveOnlyMessage = false;
                         } else {
                             $bolReadyToConfirmMessage = false;
                             $bolSaveOnlyMessage = true;
                         }
                         $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_ADDED'];
                     } else {
                         $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_ADDED'];
                     }
                 }
                 if (!empty($_POST['entryId'])) {
                     if ($strStatus == true) {
                         $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_EDITED'];
                     } else {
                         $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_EDITED'];
                     }
                 } else {
                     if ($strStatus == true) {
                         $strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_ADDED'];
                     } else {
                         $strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_ADDED'];
                     }
                 }
             } else {
                 //get form id
                 if (intval($intEntryId) != 0) {
                     //get entry data
                     $objEntry = new MediaDirectoryEntry($this->moduleName);
                     if ($this->arrSettings['settingsReadyToConfirm'] == 1) {
                         $objEntry->getEntries($intEntryId, null, null, null, null, null, true, null, 'n', null, null, null, true);
                     } else {
                         $objEntry->getEntries($intEntryId);
                     }
                     $intFormId = $objEntry->arrEntries[$intEntryId]['entryFormId'];
                 } else {
                     //set form id
                     if ($intCountForms == 1) {
                         $intFormId = intval($arrActiveForms[0]);
                     } else {
                         if ($intFormId == 0) {
                             $intFormId = intval($_REQUEST['selectedFormId']);
                         }
                     }
                 }
                 //get inputfield object
                 $objInputfields = new MediaDirectoryInputfield($intFormId, false, null, $this->moduleName);
                 //list inputfields
                 $objInputfields->listInputfields($this->_objTpl, 2, $intEntryId);
                 //get translation status date
                 if ($this->arrSettings['settingsTranslationStatus'] == 1) {
                     foreach ($this->arrFrontendLanguages as $key => $arrLang) {
                         if ($arrLang['id'] == 2) {
                             $strLangStatus = 'checked="checked" disabled="disabled"';
                         } elseif ($intEntryId != 0) {
                             if (in_array($arrLang['id'], $objEntry->arrEntries[$intEntryId]['entryTranslationStatus'])) {
                                 $strLangStatus = 'checked="checked"';
                             } else {
                                 $strLangStatus = '';
                             }
                         } else {
                             $strLangStatus = '';
                         }
                         $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_TRANSLATION_LANG_NAME' => htmlspecialchars($arrLang['name'], ENT_QUOTES, CONTREXX_CHARSET), $this->moduleLangVar . '_TRANSLATION_LANG_ID' => intval($arrLang['id']), $this->moduleLangVar . '_TRANSLATION_LANG_STATUS' => $strLangStatus));
                         $this->_objTpl->parse($this->moduleNameLC . 'TranslationLangList');
                     }
                 } else {
                     $this->_objTpl->hideBlock($this->moduleNameLC . 'TranslationStatus');
                 }
                 //get ready to confirm
                 if ($this->arrSettings['settingsReadyToConfirm'] == 1 && empty($objEntry->arrEntries[$intEntryId]['entryReadyToConfirm']) && empty($objEntry->arrEntries[$intEntryId]['entryConfirmed'])) {
                     $objForm = new MediaDirectoryForm($intFormId, $this->moduleName);
                     if ($objForm->arrForms[$intFormId]['formUseReadyToConfirm'] == 1) {
                         $strReadyToConfirm = '<p><input class="' . $this->moduleNameLC . 'InputfieldCheckbox" name="readyToConfirm" id="' . $this->moduleNameLC . 'Inputfield_ReadyToConfirm" value="1" type="checkbox">&nbsp;' . $_ARRAYLANG['TXT_MEDIADIR_READY_TO_CONFIRM'] . '</p>';
                     } else {
                         $strReadyToConfirm = '<input type="hidden" name="readyToConfirm" value="1" />';
                     }
                 } else {
                     $strReadyToConfirm = '<input type="hidden" name="readyToConfirm" value="1" />';
                 }
                 $this->_objTpl->setVariable(array($this->moduleLangVar . '_READY_TO_CONFIRM' => $strReadyToConfirm));
                 //generate javascript
                 parent::setJavascript($this->getSelectorJavascript());
                 parent::setJavascript($objInputfields->getInputfieldJavascript());
                 //parent::setJavascript("\$J().ready(function(){ \$J('.mediadirInputfieldHint').inputHintBox({className:'mediadirInputfieldInfobox',incrementLeft:3,incrementTop:-6}); });");
                 //get form onsubmit
                 $strOnSubmit = parent::getFormOnSubmit($objInputfields->arrJavascriptFormOnSubmit);
                 //parse blocks
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'Forms');
             }
         }
         if (!empty($_SESSION[$this->moduleNameLC]) && empty($_SESSION[$this->moduleNameLC]['bolFileSizesStatus'])) {
             $strFileMessage = '<div class="' . $this->moduleNameLC . 'FileErrorMessage">' . $_ARRAYLANG['TXT_MEDIADIR_IMAGE_ERROR_MESSAGE'] . '</div>';
             unset($_SESSION[$this->moduleNameLC]['bolFileSizesStatus']);
         } else {
             $strFileMessage = '';
         }
         //parse global variables
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_ENTRY_ID' => $intEntryId, $this->moduleLangVar . '_FORM_ID' => $intFormId, 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'], $this->moduleLangVar . '_FORM_ONSUBMIT' => $strOnSubmit, 'TXT_' . $this->moduleLangVar . '_PLEASE_CHECK_INPUT' => $_ARRAYLANG['TXT_MEDIADIR_PLEASE_CHECK_INPUT'], 'TXT_' . $this->moduleLangVar . '_OK_MESSAGE' => $strOkMessage . $strFileMessage, 'TXT_' . $this->moduleLangVar . '_ERROR_MESSAGE' => $strErrMessage . $strFileMessage, $this->moduleLangVar . '_MAX_CATEGORY_SELECT' => $strErrMessage, 'TXT_' . $this->moduleLangVar . '_TRANSLATION_STATUS' => $_ARRAYLANG['TXT_MEDIADIR_TRANSLATION_STATUS']));
         if (!empty($strOkMessage)) {
             $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryOkMessage');
             $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryErrMessage');
             $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryModifyForm');
             if ($bolReadyToConfirmMessage) {
                 $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryReadyToConfirmMessage');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage');
             }
             if ($bolSaveOnlyMessage) {
                 $this->_objTpl->touchBlock($this->moduleNameLC . 'EntrySaveOnlyMessage');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage');
             }
         } else {
             if (!empty($strErrMessage)) {
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage');
                 $this->_objTpl->touchBlock($this->moduleNameLC . 'EntryErrMessage');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryModifyForm');
             } else {
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryOkMessage');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryErrMessage');
                 $this->_objTpl->parse($this->moduleNameLC . 'EntryModifyForm');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryReadyToConfirmMessage');
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'EntrySaveOnlyMessage');
             }
         }
     } else {
         header("Location: index.php?section=" . $_GET['section']);
         exit;
     }
 }
 function modifyEntry()
 {
     global $_ARRAYLANG, $_CORELANG, $objDatabase, $_LANGID;
     \JS::activate('cx');
     \JS::activate('jqueryui');
     $this->_objTpl->loadTemplateFile('module_' . $this->moduleNameLC . '_modify_entry.html', true, true);
     $this->pageTitle = $_ARRAYLANG['TXT_MEDIADIR_ENTRIES'];
     //get seting values
     parent::getSettings();
     $intEntryDourationAlways = '';
     $intEntryDourationPeriod = '';
     $intEntryDourationShowPeriod = 'none';
     $intEntryDourationEnd = 0;
     $intEntryDourationStart = 0;
     $strOnSubmit = '';
     if (!empty($_GET['id'])) {
         \Permission::checkAccess(MediaDirectoryAccessIDs::ModifyEntry, 'static');
         $pageTitle = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_EDIT'];
         $intEntryId = intval($_GET['id']);
     } else {
         \Permission::checkAccess(MediaDirectoryAccessIDs::AddEntry, 'static');
         $pageTitle = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . " " . $_ARRAYLANG['TXT_MEDIADIR_ADD'];
         $intEntryId = null;
     }
     //count forms
     $objForms = new MediaDirectoryForm(null, $this->moduleName);
     $arrActiveForms = array();
     foreach ($objForms->arrForms as $intFormId => $arrForm) {
         if ($arrForm['formActive'] == 1) {
             $arrActiveForms[] = $intFormId;
         }
     }
     $intCountForms = count($arrActiveForms);
     if ($intCountForms > 0) {
         if (intval($intEntryId) == 0 && (empty($_POST['selectedFormId']) && empty($_POST['formId'])) && $intCountForms > 1) {
             $intFormId = null;
             //get form selector
             $objForms->listForms($this->_objTpl, 2, $intFormId);
             //parse blocks
             $this->_objTpl->hideBlock($this->moduleNameLC . 'EntryStatus');
             $this->_objTpl->hideBlock($this->moduleNameLC . 'InputfieldList');
             $this->_objTpl->hideBlock($this->moduleNameLC . 'SpezfieldList');
         } else {
             //save entry data
             if (isset($_POST['submitEntryModfyForm']) && !empty($_POST['formId'])) {
                 $objEntry = new MediaDirectoryEntry($this->moduleName);
                 $intEntryId = intval($_POST['entryId']);
                 $intEntryId = $objEntry->saveEntry($_POST, $intEntryId);
                 if (!empty($_POST['entryId'])) {
                     if ($intEntryId) {
                         $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . ' ' . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_EDITED'];
                     } else {
                         $intEntryId = intval($_POST['entryId']);
                         $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . ' ' . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_EDITED'];
                     }
                 } else {
                     if ($intEntryId) {
                         $this->strOkMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . ' ' . $_ARRAYLANG['TXT_MEDIADIR_SUCCESSFULLY_ADDED'];
                     } else {
                         $this->strErrMessage = $_ARRAYLANG['TXT_MEDIADIR_ENTRY'] . ' ' . $_ARRAYLANG['TXT_MEDIADIR_CORRUPT_ADDED'];
                     }
                 }
             }
             //get form id
             if (intval($intEntryId) != 0) {
                 //get entry data
                 $objEntry = new MediaDirectoryEntry($this->moduleName);
                 $objEntry->getEntries($intEntryId, null, null, null, null, false, false);
                 if (empty($objEntry->arrEntries)) {
                     $objEntry->getEntries($intEntryId, null, null, null, null, true, false);
                 }
                 $intFormId = $objEntry->arrEntries[$intEntryId]['entryFormId'];
             } else {
                 //set form id
                 if ($intCountForms == 1) {
                     $intFormId = intval($arrActiveForms[0]);
                 } else {
                     $intFormId = intval($_POST['selectedFormId']);
                 }
                 if (!empty($_POST['formId'])) {
                     $intFormId = intval($_POST['formId']);
                 }
             }
             //get inputfield object
             $objInputfields = new MediaDirectoryInputfield($intFormId, false, null, $this->moduleName);
             //list inputfields
             $objInputfields->listInputfields($this->_objTpl, 2, $intEntryId);
             //get translation status date
             if ($this->arrSettings['settingsTranslationStatus'] == 1) {
                 $ownerRowClass = "row1";
                 foreach ($this->arrFrontendLanguages as $key => $arrLang) {
                     $strLangStatus = '';
                     if ($intEntryId != 0) {
                         if (in_array($arrLang['id'], $objEntry->arrEntries[$intEntryId]['entryTranslationStatus'])) {
                             $strLangStatus = 'checked="checked"';
                         }
                     }
                     $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_TRANSLATION_LANG_NAME' => htmlspecialchars($arrLang['name'], ENT_QUOTES, CONTREXX_CHARSET), $this->moduleLangVar . '_TRANSLATION_LANG_ID' => intval($arrLang['id']), $this->moduleLangVar . '_TRANSLATION_LANG_STATUS' => $strLangStatus));
                     $this->_objTpl->parse($this->moduleNameLC . 'TranslationLangList');
                 }
                 $this->_objTpl->parse($this->moduleNameLC . 'TranslationStatus');
             } else {
                 $ownerRowClass = "row2";
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'TranslationStatus');
             }
             //get user data
             $objFWUser = \FWUser::getFWUserObject();
             $addedBy = isset($objEntry) ? $objEntry->arrEntries[$intEntryId]['entryAddedBy'] : '';
             if (!empty($addedBy) && ($objUser = $objFWUser->objUser->getUser($addedBy))) {
                 $userId = $objUser->getId();
             } else {
                 $userId = $objFWUser->objUser->getId();
             }
             $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_OWNER' => $_ARRAYLANG['TXT_MEDIADIR_OWNER'], $this->moduleLangVar . '_OWNER_ROW' => $ownerRowClass, $this->moduleLangVar . '_OWNER_ID' => $userId));
             \FWUser::getUserLiveSearch();
             if ($intEntryId != 0) {
                 $intEntryDourationStart = 1;
                 $intEntryDourationEnd = 2;
                 //parse contact data
                 $objUser = $objFWUser->objUser;
                 $intUserId = intval($objUser->getId());
                 $strUserMail = '<a href="mailto:' . contrexx_raw2xhtml($objUser->getEmail()) . '">' . contrexx_raw2xhtml($objUser->getEmail()) . '</a>';
                 $intUserLang = intval($objUser->getFrontendLanguage());
                 if ($objUser = $objUser->getUser($id = $intUserId)) {
                     //get lang
                     foreach ($this->arrFrontendLanguages as $intKey => $arrLang) {
                         if ($arrLang['id'] == $intUserLang) {
                             $strUserLang = $arrLang['name'];
                         }
                     }
                     //get country
                     $arrCountry = \Cx\Core\Country\Controller\Country::getById(intval($objUser->getProfileAttribute('country')));
                     $strCountry = $arrCountry['name'];
                     //get title
                     $objTitle = $objDatabase->Execute("SELECT `title` FROM " . DBPREFIX . "access_user_title WHERE id = '" . intval($objUser->getProfileAttribute('title')) . "' LIMIT 1");
                     $strTitle = $objTitle->fields['title'];
                     $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_CONTACT_DATA' => "Kontaktangaben", $this->moduleLangVar . '_CONTACT_ATTRIBUT_TITLE' => contrexx_raw2xhtml($strTitle), $this->moduleLangVar . '_CONTACT_ATTRIBUT_FIRSTNAME' => contrexx_raw2xhtml($objUser->getProfileAttribute('firstname')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_LASTNAME' => contrexx_raw2xhtml($objUser->getProfileAttribute('lastname')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_COMPANY' => contrexx_raw2xhtml($objUser->getProfileAttribute('company')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_ADRESS' => contrexx_raw2xhtml($objUser->getProfileAttribute('address')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_CITY' => contrexx_raw2xhtml($objUser->getProfileAttribute('city')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_ZIP' => contrexx_raw2xhtml($objUser->getProfileAttribute('zip')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_COUNTRY' => contrexx_raw2xhtml($strCountry), $this->moduleLangVar . '_CONTACT_ATTRIBUT_PHONE' => contrexx_raw2xhtml($objUser->getProfileAttribute('phone_office')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_FAX' => contrexx_raw2xhtml($objUser->getProfileAttribute('phone_fax')), $this->moduleLangVar . '_CONTACT_ATTRIBUT_WEBSITE' => '<a href="' . contrexx_raw2xhtml($objUser->getProfileAttribute('website')) . '" target="_blank">' . contrexx_raw2xhtml($objUser->getProfileAttribute('website')) . '</a>', $this->moduleLangVar . '_CONTACT_ATTRIBUT_MAIL' => $strUserMail, $this->moduleLangVar . '_CONTACT_ATTRIBUT_LANG' => $strUserLang));
                 }
                 $this->_objTpl->parse($this->moduleNameLC . 'ContactData');
             } else {
                 $intEntryDourationStart = 1;
                 $intEntryDourationEnd = 2;
                 $this->_objTpl->hideBlock($this->moduleNameLC . 'ContactData');
             }
             //get display duration  data
             switch ($this->arrSettings['settingsEntryDisplaydurationValueType']) {
                 case 1:
                     $intDiffDay = $this->arrSettings['settingsEntryDisplaydurationValue'];
                     $intDiffMonth = 0;
                     $intDiffYear = 0;
                     break;
                 case 2:
                     $intDiffDay = 0;
                     $intDiffMonth = $this->arrSettings['settingsEntryDisplaydurationValue'];
                     $intDiffYear = 0;
                     break;
                 case 3:
                     $intDiffDay = 0;
                     $intDiffMonth = 0;
                     $intDiffYear = $this->arrSettings['settingsEntryDisplaydurationValue'];
                     break;
             }
             if ($intEntryId != 0) {
                 if (intval($objEntry->arrEntries[$intEntryId]['entryDurationType']) == 1) {
                     $intEntryDourationAlways = 'selected="selected"';
                     $intEntryDourationStart = date("d.m.Y", mktime());
                     $intEntryDourationEnd = date("d.m.Y", mktime(0, 0, 0, date("m") + $intDiffMonth, date("d") + $intDiffDay, date("Y") + $intDiffYear));
                 } else {
                     $intEntryDourationPeriod = 'selected="selected"';
                     $intEntryDourationShowPeriod = 'inline';
                     $intEntryDourationStart = date("d.m.Y", $objEntry->arrEntries[$intEntryId]['entryDurationStart']);
                     $intEntryDourationEnd = date("d.m.Y", $objEntry->arrEntries[$intEntryId]['entryDurationEnd']);
                 }
                 if (intval($objEntry->arrEntries[$intEntryId]['entryDurationNotification']) == 1) {
                     $this->_objTpl->setVariable(array($this->moduleLangVar . '_DISPLAYDURATION_RESET_NOTIFICATION_STATUS' => '<br /><input type="checkbox" name="durationResetNotification" value="1" />&nbsp;' . $_ARRAYLANG['TXT_MEDIADIR_DISPLAYDURATION_RESET_NOTIFICATION_STATUS']));
                 }
             } else {
                 if (intval($this->arrSettings['settingsEntryDisplaydurationType']) == 1) {
                     $intEntryDourationAlways = 'selected="selected"';
                 } else {
                     $intEntryDourationPeriod = 'selected="selected"';
                     $intEntryDourationShowPeriod = 'inline';
                 }
                 $intEntryDourationStart = date("d.m.Y", mktime());
                 $intEntryDourationEnd = date("d.m.Y", mktime(0, 0, 0, date("m") + $intDiffMonth, date("d") + $intDiffDay, date("Y") + $intDiffYear));
             }
             //parse spez fields
             $this->_objTpl->touchBlock($this->moduleNameLC . 'SpezfieldList');
             //generate javascript
             parent::setJavascript($this->getSelectorJavascript());
             parent::setJavascript($objInputfields->getInputfieldJavascript());
             //get form onsubmit
             $strOnSubmit = parent::getFormOnSubmit($objInputfields->arrJavascriptFormOnSubmit);
             $this->_objTpl->setVariable(array($this->moduleLangVar . '_ENTRY_STATUS' => $intEntryId && intval($objEntry->arrEntries[$intEntryId]['entryActive']) ? 'checked="checked"' : '', $this->moduleLangVar . '_MEDIABROWSER_BUTTON' => $this->getMediaBrowserButton($_ARRAYLANG['TXT_BROWSE'], array('type' => 'button', 'id' => 'mediabrowser_button', 'style' => 'display:none;'))));
             //parse blocks
             $this->_objTpl->hideBlock($this->moduleNameLC . 'FormList');
         }
         //parse global variables
         $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_PAGE_TITLE' => $pageTitle, $this->moduleLangVar . '_ENTRY_ID' => $intEntryId, $this->moduleLangVar . '_FORM_ID' => $intFormId, 'TXT_' . $this->moduleLangVar . '_SUBMIT' => $_ARRAYLANG['TXT_' . $this->moduleLangVar . '_SUBMIT'], $this->moduleLangVar . '_JAVASCRIPT' => $this->getJavascript(), $this->moduleLangVar . '_FORM_ONSUBMIT' => $strOnSubmit, 'TXT_' . $this->moduleLangVar . '_PLEASE_CHECK_INPUT' => $_ARRAYLANG['TXT_MEDIADIR_PLEASE_CHECK_INPUT'], $this->moduleLangVar . '_DEFAULT_LANG_ID' => $_LANGID, 'TXT_' . $this->moduleLangVar . '_SPEZ_FIELDS' => $_ARRAYLANG['TXT_MEDIADIR_SPEZ_FIELDS'], 'TXT_' . $this->moduleLangVar . '_DISPLAYDURATION' => $_ARRAYLANG['TXT_MEDIADIR_DISPLAYDURATION'], 'TXT_' . $this->moduleLangVar . '_DISPLAYDURATION_ALWAYS' => $_ARRAYLANG['TXT_MEDIADIR_DISPLAYDURATION_ALWAYS'], 'TXT_' . $this->moduleLangVar . '_DISPLAYDURATION_PERIOD' => $_ARRAYLANG['TXT_MEDIADIR_DISPLAYDURATION_PERIOD'], 'TXT_' . $this->moduleLangVar . '_DISPLAYDURATION_FROM' => $_CORELANG['TXT_FROM'], 'TXT_' . $this->moduleLangVar . '_DISPLAYDURATION_TO' => $_CORELANG['TXT_TO'], $this->moduleLangVar . '_DISPLAYDURATION_START' => $intEntryDourationStart, $this->moduleLangVar . '_DISPLAYDURATION_END' => $intEntryDourationEnd, $this->moduleLangVar . '_DISPLAYDURATION_SELECT_ALWAYS' => $intEntryDourationAlways, $this->moduleLangVar . '_DISPLAYDURATION_SELECT_PERIOD' => $intEntryDourationPeriod, $this->moduleLangVar . '_DISPLAYDURATION_SHOW_PERIOD' => $intEntryDourationShowPeriod, 'TXT_' . $this->moduleLangVar . '_TRANSLATION_STATUS' => $_ARRAYLANG['TXT_MEDIADIR_TRANSLATION_STATUS'], 'TXT_' . $this->moduleLangVar . '_ENTRY_STATUS' => $_ARRAYLANG['TXT_MEDIADIR_ACTIVE']));
     } else {
         \Cx\Core\Csrf\Controller\Csrf::header("Location: index.php?cmd=" . $this->moduleName . "&act=settings&tpl=forms");
         exit;
     }
 }