/**
  * Searches the content and returns an array that is built as needed by the search module.
  *
  * @param string $searchTerm
  *
  * @return array
  */
 public function searchResultsForSearchModule($searchTerm)
 {
     $em = \Env::get('cx')->getDb()->getEntityManager();
     $pageRepo = $em->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
     // only list results in case the associated page of the module is active
     $page = $pageRepo->findOneBy(array('module' => 'MediaDir', 'lang' => FRONTEND_LANG_ID, 'type' => \Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION));
     //If page is not exists or page is inactive then return empty result
     if (!$page || !$page->isActive()) {
         return array();
     }
     //get the config site values
     \Cx\Core\Setting\Controller\Setting::init('Config', 'site', 'Yaml');
     $coreListProtectedPages = \Cx\Core\Setting\Controller\Setting::getValue('coreListProtectedPages', 'Config');
     $searchVisibleContentOnly = \Cx\Core\Setting\Controller\Setting::getValue('searchVisibleContentOnly', 'Config');
     //get the config otherConfigurations value
     \Cx\Core\Setting\Controller\Setting::init('Config', 'otherConfigurations', 'Yaml');
     $searchDescriptionLength = \Cx\Core\Setting\Controller\Setting::getValue('searchDescriptionLength', 'Config');
     $hasPageAccess = true;
     $isNotVisible = $searchVisibleContentOnly == 'on' && !$page->isVisible();
     if ($coreListProtectedPages == 'off' && $page->isFrontendProtected()) {
         $hasPageAccess = \Permission::checkAccess($page->getFrontendAccessId(), 'dynamic', true);
     }
     //If the page is invisible and frontend access is denied then return empty result
     if ($isNotVisible || !$hasPageAccess) {
         return array();
     }
     //get the media directory entry by the search term
     $entries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry($this->moduleName);
     $entries->getEntries(null, null, null, $searchTerm);
     //if no entries found then return empty result
     if (empty($entries->arrEntries)) {
         return array();
     }
     $results = array();
     $formEntries = array();
     $defaultEntries = null;
     $objForm = new \Cx\Modules\MediaDir\Controller\MediaDirectoryForm(null, $this->moduleName);
     $numOfEntries = intval($entries->arrSettings['settingsPagingNumEntries']);
     foreach ($entries->arrEntries as $entry) {
         $pageUrlResult = null;
         $entryForm = $objForm->arrForms[$entry['entryFormId']];
         //Get the entry's link url
         //check the entry's form detail view exists if not,
         //check the entry's form overview exists if not,
         //check the default overview exists if not, dont show the corresponding entry in entry
         switch (true) {
             case $entries->checkPageCmd('detail' . $entry['entryFormId']):
                 $pageUrlResult = \Cx\Core\Routing\Url::fromModuleAndCmd($entries->moduleName, 'detail' . $entry['entryFormId'], FRONTEND_LANG_ID, array('eid' => $entry['entryId']));
                 break;
             case $pageCmdExists = $entries->checkPageCmd($entryForm['formCmd']):
             case $entries->checkPageCmd(''):
                 if ($pageCmdExists && !isset($formEntries[$entryForm['formCmd']])) {
                     $formEntries[$entryForm['formCmd']] = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry($entries->moduleName);
                     $formEntries[$entryForm['formCmd']]->getEntries(null, null, null, null, null, null, 1, null, 'n', null, null, $entryForm['formId']);
                 }
                 if (!$pageCmdExists && !isset($defaultEntries)) {
                     $defaultEntries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry($entries->moduleName);
                     $defaultEntries->getEntries();
                 }
                 //get entry's form overview / default page paging position
                 $entriesPerPage = $numOfEntries;
                 if ($pageCmdExists) {
                     $entriesPerPage = !empty($entryForm['formEntriesPerPage']) ? $entryForm['formEntriesPerPage'] : $numOfEntries;
                 }
                 $pageCmd = $pageCmdExists ? $entryForm['formCmd'] : '';
                 $entryKeys = $pageCmdExists ? array_keys($formEntries[$entryForm['formCmd']]->arrEntries) : array_keys($defaultEntries->arrEntries);
                 $entryPos = array_search($entry['entryId'], $entryKeys);
                 $position = floor($entryPos / $entriesPerPage);
                 $pageUrlResult = \Cx\Core\Routing\Url::fromModuleAndCmd($entries->moduleName, $pageCmd, FRONTEND_LANG_ID, array('pos' => $position * $entriesPerPage));
                 break;
             default:
                 break;
         }
         //If page url is empty then dont show it in the result
         if (!$pageUrlResult) {
             continue;
         }
         //Get the search results title and content from the form context field 'title' and 'content'
         $title = current($entry['entryFields']);
         $content = '';
         $objInputfields = new MediaDirectoryInputfield($entry['entryFormId'], false, $entry['entryTranslationStatus'], $this->moduleName);
         $inputFields = $objInputfields->getInputfields();
         foreach ($inputFields as $arrInputfield) {
             $contextType = isset($arrInputfield['context_type']) ? $arrInputfield['context_type'] : '';
             if (!in_array($contextType, array('title', 'content'))) {
                 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);
                 if (\Cx\Core\Core\Controller\Cx::instanciate()->getMode() == \Cx\Core\Core\Controller\Cx::MODE_FRONTEND && \Cx\Core\Setting\Controller\Setting::getValue('blockStatus', 'Config')) {
                     $arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'] = preg_replace('/\\[\\[(BLOCK_[A-Z0-9_-]+)\\]\\]/', '{\\1}', $arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE']);
                     \Cx\Modules\Block\Controller\Block::setBlocks($arrInputfieldContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'], \Cx\Core\Core\Controller\Cx::instanciate()->getPage());
                 }
             } catch (\Exception $e) {
                 \DBG::log($e->getMessage());
                 continue;
             }
             $inputFieldValue = $arrInputfieldContent[$this->moduleConstVar . '_INPUTFIELD_VALUE'];
             if (empty($inputFieldValue)) {
                 continue;
             }
             if ($contextType == 'title') {
                 $title = $inputFieldValue;
             } elseif ($contextType == 'content') {
                 $content = \Cx\Core_Modules\Search\Controller\Search::shortenSearchContent($inputFieldValue, $searchDescriptionLength);
             }
         }
         $results[] = array('Score' => 100, 'Title' => html_entity_decode(contrexx_strip_tags($title), ENT_QUOTES, CONTREXX_CHARSET), 'Content' => $content, 'Link' => $pageUrlResult->toString());
     }
     return $results;
 }
Пример #2
0
 /**
  * Return event place url and its source link     
  * 
  * @return array place url and its source link
  */
 function loadPlaceLinkFromMediadir($intMediaDirId = 0, $type = 'place')
 {
     global $_LANGID, $_CONFIG;
     $placeUrl = '';
     $placeUrlSource = '';
     if (!empty($intMediaDirId)) {
         $objMediadirEntry = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry('MediaDir');
         $objMediadirEntry->getEntries(intval($intMediaDirId));
         $pageRepo = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page');
         $pages = $pageRepo->findBy(array('cmd' => contrexx_addslashes('detail' . intval($objMediadirEntry->arrEntries[$intMediaDirId]['entryFormId'])), 'lang' => $_LANGID, 'type' => \Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION, 'module' => 'MediaDir'));
         if (count($pages)) {
             $strDetailCmd = 'detail' . intval($objMediadirEntry->arrEntries[$intMediaDirId]['entryFormId']);
         } else {
             $strDetailCmd = 'detail';
         }
         $pages = \Env::get('em')->getRepository('Cx\\Core\\ContentManager\\Model\\Entity\\Page')->getFromModuleCmdByLang('MediaDir', $strDetailCmd);
         $arrActiveFrontendLanguages = \FWLanguage::getActiveFrontendLanguages();
         if (isset($arrActiveFrontendLanguages[FRONTEND_LANG_ID]) && isset($pages[FRONTEND_LANG_ID])) {
             $langId = FRONTEND_LANG_ID;
         } else {
             if (isset($arrActiveFrontendLanguages[BACKEND_LANG_ID]) && isset($pages[BACKEND_LANG_ID])) {
                 $langId = BACKEND_LANG_ID;
             } else {
                 foreach ($arrActiveFrontendLanguages as $lang) {
                     if (isset($pages[$lang['id']])) {
                         $langId = $lang['id'];
                         break;
                     }
                 }
             }
         }
         $url = $pages[$langId]->getUrl(ASCMS_PROTOCOL . "://" . $_CONFIG['domainUrl'] . ASCMS_PATH_OFFSET, "?eid={$intMediaDirId}");
         $place = ($type = 'place') ? $this->place : $this->org_name;
         $placeUrl = "<a href='" . $url . "' target='_blank' >" . (!empty($place) ? $place : $url) . "</a>";
         $placeUrlSource = $url;
     }
     return array($placeUrl, $placeUrlSource);
 }
 function getContent($intEntryId, $arrInputfield, $arrTranslationStatus)
 {
     global $objDatabase, $_LANGID;
     $intId = intval($arrInputfield['id']);
     $objEntryDefaultLang = $objDatabase->Execute("SELECT `lang_id` FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_entries WHERE id=" . intval($intEntryId) . " LIMIT 1");
     $intEntryDefaultLang = intval($objEntryDefaultLang->fields['lang_id']);
     if ($this->arrSettings['settingsTranslationStatus'] == 1) {
         if (in_array($_LANGID, $arrTranslationStatus)) {
             $intLangId = $_LANGID;
         } else {
             $intLangId = $intEntryDefaultLang;
         }
     } else {
         $intLangId = $_LANGID;
     }
     $objInputfield = $objDatabase->Execute("\n          SELECT\n             `value`\n          FROM\n             " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields\n          WHERE\n             " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields.lang_id = " . $_LANGID . "\n          AND\n             " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields.field_id = '" . $intId . "'");
     $intEntryId = intval($objInputfield->fields['value']);
     $objEntry = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry();
     $objEntry->getEntries($intEntryId);
     $strEntryValue = $objEntry->arrEntries[$intEntryId]['entryFields'][0];
     if (!empty($strEntryValue)) {
         $arrContent['TXT_' . $this->moduleLangVar . '_INPUTFIELD_NAME'] = htmlspecialchars($arrInputfield['name'][0], ENT_QUOTES, CONTREXX_CHARSET);
         $arrContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'] = '<a href="index.php?section=' . $this->moduleName . '&cmd=detail&amp;eid=' . $intEntryId . '">' . $strEntryValue . '</a>';
     } else {
         $arrContent = null;
     }
     return $arrContent;
 }
Пример #4
0
    /**
     * Add / Edit Event
     * 
     * @param integer $eventId Event id
     * 
     * @return null
     */
    function modifyEvent($eventId = null)
    {
        global $_ARRAYLANG, $_CORELANG, $_LANGID;
        \JS::activate('cx');
        \JS::activate('jqueryui');
        \JS::registerJS('modules/Calendar/View/Script/Frontend.js');
        $this->getFrontendLanguages();
        $this->getSettings();
        $this->_objTpl->setTemplate($this->pageContent, true, true);
        $showFrom = true;
        $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent();
        $isEventLoaded = false;
        if (isset($_POST['submitFormModifyEvent'])) {
            $arrData = array();
            $arrData = $_POST;
            $arrData['access'] = 0;
            $arrData['priority'] = 3;
            if ($objEvent->save($arrData)) {
                $showFrom = false;
                $this->_objTpl->hideBlock('calendarEventModifyForm');
                $this->_objTpl->touchBlock('calendarEventOkMessage');
                // refresh event data after save
                $objEvent->get($eventId);
                $objEvent->getData();
                $isEventLoaded = true;
                $objMailManager = new \Cx\Modules\Calendar\Controller\CalendarMailManager();
                $objMailManager->sendMail($objEvent, \Cx\Modules\Calendar\Controller\CalendarMailManager::MAIL_NOTFY_NEW_APP);
            } else {
                $this->_objTpl->touchBlock('calendarEventErrMessage');
            }
        }
        if ($eventId && !$isEventLoaded) {
            $objEvent->get($eventId);
            $objEvent->getData();
        }
        $dateFormat = $this->getDateFormat(1);
        $locationType = $this->arrSettings['placeData'] == 3 ? $eventId != 0 ? $objEvent->locationType : 1 : $this->arrSettings['placeData'];
        $hostType = $this->arrSettings['placeDataHost'] == 3 ? $eventId != 0 ? $objEvent->hostType : 1 : $this->arrSettings['placeDataHost'];
        \ContrexxJavascript::getInstance()->setVariable(array('language_id' => \FWLanguage::getDefaultLangId(), 'active_lang' => implode(',', \FWLanguage::getIdArray())), 'calendar');
        $javascript = <<<EOF
<script language="JavaScript" type="text/javascript">
var defaultLang = cx.variables.get('language_id', 'calendar');
var activeLang = [cx.variables.get('active_lang', 'calendar')];
cx.ready(function() {
    var options = {
        dateFormat: '{$dateFormat}',        
        timeFormat: 'hh:mm',
        showSecond: false,
        onSelect: function(dateText, inst){
            var startDate = cx.jQuery( ".startDate" ).datetimepicker("getDate");
            var endDate   = cx.jQuery( ".endDate" ).datetimepicker("getDate");

            if ( cx.jQuery( this )[0].id == 'startDate' ) {
                var prevStartDate = cx.jQuery( ".startDate" ).data('prevDate');

                if (cx.jQuery(".all_day").is(':checked')) {
                    prevStartDate.setHours(0, 0, 0);
                    startDate.setHours(0, 0, 0);
                    endDate.setHours(0, 0, 0);
                }

                if (prevStartDate.getTime() != startDate.getTime()) {
                    var timeDiff = Math.abs(endDate.getTime() - prevStartDate.getTime());
                    endDate = new Date(startDate.getTime() + timeDiff);
                    cx.jQuery( ".endDate" ).datetimepicker('setDate', endDate);
                }

            } else if (startDate.getTime() > endDate.getTime()) {
                endDate = new Date(startDate.getTime() + (30*60*1000));
                cx.jQuery(".endDate").datetimepicker('setDate', endDate);
            }

            cx.jQuery( ".startDate" ).data('prevDate', cx.jQuery(".startDate").datetimepicker("getDate"));
            cx.jQuery( ".endDate" ).data('prevDate', cx.jQuery(".endDate").datetimepicker("getDate"));
            cx.jQuery( this ).datetimepicker('refresh');
        }
    };
    cx.jQuery('input[name=startDate]')
        .datetimepicker(options)
        .data('prevDate', cx.jQuery(".startDate").datetimepicker("getDate"));
    cx.jQuery('input[name=endDate]')
        .datetimepicker(options)
        .data('prevDate', cx.jQuery(".endDate").datetimepicker("getDate"));
    if ( \$J(".all_day").is(':checked') ) {
        modifyEvent._handleAllDayEvent( \$J(".all_day") );
    }
    showOrHidePlaceFields('{$locationType}', 'place');
    showOrHidePlaceFields('{$hostType}', 'host');
});

</script>
EOF;
        if ($showFrom) {
            try {
                $javascript .= <<<UPLOADER
                {$this->getUploaderCode(self::PICTURE_FIELD_KEY, 'pictureUpload')}
                {$this->getUploaderCode(self::MAP_FIELD_KEY, 'mapUpload')}
                {$this->getUploaderCode(self::ATTACHMENT_FIELD_KEY, 'attachmentUpload', 'uploadFinished', false)}
UPLOADER;
            } catch (Exception $e) {
                \DBG::msg("Error in initializing uploader");
            }
        }
        $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_EVENT_LANG_ID' => $_LANGID, $this->moduleLangVar . '_JAVASCRIPT' => $javascript));
        $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true);
        $objCategoryManager->getCategoryList();
        if ($eventId) {
            $startDate = $objEvent->startDate;
            $endDate = $objEvent->endDate;
        } else {
            $startDate = new \DateTime();
            $endDate = new \DateTime();
        }
        $eventStartDate = $this->format2userDateTime($startDate);
        $eventEndDate = $this->format2userDateTime($endDate);
        $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_EVENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_DETAILS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DETAILS'], 'TXT_' . $this->moduleLangVar . '_SAVE' => $_ARRAYLANG['TXT_CALENDAR_SAVE'], 'TXT_' . $this->moduleLangVar . '_EVENT_START' => $_ARRAYLANG['TXT_CALENDAR_START'], 'TXT_' . $this->moduleLangVar . '_EVENT_END' => $_ARRAYLANG['TXT_CALENDAR_END'], 'TXT_' . $this->moduleLangVar . '_EVENT_TITLE' => $_ARRAYLANG['TXT_CALENDAR_TITLE'], 'TXT_' . $this->moduleLangVar . '_EXPAND' => $_ARRAYLANG['TXT_CALENDAR_EXPAND'], 'TXT_' . $this->moduleLangVar . '_MINIMIZE' => $_ARRAYLANG['TXT_CALENDAR_MINIMIZE'], 'TXT_' . $this->moduleLangVar . '_EVENT_PLACE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PLACE'], 'TXT_' . $this->moduleLangVar . '_EVENT_STREET' => $_ARRAYLANG['TXT_CALENDAR_EVENT_STREET'], 'TXT_' . $this->moduleLangVar . '_EVENT_ZIP' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ZIP'], 'TXT_' . $this->moduleLangVar . '_EVENT_CITY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_CITY'], 'TXT_' . $this->moduleLangVar . '_EVENT_COUNTRY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_COUNTRY'], 'TXT_' . $this->moduleLangVar . '_EVENT_WEBSITE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_WEBSITE'], 'TXT_' . $this->moduleLangVar . '_EVENT_PHONE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PHONE'], 'TXT_' . $this->moduleLangVar . '_EVENT_MAP' => $_ARRAYLANG['TXT_CALENDAR_EVENT_MAP'], 'TXT_' . $this->moduleLangVar . '_EVENT_USE_GOOGLEMAPS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_USE_GOOGLEMAPS'], 'TXT_' . $this->moduleLangVar . '_EVENT_LINK' => $_ARRAYLANG['TXT_CALENDAR_EVENT_LINK'], 'TXT_' . $this->moduleLangVar . '_EVENT_EMAIL' => $_ARRAYLANG['TXT_CALENDAR_EVENT_EMAIL'], 'TXT_' . $this->moduleLangVar . '_EVENT_PICTURE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PICTURE'], 'TXT_' . $this->moduleLangVar . '_EVENT_ATTACHMENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ATTACHMENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CAT'], 'TXT_' . $this->moduleLangVar . '_EVENT_DESCRIPTION' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DESCRIPTION'], 'TXT_' . $this->moduleLangVar . '_PLEASE_CHECK_INPUT' => $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHECK_INPUT'], 'TXT_' . $this->moduleLangVar . '_EVENT_HOST' => $_ARRAYLANG['TXT_CALENDAR_EVENT_HOST'], 'TXT_' . $this->moduleLangVar . '_EVENT_NAME' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NAME'], 'TXT_' . $this->moduleLangVar . '_EVENT_ALL_DAY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ALL_DAY'], 'TXT_' . $this->moduleLangVar . '_LANGUAGE' => $_ARRAYLANG['TXT_CALENDAR_LANG'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE_EVENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_EVENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE_REDIRECT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_REDIRECT'], 'TXT_' . $this->moduleLangVar . '_EVENT_DESCRIPTION' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DESCRIPTION'], 'TXT_' . $this->moduleLangVar . '_EVENT_REDIRECT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_REDIRECT'], 'TXT_' . $this->moduleLangVar . '_PLACE_DATA_DEFAULT' => $_ARRAYLANG['TXT_CALENDAR_PLACE_DATA_DEFAULT'], 'TXT_' . $this->moduleLangVar . '_PLACE_DATA_FROM_MEDIADIR' => $_ARRAYLANG['TXT_CALENDAR_PLACE_DATA_FROM_MEDIADIR'], 'TXT_' . $this->moduleLangVar . '_PREV' => $_ARRAYLANG['TXT_CALENDAR_PREV'], 'TXT_' . $this->moduleLangVar . '_NEXT' => $_ARRAYLANG['TXT_CALENDAR_NEXT'], 'TXT_' . $this->moduleLangVar . '_MORE' => $_ARRAYLANG['TXT_CALENDAR_MORE'], 'TXT_' . $this->moduleLangVar . '_MINIMIZE' => $_ARRAYLANG['TXT_CALENDAR_MINIMIZE'], $this->moduleLangVar . '_EVENT_TYPE_EVENT' => $eventId != 0 ? $objEvent->type == 0 ? 'selected="selected"' : '' : '', $this->moduleLangVar . '_EVENT_TYPE_REDIRECT' => $eventId != 0 ? $objEvent->type == 1 ? 'selected="selected"' : '' : '', $this->moduleLangVar . '_EVENT_START_DATE' => $eventStartDate, $this->moduleLangVar . '_EVENT_END_DATE' => $eventEndDate, $this->moduleLangVar . '_EVENT_PICTURE' => $objEvent->pic, $this->moduleLangVar . '_EVENT_PICTURE_THUMB' => $objEvent->pic != '' ? '<img src="' . $objEvent->pic . '.thumb" alt="' . $objEvent->title . '" title="' . $objEvent->title . '" />' : '', $this->moduleLangVar . '_EVENT_ATTACHMENT' => $objEvent->attach, $this->moduleLangVar . '_EVENT_CATEGORIES' => $objCategoryManager->getCategoryDropdown(intval($objEvent->catId), 2), $this->moduleLangVar . '_EVENT_LINK' => $objEvent->link, $this->moduleLangVar . '_EVENT_PLACE' => $objEvent->place, $this->moduleLangVar . '_EVENT_STREET' => $objEvent->place_street, $this->moduleLangVar . '_EVENT_ZIP' => $objEvent->place_zip, $this->moduleLangVar . '_EVENT_CITY' => $objEvent->place_city, $this->moduleLangVar . '_EVENT_COUNTRY' => $objEvent->place_country, $this->moduleLangVar . '_EVENT_PLACE_WEBSITE' => $objEvent->place_website, $this->moduleLangVar . '_EVENT_PLACE_MAP' => $objEvent->place_map, $this->moduleLangVar . '_EVENT_PLACE_LINK' => $objEvent->place_link, $this->moduleLangVar . '_EVENT_PLACE_PHONE' => $objEvent->place_phone, $this->moduleLangVar . '_EVENT_MAP' => $objEvent->google == 1 ? 'checked="checked"' : '', $this->moduleLangVar . '_EVENT_HOST' => $objEvent->org_name, $this->moduleLangVar . '_EVENT_HOST_ADDRESS' => $objEvent->org_street, $this->moduleLangVar . '_EVENT_HOST_ZIP' => $objEvent->org_zip, $this->moduleLangVar . '_EVENT_HOST_CITY' => $objEvent->org_city, $this->moduleLangVar . '_EVENT_HOST_COUNTRY' => $objEvent->org_country, $this->moduleLangVar . '_EVENT_HOST_WEBSITE' => $objEvent->org_website, $this->moduleLangVar . '_EVENT_HOST_LINK' => $objEvent->org_link, $this->moduleLangVar . '_EVENT_HOST_PHONE' => $objEvent->org_phone, $this->moduleLangVar . '_EVENT_HOST_EMAIL' => $objEvent->org_email, $this->moduleLangVar . '_EVENT_LOCATION_TYPE_MANUAL' => $eventId != 0 ? $objEvent->locationType == 1 ? "checked='checked'" : '' : "checked='checked'", $this->moduleLangVar . '_EVENT_LOCATION_TYPE_MEDIADIR' => $eventId != 0 ? $objEvent->locationType == 2 ? "checked='checked'" : '' : "", $this->moduleLangVar . '_EVENT_HOST_TYPE_MANUAL' => $eventId != 0 ? $objEvent->hostType == 1 ? "checked='checked'" : '' : "checked='checked'", $this->moduleLangVar . '_EVENT_HOST_TYPE_MEDIADIR' => $eventId != 0 ? $objEvent->hostType == 2 ? "checked='checked'" : '' : "", $this->moduleLangVar . '_EVENT_ID' => $eventId, $this->moduleLangVar . '_EVENT_ALL_DAY' => $eventId != 0 && $objEvent->all_day ? 'checked="checked"' : '', $this->moduleLangVar . '_HIDE_ON_SINGLE_LANG' => count($this->arrFrontendLanguages) == 1 ? "display: none;" : ""));
        $multiLingualFields = array('place', 'place_city', 'place_country', 'org_name', 'org_city', 'org_country');
        $isOneActiveLanguage = count($this->arrFrontendLanguages) == 1;
        foreach ($multiLingualFields as $inputField) {
            if ($isOneActiveLanguage) {
                $this->_objTpl->hideBlock('calendar_event_' . $inputField . '_expand');
            } else {
                $this->_objTpl->touchBlock('calendar_event_' . $inputField . '_expand');
            }
        }
        foreach ($this->arrFrontendLanguages as $arrLang) {
            //parse globals
            $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_EVENT_LANG_SHORTCUT' => $arrLang['lang'], $this->moduleLangVar . '_EVENT_LANG_ID' => $arrLang['id'], 'TXT_' . $this->moduleLangVar . '_EVENT_LANG_NAME' => $arrLang['name']));
            //parse "show in" checkboxes
            $arrShowIn = explode(",", $objEvent->showIn);
            $langChecked = false;
            if ($eventId != 0) {
                $langChecked = in_array($arrLang['id'], $arrShowIn) ? true : false;
            } else {
                $langChecked = $arrLang['is_default'] == 'true';
            }
            //parse eventTabMenuDescTab
            $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_TAB_DISPLAY' => $langChecked ? 'block' : 'none', $this->moduleLangVar . '_EVENT_TAB_CLASS' => ''));
            $this->_objTpl->parse('eventTabMenuDescTab');
            //parse eventDescTab
            $eventTitle = !empty($objEvent->arrData['title'][$arrLang['id']]) ? $objEvent->arrData['title'][$arrLang['id']] : (!empty($objEvent->arrData['redirect'][$_LANGID]) ? $objEvent->arrData['redirect'][$_LANGID] : '');
            $eventDescription = !empty($objEvent->arrData['description'][$arrLang['id']]) ? $objEvent->arrData['description'][$arrLang['id']] : '';
            $eventRedirect = !empty($objEvent->arrData['redirect'][$arrLang['id']]) ? $objEvent->arrData['redirect'][$arrLang['id']] : (!empty($objEvent->arrData['redirect'][$_LANGID]) ? $objEvent->arrData['redirect'][$_LANGID] : '');
            $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_TAB_DISPLAY' => $langChecked ? 'block' : 'none', $this->moduleLangVar . '_EVENT_TITLE' => contrexx_raw2xhtml($eventTitle), $this->moduleLangVar . '_EVENT_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg("description[{$arrLang['id']}]", contrexx_raw2xhtml($eventDescription), $eventId != 0 ? 'small' : 'bbcode'), $this->moduleLangVar . '_EVENT_REDIRECT' => contrexx_raw2xhtml($eventRedirect), $this->moduleLangVar . '_EVENT_TYPE_EVENT_DISPLAY' => $objEvent->type == 0 ? 'block' : 'none', $this->moduleLangVar . '_EVENT_TYPE_REDIRECT_DISPLAY' => $objEvent->type == 1 ? 'block' : 'none'));
            $this->_objTpl->parse('eventDescTab');
            //parse eventLingualFields
            foreach ($multiLingualFields as $inputField) {
                $this->_objTpl->setVariable($this->moduleLangVar . '_EVENT_' . strtoupper($inputField) . '_DEFAULT', $eventId != 0 ? $objEvent->{$inputField} : '');
                $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_VALUE' => !empty($objEvent->arrData[$inputField][$arrLang['id']]) ? $objEvent->arrData[$inputField][$arrLang['id']] : ($eventId != 0 ? $objEvent->{$inputField} : '')));
                $this->_objTpl->parse('calendar_event_' . $inputField);
            }
            $langChecked = $langChecked ? 'checked="checked"' : '';
            $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_LANG_CHECKED' => $langChecked));
            $this->_objTpl->parse('eventShowIn');
        }
        //parse placeSelect
        if ((int) $this->arrSettings['placeData'] > 1) {
            $objMediadirEntries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry('MediaDir');
            $objMediadirEntries->getEntries(null, null, null, null, null, null, true, 0, 'n', null, null, intval($this->arrSettings['placeDataForm']));
            $placeOptions = '<option value="">' . $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHOOSE'] . '</option>';
            foreach ($objMediadirEntries->arrEntries as $key => $arrEntry) {
                $selectedPlace = $arrEntry['entryId'] == $objEvent->place_mediadir_id ? 'selected="selected"' : '';
                $placeOptions .= '<option ' . $selectedPlace . ' value="' . $arrEntry['entryId'] . '">' . $arrEntry['entryFields'][0] . '</option>';
            }
            $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_PLACE_OPTIONS' => $placeOptions));
            $this->_objTpl->parse('eventPlaceSelect');
            if ((int) $this->arrSettings['placeData'] == 2) {
                $this->_objTpl->hideBlock('eventPlaceInput');
                $this->_objTpl->hideBlock('eventPlaceTypeRadio');
            } else {
                $this->_objTpl->touchBlock('eventPlaceInput');
                $this->_objTpl->touchBlock('eventPlaceTypeRadio');
            }
        } else {
            $this->_objTpl->touchBlock('eventPlaceInput');
            $this->_objTpl->hideBlock('eventPlaceSelect');
            $this->_objTpl->hideBlock('eventPlaceTypeRadio');
        }
        //parse placeHostSelect
        if ((int) $this->arrSettings['placeDataHost'] > 1) {
            $objMediadirEntries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry('MediaDir');
            $objMediadirEntries->getEntries(null, null, null, null, null, null, true, 0, 'n', null, null, intval($this->arrSettings['placeDataHostForm']));
            $placeOptions = '<option value="">' . $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHOOSE'] . '</option>';
            foreach ($objMediadirEntries->arrEntries as $key => $arrEntry) {
                $selectedPlace = $arrEntry['entryId'] == $objEvent->host_mediadir_id ? 'selected="selected"' : '';
                $placeOptions .= '<option ' . $selectedPlace . ' value="' . $arrEntry['entryId'] . '">' . $arrEntry['entryFields'][0] . '</option>';
            }
            $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_PLACE_OPTIONS' => $placeOptions));
            $this->_objTpl->parse('eventHostSelect');
            if ((int) $this->arrSettings['placeDataHost'] == 2) {
                $this->_objTpl->hideBlock('eventHostInput');
                $this->_objTpl->hideBlock('eventHostTypeRadio');
            } else {
                $this->_objTpl->touchBlock('eventHostInput');
                $this->_objTpl->touchBlock('eventHostTypeRadio');
            }
        } else {
            $this->_objTpl->touchBlock('eventHostInput');
            $this->_objTpl->hideBlock('eventHostSelect');
            $this->_objTpl->hideBlock('eventHostTypeRadio');
        }
    }
    function getContent($intEntryId, $arrInputfield, $arrTranslationStatus)
    {
        global $objDatabase, $_LANGID, $_ARRAYLANG;
        $intId = intval($arrInputfield['id']);
        $objInputfieldValue = $objDatabase->Execute("\n            SELECT\n                `value`\n            FROM\n                " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields\n            WHERE\n                field_id=" . $intId . "\n            AND\n                entry_id=" . $intEntryId . "\n            LIMIT 1\n        ");
        $strValue = strip_tags(htmlspecialchars($objInputfieldValue->fields['value'], ENT_QUOTES, CONTREXX_CHARSET));
        if (!empty($strValue)) {
            //get seperator
            $strSeperator = ',';
            //explode links
            $arrRelationGroup = explode($strSeperator, $strValue);
            //open relation <ul> list
            $strList = '<ul class="mediadirInputfieldRellation_group">';
            //make relation elements
            foreach ($arrRelationGroup as $intRelationId) {
                $objEntry = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry();
                $objEntry->getEntries($intRelationId);
                $strRelationValue = $objEntry->arrEntries[$intRelationId]['entryFields'][0];
                //$strRelationFormId = $objEntry->arrEntries[$intRelationId]['entryFormId'];
                /*if($this->checkPageCmd('detail'.intval($strRelationFormId))) {
                      $strDetailCmd = 'detail'.intval($strRelationFormId);
                  } else {
                      $strDetailCmd = 'detail';
                  }*/
                //make hyperlink with <a> and <li> tag
                //$strList .= '<li><a href="index.php?section='.$this->moduleName.'&amp;cmd='.$strDetailCmd.'&amp;eid='.$intRelationId.'" target="_blank">'.$strRelationValue.'</a></li>';
                $strList .= '<li>' . $strRelationValue . '</li>';
                ///////// CUSTOM ///////////
                $objRelationDefaultLang = $objDatabase->Execute("SELECT `lang_id` FROM " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_entries WHERE id=" . intval($intRelationId) . " LIMIT 1");
                $intRelationDefaultLang = intval($objRelationDefaultLang->fields['lang_id']);
                if ($this->arrSettings['settingsTranslationStatus'] == 1) {
                    if (in_array($_LANGID, $arrTranslationStatus)) {
                        $intRelationLangId = $_LANGID;
                    } else {
                        $intRelationLangId = $intRelationDefaultLang;
                    }
                } else {
                    $intRelationLangId = $_LANGID;
                }
                $objRelationValues = $objDatabase->Execute("\n\t\t            SELECT\n\t\t                `value`, `field_id`\n\t\t            FROM\n\t\t                " . DBPREFIX . "module_" . $this->moduleTablePrefix . "_rel_entry_inputfields\n\t\t            WHERE\n\t\t                lang_id=" . $intRelationLangId . "\n\t\t            AND\n\t\t                entry_id=" . $intRelationId . "\n\t\t        ");
                $arrRelationValues = array();
                if ($objRelationValues !== false) {
                    while (!$objRelationValues->EOF) {
                        $arrRelationValues[$objRelationValues->fields['field_id']] = htmlspecialchars($objRelationValues->fields['value'], ENT_QUOTES, CONTREXX_CHARSET);
                        $objRelationValues->MoveNext();
                    }
                }
                $strWeb = !empty($arrRelationValues[56]) ? '<a href="' . $arrRelationValues[56] . '" target="_blank">' . $arrRelationValues[56] . '</a>' : '';
                $arrUsers = array();
                $arrUsers = explode(',', $arrRelationValues[57]);
                $strUsers = '';
                foreach ($arrUsers as $intUserId) {
                    $objUser = \FWUser::getFWUserObject()->objUser->getUser($intUserId);
                    if ($objUser) {
                        if ($objUser->getProfileAttribute('firstname') != "" && $objUser->getProfileAttribute('lastname') != "") {
                            $strUsers .= htmlentities($objUser->getProfileAttribute('firstname') . ' ' . $objUser->getProfileAttribute('lastname'), ENT_QUOTES, CONTREXX_CHARSET) . '<br />';
                            $strUsers .= $objUser->getProfileAttribute('1') ? htmlentities($objUser->objAttribute->getById($objUser->getProfileAttribute('1'))->getName(), ENT_QUOTES, CONTREXX_CHARSET) . '<br />' : '';
                            //$strUsers .= ($objUser->getProfileAttribute('address') != "") ? $objUser->getProfileAttribute('address').'<br />' : '';
                            //$strUsers .= ($objUser->getProfileAttribute('zip') != "" && $objUser->getProfileAttribute('city') != "") ? $objUser->getProfileAttribute('zip').' '.$objUser->getProfileAttribute('city').'<br />' : '';
                            //$strUsers .= ($objUser->getProfileAttribute('phone_office') != "") ? $objUser->getProfileAttribute('phone_office').'<br />' : '';
                            $strUsers .= '<a rel="shadowbox;player=iframe;width=700;height=650" href="teilnehmer_kontakt?13=' . $objUser->getId() . '&amp;14=' . urlencode($objUser->getProfileAttribute('company') . ', ' . $objUser->getProfileAttribute('firstname') . ' ' . $objUser->getProfileAttribute('lastname')) . '">' . $_ARRAYLANG['TXT_MEDIADIR_GET_IN_CONTACT'] . '</a><br />';
                            $strUsers .= '<br />';
                        }
                    }
                }
                $strCustom .= '<table border="0" cellpadding="2">
	               <tr>
                        <td colspan="2"><h3>' . \FWUser::getFWUserObject()->objUser->objAttribute->getById('country_' . $arrRelationValues[54])->getName() . '</h3></td>
	               <tr>
	                   <td width="50%">' . $arrRelationValues[61] . '<br />' . (!empty($arrRelationValues[49]) ? $arrRelationValues[49] . '<br />' : '') . $arrRelationValues[50] . '<br />' . $arrRelationValues[51] . ' ' . $arrRelationValues[53] . '<br />' . \FWUser::getFWUserObject()->objUser->objAttribute->getById('country_' . $arrRelationValues[54])->getName() . '<br />' . $strWeb . '<br /></td>
                       <td width="50%">' . $strUsers . '</td>
	               </tr>
	            </table>';
                ///////// CUSTOM ///////////
            }
            //close relation </ul> list
            $strList .= '</ul>';
        }
        if (!empty($strValue)) {
            $arrContent['TXT_' . $this->moduleLangVar . '_INPUTFIELD_NAME'] = htmlspecialchars($arrInputfield['name'][0], ENT_QUOTES, CONTREXX_CHARSET);
            $arrContent[$this->moduleLangVar . '_INPUTFIELD_VALUE'] = $strList;
            $arrContent[$this->moduleLangVar . '_INPUTFIELD_CUSTOM'] = $strCustom . '<br />';
        } else {
            $arrContent = null;
        }
        return $arrContent;
    }
Пример #6
0
 /**
  * Add / Edit of the Event
  *
  * @param integer $eventId Event id
  *
  * @return null
  */
 function modifyEvent($eventId)
 {
     global $objDatabase, $_ARRAYLANG, $_CORELANG, $_LANGID;
     $this->_objTpl->loadTemplateFile('module_calendar_modify_event.html');
     \JS::registerJS("modules/{$this->moduleName}/View/Script/jquery.pagination.js");
     \ContrexxJavascript::getInstance()->setVariable(array('language_id' => \FWLanguage::getDefaultLangId(), 'active_lang' => implode(',', \FWLanguage::getIdArray())), 'calendar');
     $this->getSettings();
     $this->getFrontendLanguages();
     if (isset($_POST['submitModifyEvent']) || isset($_POST['save_and_publish'])) {
         $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent();
         if ($objEvent->save($_POST)) {
             $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_SAVED'];
             if (isset($_POST['save_and_publish'])) {
                 \Permission::checkAccess(180, 'static');
                 if ($objEvent->confirm()) {
                     // do nothing
                 } else {
                     $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED'];
                 }
             }
             $this->showOverview();
             return;
         } else {
             $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_SAVED'];
         }
         if ($this->arrSettings['rssFeedStatus'] == 1) {
             $objFeedEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(time(), null, null, null, true);
             $objFeed = new \Cx\Modules\Calendar\Controller\CalendarFeed($objFeedEventManager);
             $objFeed->creatFeed();
         }
     }
     $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true);
     $objCategoryManager->getCategoryList();
     $objFormManager = new \Cx\Modules\Calendar\Controller\CalendarFormManager(true);
     $objFormManager->getFormList();
     $objMail = new \Cx\Modules\Calendar\Controller\CalendarMail();
     $objMail->getTemplateList();
     $copy = isset($_REQUEST['copy']) && !empty($_REQUEST['copy']);
     $this->_pageTitle = $copy || empty($eventId) ? $_ARRAYLANG['TXT_CALENDAR_INSERT_EVENT'] : $_ARRAYLANG['TXT_CALENDAR_EVENT'] . " " . $_ARRAYLANG['TXT_CALENDAR_EDIT'];
     if ($eventId != 0) {
         $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent($eventId);
         $objEvent->getData();
     }
     //parse weekdays
     $arrWeekdays = array("1000000" => $_ARRAYLANG['TXT_CALENDAR_DAYS_MONDAY'], "0100000" => $_ARRAYLANG['TXT_CALENDAR_DAYS_TUESDAY'], "0010000" => $_ARRAYLANG['TXT_CALENDAR_DAYS_WEDNESDAY'], "0001000" => $_ARRAYLANG['TXT_CALENDAR_DAYS_THURSDAY'], "0000100" => $_ARRAYLANG['TXT_CALENDAR_DAYS_FRIDAY'], "0000010" => $_ARRAYLANG['TXT_CALENDAR_DAYS_SATURDAY'], "0000001" => $_ARRAYLANG['TXT_CALENDAR_DAYS_SUNDAY']);
     foreach ($arrWeekdays as $value => $name) {
         $selectedWeekday = $value == $objEvent->seriesData['seriesPatternWeekday'] ? 'selected="selected"' : '';
         $weekdays .= '<option value="' . $value . '" ' . $selectedWeekday . '>' . $name . '</option>';
     }
     //parse count
     $arrCount = array(1 => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_FIRST'], 2 => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_SECOND'], 3 => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_THIRD'], 4 => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_FOURTH'], 5 => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_LAST']);
     foreach ($arrCount as $value => $name) {
         $selectedCount = $value == $objEvent->seriesData['seriesPatternCount'] ? 'selected="selected"' : '';
         $count .= '<option value="' . $value . '" ' . $selectedCount . '>' . $name . '</option>';
     }
     if ($eventId) {
         $startDate = $objEvent->startDate;
         $endDate = $objEvent->endDate;
     } else {
         $startDate = new \DateTime();
         $startMin = (int) $startDate->format('i');
         // Adjust the time to next half hour
         if (!in_array($startMin, array(0, 30))) {
             $minAdj = 60 - $startMin > 30 ? 30 - $startMin : 60 - $startMin;
             $startDate->setTime($startDate->format('H'), $startDate->format('i') + $minAdj, 00);
         }
         $endDate = clone $startDate;
         $endDate->modify("+30 mins");
     }
     $eventStartDate = $this->format2userDateTime($startDate);
     $eventEndDate = $this->format2userDateTime($endDate);
     //parse globals
     $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_TITLE' => $this->_pageTitle, 'TXT_' . $this->moduleLangVar . '_EVENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT'], 'TXT_' . $this->moduleLangVar . '_SAVE' => $_ARRAYLANG['TXT_CALENDAR_SAVE'], 'TXT_' . $this->moduleLangVar . '_DELETE' => $_ARRAYLANG['TXT_CALENDAR_DELETE'], 'TXT_' . $this->moduleLangVar . '_CANCEL' => $_CORELANG['TXT_CANCEL'], 'TXT_' . $this->moduleLangVar . '_EXPAND' => $_ARRAYLANG['TXT_CALENDAR_EXPAND'], 'TXT_' . $this->moduleLangVar . '_MINIMIZE' => $_ARRAYLANG['TXT_CALENDAR_MINIMIZE'], 'TXT_' . $this->moduleLangVar . '_EVENT_DETAILS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DETAILS'], 'TXT_' . $this->moduleLangVar . '_EVENT_INVITE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_INVITE'], 'TXT_' . $this->moduleLangVar . '_EVENT_SERIES' => $_ARRAYLANG['TXT_CALENDAR_EVENT_SERIES'], 'TXT_' . $this->moduleLangVar . '_EVENT_SERIES_TYPE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_SERIES_TYPE'], 'TXT_' . $this->moduleLangVar . '_EVENT_SERIES_PATTERN' => $_ARRAYLANG['TXT_CALENDAR_EVENT_SERIES_PATTERN'], 'TXT_' . $this->moduleLangVar . '_EVENT_SERIES_EXCEPTIONS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_SERIES_EXCEPTIONS'], 'TXT_' . $this->moduleLangVar . '_EVENT_PUBLICATE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PUBLICATE'], 'TXT_' . $this->moduleLangVar . '_YES' => $_ARRAYLANG['TXT_CALENDAR_YES'], 'TXT_' . $this->moduleLangVar . '_NEXT' => $_ARRAYLANG['TXT_CALENDAR_NEXT'], 'TXT_' . $this->moduleLangVar . '_BACK' => $_ARRAYLANG['TXT_CALENDAR_STEP_BACK'], 'TXT_' . $this->moduleLangVar . '_EVENT_PRIORITY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PRIORITY'], 'TXT_' . $this->moduleLangVar . '_EVENT_START' => $_ARRAYLANG['TXT_CALENDAR_EVENT_START'], 'TXT_' . $this->moduleLangVar . '_EVENT_END' => $_ARRAYLANG['TXT_CALENDAR_EVENT_END'], 'TXT_' . $this->moduleLangVar . '_EVENT_ACCESS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ACCESS'], 'TXT_' . $this->moduleLangVar . '_EVENT_WHOLE_DAY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_WHOLE_DAY'], 'TXT_' . $this->moduleLangVar . '_BROWSE' => $_ARRAYLANG['TXT_CALENDAR_BROWSE'], 'TXT_' . $this->moduleLangVar . '_ACTIVATE' => $_ARRAYLANG['TXT_CALENDAR_ACTIVATE'], 'TXT_' . $this->moduleLangVar . '_EVENT_PRICE' => $_ARRAYLANG['TXT_CALENDAR_PRICE'], 'TXT_' . $this->moduleLangVar . '_EVENT_LINK' => $_ARRAYLANG['TXT_CALENDAR_EVENT_LINK'], 'TXT_' . $this->moduleLangVar . '_EVENT_PICTURE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PICTURE'], 'TXT_' . $this->moduleLangVar . '_EVENT_ATTACHMENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ATTACHMENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CATEGORY'], 'TXT_' . $this->moduleLangVar . '_COMMUNITY_GROUPS' => $_ARRAYLANG['TXT_CALENDAR_COMMUNITY_GROUPS'], 'TXT_' . $this->moduleLangVar . '_PLEASE_CHECK_INPUT' => $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHECK_INPUT'], 'TXT_' . $this->moduleLangVar . '_EVENT_MORE_INVITATIONS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_MORE_INVITATIONS'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION' => $_ARRAYLANG['TXT_CALENDAR_EVENT_REGISTRATION'], 'TXT_' . $this->moduleLangVar . '_EVENT_NUM_SUBSCRIBER' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NUM_SUBSCRIBER'], 'TXT_' . $this->moduleLangVar . '_EVENT_NOTIFICATION_TO' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NOTIFICATION_TO'], 'TXT_' . $this->moduleLangVar . '_EVENT_EMAIL_TEMPLATE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_EMAIL_TEMPLATE'], 'TXT_' . $this->moduleLangVar . '_EVENT_TICKET_SALES' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TICKET_SALES'], 'TXT_' . $this->moduleLangVar . '_EVENT_NUM_SEATING' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NUM_SEATING'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_DURANCE' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_DURANCE'], 'TXT_' . $this->moduleLangVar . '_SERIES_ACTIVATE' => $_ARRAYLANG['TXT_CALENDAR_SERIES_ACTIVATE'], 'TXT_' . $this->moduleLangVar . '_SERIES' => $_ARRAYLANG['TXT_CALENDAR_SERIES'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_DAILY' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_DAILY'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_WEEKLY'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_MONTHLY'], 'TXT_' . $this->moduleLangVar . '_DAYS' => $_ARRAYLANG['TXT_CALENDAR_DAYS'], 'TXT_' . $this->moduleLangVar . '_DAYS_DAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_DAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_MONDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_MONDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_TUESDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_TUESDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_WEDNESDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_WEDNESDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_THURSDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_THURSDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_FRIDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_FRIDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_SATURDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_SATURDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_SUNDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_SUNDAY'], 'TXT_' . $this->moduleLangVar . '_DAYS_WORKDAY' => $_ARRAYLANG['TXT_CALENDAR_DAYS_WORKDAY'], 'TXT_' . $this->moduleLangVar . '_AT' => $_ARRAYLANG['TXT_CALENDAR_AT'], 'TXT_' . $this->moduleLangVar . '_EVERY_1' => $_ARRAYLANG['TXT_CALENDAR_EVERY_1'], 'TXT_' . $this->moduleLangVar . '_ALL' => $_ARRAYLANG['TXT_CALENDAR_ALL'], 'TXT_' . $this->moduleLangVar . '_EVERY_2' => $_ARRAYLANG['TXT_CALENDAR_EVERY_2'], 'TXT_' . $this->moduleLangVar . '_WEEKS' => $_ARRAYLANG['TXT_CALENDAR_WEEKS'], 'TXT_' . $this->moduleLangVar . '_MONTHS' => $_ARRAYLANG['TXT_CALENDAR_MONTHS'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_BEGINS' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_BEGINS'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_NO_ENDDATE' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_NO_ENDDATE'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_ENDS_AFTER' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_ENDS_AFTER'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_APPONTMENTS' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_APPONTMENTS'], 'TXT_' . $this->moduleLangVar . '_SERIES_PATTERN_ENDS' => $_ARRAYLANG['TXT_CALENDAR_SERIES_PATTERN_ENDS'], 'TXT_' . $this->moduleLangVar . '_EVENT_SEND_INVITATION' => $objEvent->invitationSent == 0 ? $_ARRAYLANG['TXT_CALENDAR_EVENT_SEND_INVITATION'] : $_ARRAYLANG['TXT_CALENDAR_EVENT_SEND_AGAIN_INVITATION'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE_EVENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_EVENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_TYPE_REDIRECT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_REDIRECT'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION_FORM' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATION_FORM'], 'TXT_' . $this->moduleLangVar . '_EVENT_MORE_INVITATIONS_INFO' => $_ARRAYLANG['TXT_CALENDAR_EVENT_MORE_INVITATIONS_INFO'], 'TXT_' . $this->moduleLangVar . '_REGISTRATIONS_SUBSCRIBER_INFO' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS_SUBSCRIBER_INFO'], 'TXT_' . $this->moduleLangVar . '_EVENT_NOTIFICATION_TO_INFO' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NOTIFICATION_TO_INFO'], 'TXT_' . $this->moduleLangVar . '_EVENT_EMAIL_TEMPLATE_INFO' => $_ARRAYLANG['TXT_CALENDAR_EVENT_EMAIL_TEMPLATE_INFO'], 'TXT_' . $this->moduleLangVar . '_EVENT_NUM_SEATING_INFO' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NUM_SEATING_INFO'], 'TXT_' . $this->moduleLangVar . '_SHOW_START_DATE' => $_ARRAYLANG['TXT_CALENDAR_SHOW_START_DATE'], 'TXT_' . $this->moduleLangVar . '_SHOW_END_DATE' => $_ARRAYLANG['TXT_CALENDAR_SHOW_END_DATE'], 'TXT_' . $this->moduleLangVar . '_SHOW_TIME_TYPE' => $_ARRAYLANG['TXT_CALENDAR_SHOW_TIME_TYPE'], 'TXT_' . $this->moduleLangVar . '_SHOW_START_TIME' => $_ARRAYLANG['TXT_CALENDAR_SHOW_START_TIME'], 'TXT_' . $this->moduleLangVar . '_SHOW_END_TIME' => $_ARRAYLANG['TXT_CALENDAR_SHOW_END_TIME'], 'TXT_' . $this->moduleLangVar . '_LIST' => $_ARRAYLANG['TXT_CALENDAR_LIST'], 'TXT_' . $this->moduleLangVar . '_DETAIL' => $_ARRAYLANG['TXT_CALENDAR_DETAIL'], 'TXT_' . $this->moduleLangVar . '_BASIC_DATA' => $_ARRAYLANG['TXT_CALENDAR_BASIC_DATA'], 'TXT_' . $this->moduleLangVar . '_LANGUAGE' => $_ARRAYLANG['TXT_CALENDAR_LANG'], 'TXT_' . $this->moduleLangVar . '_ADDITIONAL_OPTIONS' => $_ARRAYLANG['TXT_CALENDAR_ADDITIONAL_OPTIONS'], 'TXT_' . $this->moduleLangVar . '_EVENT_LOCATION' => $_ARRAYLANG['TXT_CALENDAR_EVENT_LOCATION'], 'TXT_' . $this->moduleLangVar . '_EVENT_ALL_DAY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ALL_DAY'], 'TXT_' . $this->moduleLangVar . '_EVENT_NAME' => $_ARRAYLANG['TXT_CALENDAR_EVENT_NAME'], 'TXT_' . $this->moduleLangVar . '_EVENT_HOST' => $_ARRAYLANG['TXT_CALENDAR_EVENT_HOST'], 'TXT_' . $this->moduleLangVar . '_EVENT_EMAIL' => $_ARRAYLANG['TXT_CALENDAR_EVENT_EMAIL'], 'TXT_' . $this->moduleLangVar . '_SELECT_EXCEPTION_DATE_INFO' => $_ARRAYLANG['TXT_CALENDAR_SELECT_EXCEPTION_DATE_INFO'], 'TXT_' . $this->moduleLangVar . '_OK' => $_ARRAYLANG['TXT_CALENDAR_OK'], 'TXT_' . $this->moduleLangVar . '_CANCEL' => $_ARRAYLANG['TXT_CALENDAR_CANCEL'], 'TXT_' . $this->moduleLangVar . '_MANAGE' => $_ARRAYLANG['TXT_CALENDAR_MANAGE'], 'TXT_' . $this->moduleLangVar . '_EVENT_SHOW_IN' => $_ARRAYLANG['TXT_CALENDAR_EVENT_SHOW_IN'], 'TXT_' . $this->moduleLangVar . '_EVENT_TITLE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TITLE'], 'TXT_' . $this->moduleLangVar . '_EVENT_TEASER' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TEASER'], 'TXT_' . $this->moduleLangVar . '_EVENT_PLACE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PLACE'], 'TXT_' . $this->moduleLangVar . '_EVENT_STREET' => $_ARRAYLANG['TXT_CALENDAR_EVENT_STREET'], 'TXT_' . $this->moduleLangVar . '_EVENT_ZIP' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ZIP'], 'TXT_' . $this->moduleLangVar . '_EVENT_CITY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_CITY'], 'TXT_' . $this->moduleLangVar . '_EVENT_COUNTRY' => $_ARRAYLANG['TXT_CALENDAR_EVENT_COUNTRY'], 'TXT_' . $this->moduleLangVar . '_EVENT_WEBSITE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_WEBSITE'], 'TXT_' . $this->moduleLangVar . '_EVENT_PHONE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PHONE'], 'TXT_' . $this->moduleLangVar . '_EVENT_MAP' => $_ARRAYLANG['TXT_CALENDAR_EVENT_MAP'], 'TXT_' . $this->moduleLangVar . '_EVENT_USE_GOOGLEMAPS' => $_ARRAYLANG['TXT_CALENDAR_EVENT_USE_GOOGLEMAPS'], 'TXT_' . $this->moduleLangVar . '_PLACE_DATA_DEFAULT' => $_ARRAYLANG['TXT_CALENDAR_PLACE_DATA_DEFAULT'], 'TXT_' . $this->moduleLangVar . '_PLACE_DATA_FROM_MEDIADIR' => $_ARRAYLANG['TXT_CALENDAR_PLACE_DATA_FROM_MEDIADIR'], 'TXT_' . $this->moduleLangVar . '_PREV' => $_ARRAYLANG['TXT_CALENDAR_PREV'], 'TXT_' . $this->moduleLangVar . '_NEXT' => $_ARRAYLANG['TXT_CALENDAR_NEXT'], 'TXT_' . $this->moduleLangVar . '_EVENT_DETAIL_VIEW' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DETAIL_VIEW'], 'TXT_' . $this->moduleLangVar . '_EVENT_DETAIL_VIEW_LABEL' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DETAIL_VIEW_LABEL'], 'TXT_' . $this->moduleLangVar . '_EVENT_TREAT_AS_INDEPENDENT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TREAT_AS_INDEPENDENT'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION_NONE' => $_ARRAYLANG['TXT_CALENDAR_EVENT_REGISTRATION_NONE'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION_INTERNAL' => $_ARRAYLANG['TXT_CALENDAR_EVENT_REGISTRATION_INTERNAL'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION_EXTERNAL' => $_ARRAYLANG['TXT_CALENDAR_EVENT_REGISTRATION_EXTERNAL'], 'TXT_' . $this->moduleLangVar . '_EVENT_REGISTRATION_FULL_BOOKED' => $_ARRAYLANG['TXT_CALENDAR_EVENT_REGISTRATION_FULL_BOOKED'], 'TXT_' . $this->moduleLangVar . '_MORE' => $_ARRAYLANG['TXT_CALENDAR_MORE'], 'TXT_' . $this->moduleLangVar . '_MINIMIZE' => $_ARRAYLANG['TXT_CALENDAR_MINIMIZE'], $this->moduleLangVar . '_EVENT_REDIRECT_BROWSE_BUTTON' => self::showMediaBrowserButton('eventRedirect', 'sitestructure'), $this->moduleLangVar . '_EVENT_PICTURE_BROWSE_BUTTON' => self::showMediaBrowserButton('eventPicture'), $this->moduleLangVar . '_EVENT_ATTACHMENT_BROWSE_BUTTON' => self::showMediaBrowserButton('eventAttachment'), $this->moduleLangVar . '_PLACE_MAP_SOURCE_BROWSE_BUTTON' => self::showMediaBrowserButton('inputPlaceMap'), $this->moduleLangVar . '_EVENT_ID' => $eventId, $this->moduleLangVar . '_EVENT_DEFAULT_LANG_ID' => $_LANGID, $this->moduleLangVar . '_EVENT_DATE_FORMAT' => $this->getDateFormat(1), $this->moduleLangVar . '_EVENT_CURRENCY' => $this->arrSettings['paymentCurrency'], $this->moduleLangVar . '_EVENT_CATEGORIES' => $objCategoryManager->getCategoryDropdown(intval($objEvent->catId), 2), $this->moduleLangVar . '_EVENT_SERIES_PATTERN_MONTHLY_COUNT' => $count, $this->moduleLangVar . '_EVENT_SERIES_PATTERN_MONTHLY_WEEKDAY' => $weekdays, $this->moduleLangVar . '_EVENT_REGISTRATION_FORMS' => $objFormManager->getFormDorpdown(intval($objEvent->registrationForm)), $this->moduleLangVar . '_EVENT_SHOW_DETAIL_VIEW' => $eventId != 0 ? $objEvent->showDetailView == 1 ? 'checked="checked"' : '' : 'checked="checked"', $this->moduleLangVar . '_EVENT_TYPE_EVENT' => $eventId != 0 ? $objEvent->type == 0 ? 'selected="selected"' : '' : '', $this->moduleLangVar . '_EVENT_TYPE_REDIRECT' => $eventId != 0 ? $objEvent->type == 1 ? 'selected="selected"' : '' : '', $this->moduleLangVar . '_EVENT_START_DATE' => $eventStartDate, $this->moduleLangVar . '_EVENT_END_DATE' => $eventEndDate, $this->moduleLangVar . '_EVENT_PRICE' => $eventId != 0 ? $objEvent->price : '', $this->moduleLangVar . '_EVENT_LINK' => $eventId != 0 ? $objEvent->link : '', $this->moduleLangVar . '_EVENT_PICTURE' => $eventId != 0 ? $objEvent->pic : '', $this->moduleLangVar . '_EVENT_ATTACHMENT' => $eventId != 0 ? $objEvent->attach : '', $this->moduleLangVar . '_EVENT_MORE_INVITATIONS' => $eventId != 0 ? $objEvent->invitedMails : '', $this->moduleLangVar . '_EVENT_NUM_SUBSCRIBER' => $eventId != 0 ? $objEvent->numSubscriber : '', $this->moduleLangVar . '_EVENT_NOTIFICATION_TO' => $eventId != 0 ? $objEvent->notificationTo : '', $this->moduleLangVar . '_EVENT_TICKET_SALES' => $eventId != 0 ? $objEvent->ticketSales ? 'checked="checked"' : '' : '', $this->moduleLangVar . '_EVENT_NUM_SEATING' => $eventId != 0 ? $objEvent->numSeating : '', $this->moduleLangVar . '_EVENT_ALL_DAY' => $eventId != 0 && $objEvent->all_day ? 'checked="checked"' : '', $this->moduleLangVar . '_HIDE_ON_SINGLE_LANG' => count($this->arrFrontendLanguages) == 1 ? "display: none;" : "", $this->moduleLangVar . '_LOCATION_TYPE' => $this->arrSettings['placeData'] == 3 ? $eventId != 0 ? $objEvent->locationType : 1 : $this->arrSettings['placeData'], $this->moduleLangVar . '_EVENT_LOCATION_TYPE_MANUAL' => $eventId != 0 ? $objEvent->locationType == 1 ? "checked='checked'" : '' : "checked='checked'", $this->moduleLangVar . '_EVENT_LOCATION_TYPE_MEDIADIR' => $eventId != 0 ? $objEvent->locationType == 2 ? "checked='checked'" : '' : "", $this->moduleLangVar . '_EVENT_PLACE' => $eventId != 0 ? $objEvent->place : '', $this->moduleLangVar . '_EVENT_STREET' => $eventId != 0 ? $objEvent->place_street : '', $this->moduleLangVar . '_EVENT_ZIP' => $eventId != 0 ? $objEvent->place_zip : '', $this->moduleLangVar . '_EVENT_CITY' => $eventId != 0 ? $objEvent->place_city : '', $this->moduleLangVar . '_EVENT_COUNTRY' => $eventId != 0 ? $objEvent->place_country : '', $this->moduleLangVar . '_EVENT_PLACE_WEBSITE' => $eventId != 0 ? $objEvent->place_website : '', $this->moduleLangVar . '_EVENT_PLACE_LINK' => $eventId != 0 ? $objEvent->place_link : '', $this->moduleLangVar . '_EVENT_PLACE_PHONE' => $eventId != 0 ? $objEvent->place_phone : '', $this->moduleLangVar . '_PLACE_MAP_SOURCE' => $eventId != 0 ? $objEvent->place_map : '', $this->moduleLangVar . '_EVENT_MAP' => $objEvent->google == 1 ? 'checked="checked"' : '', $this->moduleLangVar . '_EVENT_HOST_TYPE' => $this->arrSettings['placeDataHost'] == 3 ? $eventId != 0 ? $objEvent->hostType : 1 : $this->arrSettings['placeDataHost'], $this->moduleLangVar . '_EVENT_HOST' => $eventId != 0 ? $objEvent->org_name : '', $this->moduleLangVar . '_EVENT_HOST_ADDRESS' => $eventId != 0 ? $objEvent->org_street : '', $this->moduleLangVar . '_EVENT_HOST_ZIP' => $eventId != 0 ? $objEvent->org_zip : '', $this->moduleLangVar . '_EVENT_HOST_CITY' => $eventId != 0 ? $objEvent->org_city : '', $this->moduleLangVar . '_EVENT_HOST_COUNTRY' => $eventId != 0 ? $objEvent->org_country : '', $this->moduleLangVar . '_EVENT_HOST_WEBSITE' => $eventId != 0 ? $objEvent->org_website : '', $this->moduleLangVar . '_EVENT_HOST_LINK' => $eventId != 0 ? $objEvent->org_link : '', $this->moduleLangVar . '_EVENT_HOST_PHONE' => $eventId != 0 ? $objEvent->org_phone : '', $this->moduleLangVar . '_EVENT_HOST_EMAIL' => $eventId != 0 ? $objEvent->org_email : '', $this->moduleLangVar . '_EVENT_HOST_TYPE_MANUAL' => $eventId != 0 ? $objEvent->hostType == 1 ? "checked='checked'" : '' : "checked='checked'", $this->moduleLangVar . '_EVENT_HOST_TYPE_MEDIADIR' => $eventId != 0 ? $objEvent->hostType == 2 ? "checked='checked'" : '' : "", $this->moduleLangVar . '_EVENT_COPY' => $copy ? 1 : 0, $this->moduleLangVar . '_EVENT_REGISTRATION_NONE_SELECTED' => !empty($eventId) ? $objEvent->registration == CalendarEvent::EVENT_REGISTRATION_NONE ? 'selected="selected"' : '' : 'selected="selected"', $this->moduleLangVar . '_EVENT_REGISTRATION_INTERNAL_SELECTED' => !empty($eventId) && $objEvent->registration == CalendarEvent::EVENT_REGISTRATION_INTERNAL ? 'selected="selected"' : '', $this->moduleLangVar . '_EVENT_REGISTRATION_EXTERNAL_SELECTED' => !empty($eventId) && $objEvent->registration == CalendarEvent::EVENT_REGISTRATION_EXTERNAL ? 'selected="selected"' : '', $this->moduleLangVar . '_EVENT_REGISTRATION_EXTERNAL_LINK' => !empty($eventId) ? $objEvent->registrationExternalLink : '', $this->moduleLangVar . '_EVENT_REGISTRATION_EXTERNAL_FULL_BOOKED' => !empty($eventId) ? $objEvent->registrationExternalFullyBooked ? 'checked="checked"' : '' : ''));
     // parse invitation E-mail template
     foreach ($this->arrFrontendLanguages as $language) {
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_INVITATION_EMAIL_LANG' => \Html::getLanguageIcon($language['id'], 'active', 'javascript:void()'), $this->moduleLangVar . '_EVENT_INVITATION_EMAIL_LANG_ID' => (int) $language['id'], $this->moduleLangVar . '_EVENT_INVITATION_EMAIL_TEMPLATE' => $objMail->getTemplateDropdown(intval($objEvent->invitationTemplate[$language['id']]), \Cx\Modules\Calendar\Controller\CalendarMailManager::MAIL_INVITATION, $language['id'])));
         $this->_objTpl->parse('invitation_email_template');
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_REGISTRATION_EMAIL_LANG' => \Html::getLanguageIcon($language['id'], 'active', 'javascript:void()'), $this->moduleLangVar . '_EVENT_REGISTRATION_EMAIL_LANG_ID' => (int) $language['id'], $this->moduleLangVar . '_EVENT_REGISTRATION_EMAIL_TEMPLATE' => $objMail->getTemplateDropdown(intval($objEvent->emailTemplate[$language['id']]), \Cx\Modules\Calendar\Controller\CalendarMailManager::MAIL_CONFIRM_REG, $language['id'])));
         $this->_objTpl->parse('registration_email_template');
     }
     //parse access
     for ($i = 0; $i < 2; $i++) {
         $selectedAccess = $eventId == 0 && $i == 0 ? 'selected="selected"' : $objEvent->access == $i ? 'selected="selected"' : '';
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_ACCESS' => $i, $this->moduleLangVar . '_EVENT_ACCESS_SELECT' => $selectedAccess, $this->moduleLangVar . '_EVENT_ACCESS_NAME' => $_ARRAYLANG['TXT_CALENDAR_EVENT_ACCESS_' . $i]));
         $this->_objTpl->parse('eventAccess');
     }
     //parse priority
     for ($i = 1; $i <= 5; $i++) {
         $selectedPriority = $eventId == 0 && $i == 3 ? 'selected="selected"' : $objEvent->priority == $i ? 'selected="selected"' : '';
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_PRIORITY' => $i, $this->moduleLangVar . '_EVENT_PRIORITY_SELECT' => $selectedPriority, $this->moduleLangVar . '_EVENT_PRIORITY_NAME' => $_ARRAYLANG['TXT_CALENDAR_EVENT_PRIORITY_' . $i]));
         $this->_objTpl->parse('eventPriority');
     }
     //parse timetypes
     if ($eventId != 0) {
         // list view
         $showStartDateList = $objEvent->showStartDateList;
         $showEndDateList = $objEvent->showEndDateList;
         $showStartTimeList = $objEvent->showStartTimeList;
         $showEndTimeList = $objEvent->showEndTimeList;
         $showTimeTypeList = $objEvent->showTimeTypeList;
         // detail view
         $showStartDateDetail = $objEvent->showStartDateDetail;
         $showEndDateDetail = $objEvent->showEndDateDetail;
         $showStartTimeDetail = $objEvent->showStartTimeDetail;
         $showEndTimeDetail = $objEvent->showEndTimeDetail;
         $showTimeTypeDetail = $objEvent->showTimeTypeDetail;
     } else {
         // list view
         $showStartDateList = $this->arrSettings['showStartDateList'] == 1;
         $showEndDateList = $this->arrSettings['showEndDateList'] == 1;
         $showStartTimeList = $this->arrSettings['showStartTimeList'] == 1;
         $showEndTimeList = $this->arrSettings['showEndTimeList'] == 1;
         // check if start- or endtime is selected in settings to set type "show time" by default
         if (!$_POST['showTimeTypeList'] && ($showStartTimeList == 1 || $showEndTimeList == 1)) {
             $showTimeTypeList = 1;
         } else {
             $showTimeTypeList = $_POST['showTimeTypeList'];
         }
         // detail view
         $showStartDateDetail = $this->arrSettings['showStartDateDetail'] == 1;
         $showEndDateDetail = $this->arrSettings['showEndDateDetail'] == 1;
         $showStartTimeDetail = $this->arrSettings['showStartTimeDetail'] == 1;
         $showEndTimeDetail = $this->arrSettings['showEndTimeDetail'] == 1;
         // check if start- or endtime is selected in settings to set type "show time" by default
         if (!$_POST['showTimeTypeDetail'] && ($showStartTimeDetail == 1 || $showEndTimeDetail == 1)) {
             $showTimeTypeDetail = 1;
         } else {
             $showTimeTypeDetail = $_POST['showTimeTypeDetail'];
         }
     }
     //time type dropdown for list
     $c = 0;
     $arrListOptions = array($_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_NOTHING'], $_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_TIME'], $_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_FULLTIME']);
     $strTimeTypeListDropdown = '<select id="showTimeTypeList" name="showTimeTypeList" onchange="showTimeListSelection();" >';
     foreach ($arrListOptions as $key => $option) {
         $c == $showTimeTypeList ? $selected = 'selected="selected"' : ($selected = '');
         $strTimeTypeListDropdown .= '<option value="' . $c . '" ' . $selected . '  >' . $arrListOptions[$c] . '</option>';
         $c++;
     }
     $strTimeTypeListDropdown .= '</select>';
     //time type dropdown for detail
     $c = 0;
     $arrDetailOptions = array($_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_NOTHING'], $_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_TIME'], $_ARRAYLANG['TXT_CALENDAR_TIME_TYPE_FULLTIME']);
     $strTimeTypeDetailDropdown = '<select id="showTimeTypeDetail" name="showTimeTypeDetail" onchange="showTimeDetailSelection();" >';
     foreach ($arrDetailOptions as $key => $option) {
         $c == $showTimeTypeDetail ? $selected = 'selected="selected"' : ($selected = '');
         $strTimeTypeDetailDropdown .= '<option value="' . $c . '" ' . $selected . '  >' . $arrDetailOptions[$c] . '</option>';
         $c++;
     }
     $strTimeTypeDetailDropdown .= '</select>';
     //time type placeholders
     $this->_objTpl->setVariable(array($this->moduleLangVar . '_USE_CUSTOM_DATE_DISPLAY' => $objEvent->useCustomDateDisplay ? 'checked="checked"' : '', $this->moduleLangVar . '_START_DATE_CHECKED_LIST' => $showStartDateList ? 'checked="checked"' : '', $this->moduleLangVar . '_START_DATE_VALUE_LIST' => 1, $this->moduleLangVar . '_END_DATE_CHECKED_LIST' => $showEndDateList ? 'checked="checked"' : '', $this->moduleLangVar . '_END_DATE_VALUE_LIST' => 1, $this->moduleLangVar . '_SHOW_TIME_TYPE_DROPDOWN_LIST' => $strTimeTypeListDropdown, $this->moduleLangVar . '_START_TIME_CHECKED_LIST' => $showStartTimeList ? 'checked="checked"' : '', $this->moduleLangVar . '_START_TIME_VALUE_LIST' => 1, $this->moduleLangVar . '_END_TIME_CHECKED_LIST' => $showEndTimeList ? 'checked="checked"' : '', $this->moduleLangVar . '_END_TIME_VALUE_LIST' => 1, $this->moduleLangVar . '_START_DATE_CHECKED_DETAIL' => $showStartDateDetail ? 'checked="checked"' : '', $this->moduleLangVar . '_START_DATE_VALUE_DETAIL' => 1, $this->moduleLangVar . '_END_DATE_CHECKED_DETAIL' => $showEndDateDetail ? 'checked="checked"' : '', $this->moduleLangVar . '_END_DATE_VALUE_DETAIL' => 1, $this->moduleLangVar . '_SHOW_TIME_TYPE_DROPDOWN_DETAIL' => $strTimeTypeDetailDropdown, $this->moduleLangVar . '_START_TIME_CHECKED_DETAIL' => $showStartTimeDetail ? 'checked="checked"' : '', $this->moduleLangVar . '_START_TIME_VALUE_DETAIL' => 1, $this->moduleLangVar . '_END_TIME_CHECKED_DETAIL' => $showEndTimeDetail ? 'checked="checked"' : '', $this->moduleLangVar . '_END_TIME_VALUE_DETAIL' => 1));
     //parse series
     $lastExeptionId = 4;
     $seriesStatus = $objEvent->seriesStatus == 1 ? 'checked="checked"' : '';
     $seriesIndependent = empty($eventId) || $objEvent->independentSeries == 1 ? 'checked="checked"' : '';
     $seriesPatternDailyDays = 1;
     $seriesPatternWeeklyWeeks = 1;
     $seriesPatternMonthlyDay = 1;
     $seriesPatternMonthl1 = 1;
     $seriesPatternMonthl2 = 1;
     $seriesPatternEndsEvents = 5;
     if ($eventId != 0 && $objEvent->seriesStatus == 1) {
         $seriesPatternDaily = $objEvent->seriesData['seriesType'] == 1 ? 'selected="selected"' : '';
         $seriesPatternWeekly = $objEvent->seriesData['seriesType'] == 2 ? 'selected="selected"' : '';
         $seriesPatternMonthly = $objEvent->seriesData['seriesType'] == 3 ? 'selected="selected"' : '';
         //daily
         if ($objEvent->seriesData['seriesType'] == 1) {
             $seriesPatternDaily1 = $objEvent->seriesData['seriesPatternType'] == 1 ? 'checked="checked"' : '';
             $seriesPatternDaily2 = $objEvent->seriesData['seriesPatternType'] == 2 ? 'checked="checked"' : '';
             $seriesPatternDailyDays = $objEvent->seriesData['seriesPatternType'] == 1 ? $objEvent->seriesData['seriesPatternDay'] : 1;
         }
         //weekly
         if ($objEvent->seriesData['seriesType'] == 2) {
             $seriesPatternWeeklyWeeks = $objEvent->seriesData['seriesPatternWeek'];
             $seriesPatternWeeklyMon = substr($objEvent->seriesData['seriesPatternWeekday'], 0, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklyTue = substr($objEvent->seriesData['seriesPatternWeekday'], 1, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklyWed = substr($objEvent->seriesData['seriesPatternWeekday'], 2, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklyThu = substr($objEvent->seriesData['seriesPatternWeekday'], 3, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklyFri = substr($objEvent->seriesData['seriesPatternWeekday'], 4, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklySat = substr($objEvent->seriesData['seriesPatternWeekday'], 5, 1) == 1 ? 'checked="checked"' : '';
             $seriesPatternWeeklySun = substr($objEvent->seriesData['seriesPatternWeekday'], 6, 1) == 1 ? 'checked="checked"' : '';
         }
         //monthly
         if ($objEvent->seriesData['seriesType'] == 3) {
             $seriesPatternMonthly1 = $objEvent->seriesData['seriesPatternType'] == 1 ? 'checked="checked"' : '';
             $seriesPatternMonthly2 = $objEvent->seriesData['seriesPatternType'] == 2 ? 'checked="checked"' : '';
             if ($objEvent->seriesData['seriesPatternType'] == 1) {
                 $seriesPatternMonthlyDay = $objEvent->seriesData['seriesPatternDay'];
                 $seriesPatternMonthl1 = $objEvent->seriesData['seriesPatternMonth'];
             }
             if ($objEvent->seriesData['seriesPatternType'] == 2) {
                 $seriesPatternMonthl2 = $objEvent->seriesData['seriesPatternMonth'];
             }
         }
         //douration
         $seriesPatternDourance1 = $objEvent->seriesData['seriesPatternDouranceType'] == 1 ? 'checked="checked"' : '';
         $seriesPatternDourance2 = $objEvent->seriesData['seriesPatternDouranceType'] == 2 ? 'checked="checked"' : '';
         $seriesPatternDourance3 = $objEvent->seriesData['seriesPatternDouranceType'] == 3 ? 'checked="checked"' : '';
         $seriesPatternEndsEvents = $objEvent->seriesData['seriesPatternDouranceType'] == 2 ? $objEvent->seriesData['seriesPatternEnd'] : 5;
         $seriesPatternEndsDate = $objEvent->seriesData['seriesPatternDouranceType'] == 3 ? $this->format2userDate($objEvent->seriesData['seriesPatternEndDate']) : '';
         foreach ($objEvent->seriesData['seriesPatternExceptions'] as $key => $seriesExceptionDate) {
             if ($seriesExceptionDate != null) {
                 $this->_objTpl->setVariable(array($this->moduleLangVar . '_SERIES_EXEPTION_DATE' => $this->format2userDate($seriesExceptionDate)));
                 $this->_objTpl->parse('eventExeptions');
             }
         }
     } else {
         $seriesPatternDaily = 'checked="checked"';
         $seriesPatternDaily1 = 'checked="checked"';
         $seriesPatternMonthly1 = 'checked="checked"';
         $seriesPatternDourance1 = 'checked="checked"';
         $this->_objTpl->hideBlock('eventExeptions');
     }
     $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_SERIES_STATUS' => $seriesStatus, $this->moduleLangVar . '_EVENT_SERIES_INDEPENDENT' => $seriesIndependent, $this->moduleLangVar . '_SERIES_PATTERN_DAILY' => $seriesPatternDaily, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY' => $seriesPatternWeekly, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY' => $seriesPatternMonthly, $this->moduleLangVar . '_SERIES_PATTERN_DAILY_1' => $seriesPatternDaily1, $this->moduleLangVar . '_SERIES_PATTERN_DAILY_2' => $seriesPatternDaily2, $this->moduleLangVar . '_SERIES_PATTERN_DAILY_DAYS' => $seriesPatternDailyDays, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY_1' => $seriesPatternMonthly1, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY_DAY' => $seriesPatternMonthlyDay, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY_MONTH_1' => $seriesPatternMonthl1, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY_MONTH_2' => $seriesPatternMonthl2, $this->moduleLangVar . '_SERIES_PATTERN_MONTHLY_2' => $seriesPatternMonthly2, $this->moduleLangVar . '_SERIES_PATTERN_DOURANCE_1' => $seriesPatternDourance1, $this->moduleLangVar . '_SERIES_PATTERN_DOURANCE_2' => $seriesPatternDourance2, $this->moduleLangVar . '_SERIES_PATTERN_DOURANCE_3' => $seriesPatternDourance3, $this->moduleLangVar . '_SERIES_PATTERN_ENDS_EVENTS' => $seriesPatternEndsEvents, $this->moduleLangVar . '_SERIES_PATTERN_ENDS_DATE' => $seriesPatternEndsDate, $this->moduleLangVar . '_SERIES_PATTERN_ENDS_INPUT_ID' => $seriesPatternEndsInputId, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_WEEKS' => $seriesPatternWeeklyWeeks, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_MONDAY' => $seriesPatternWeeklyMon, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_TUESDAY' => $seriesPatternWeeklyTue, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_WEDNESDAY' => $seriesPatternWeeklyWed, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_THURSDAY' => $seriesPatternWeeklyThu, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_FRIDAY' => $seriesPatternWeeklyFri, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_SATURDAY' => $seriesPatternWeeklySat, $this->moduleLangVar . '_SERIES_PATTERN_WEEKLY_SUNDAY' => $seriesPatternWeeklySun));
     //parse publicate
     $objHostManager = new \Cx\Modules\Calendar\Controller\CalendarHostManager(null, true);
     $objHostManager->getHostList();
     foreach ($objHostManager->hostList as $key => $objHost) {
         if (in_array($objHost->id, $objEvent->relatedHosts)) {
             $selectetHosts .= '<option value="' . $objHost->id . '">' . $objHost->title . '</option>';
         } else {
             $deselectetHosts .= '<option value="' . $objHost->id . '">' . $objHost->title . '</option>';
         }
     }
     $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_DESELECTED_HOSTS' => $deselectetHosts, $this->moduleLangVar . '_EVENT_SELECTED_HOSTS' => $selectetHosts));
     if ($this->arrSettings['publicationStatus'] == 1 && !empty($objHostManager->hostList)) {
         $onsubmitPublications = "selectAll(document.formModifyEvent.elements['selectedHosts[]']);";
         $this->_objTpl->touchBlock('eventPublicateMenu');
         $this->_objTpl->touchBlock('eventPublicateTab');
     } else {
         $onsubmitPublications = "";
         $this->_objTpl->hideBlock('eventPublicateMenu');
         $this->_objTpl->hideBlock('eventPublicateTab');
     }
     //parse ivited groups
     $this->getCommunityGroups();
     foreach ($this->arrCommunityGroups as $key => $arrGroup) {
         if (in_array($arrGroup['id'], $objEvent->invitedGroups)) {
             $selectedGroups .= '<option value="' . $arrGroup['id'] . '">' . htmlentities($arrGroup['name'], ENT_QUOTES, CONTREXX_CHARSET) . '</option>';
         } else {
             $deselectedGroups .= '<option value="' . $arrGroup['id'] . '">' . htmlentities($arrGroup['name'], ENT_QUOTES, CONTREXX_CHARSET) . '</option>';
         }
     }
     $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_DESELECTED_GROUPS' => $deselectedGroups, $this->moduleLangVar . '_EVENT_SELECTED_GROUPS' => $selectedGroups, $this->moduleLangVar . '_EVENT_ONSUBMIT_PUBLICATIONS' => $onsubmitPublications));
     $forcedLanguage = null;
     if (isset($_GET['langId']) && in_array(contrexx_input2raw($_GET['langId']), \FWLanguage::getIdArray())) {
         $forcedLanguage = contrexx_input2raw($_GET['langId']);
     }
     //parse placeSelect
     if ((int) $this->arrSettings['placeData'] > 1) {
         $objMediadirEntries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry('MediaDir');
         $objMediadirEntries->getEntries(null, null, null, null, null, null, true, 0, 'n', null, null, intval($this->arrSettings['placeDataForm']));
         $placeOptions = '<option value="">' . $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHOOSE'] . '</option>';
         foreach ($objMediadirEntries->arrEntries as $key => $arrEntry) {
             $selectedPlace = $arrEntry['entryId'] == $objEvent->place_mediadir_id ? 'selected="selected"' : '';
             $placeOptions .= '<option ' . $selectedPlace . ' value="' . $arrEntry['entryId'] . '">' . $arrEntry['entryFields'][0] . '</option>';
         }
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_PLACE_OPTIONS' => $placeOptions));
         $this->_objTpl->parse('eventPlaceSelect');
         if ((int) $this->arrSettings['placeData'] == 2) {
             $this->_objTpl->hideBlock('eventPlaceInput');
             $this->_objTpl->hideBlock('eventPlaceTypeRadio');
         } else {
             $this->_objTpl->touchBlock('eventPlaceInput');
             $this->_objTpl->touchBlock('eventPlaceTypeRadio');
         }
     } else {
         $this->_objTpl->touchBlock('eventPlaceInput');
         $this->_objTpl->hideBlock('eventPlaceSelect');
         $this->_objTpl->hideBlock('eventPlaceTypeRadio');
     }
     //parse placeHostSelect
     if ((int) $this->arrSettings['placeDataHost'] > 1) {
         $objMediadirEntries = new \Cx\Modules\MediaDir\Controller\MediaDirectoryEntry('MediaDir');
         $objMediadirEntries->getEntries(null, null, null, null, null, null, true, 0, 'n', null, null, intval($this->arrSettings['placeDataHostForm']));
         $placeOptions = '<option value="">' . $_ARRAYLANG['TXT_CALENDAR_PLEASE_CHOOSE'] . '</option>';
         foreach ($objMediadirEntries->arrEntries as $key => $arrEntry) {
             $selectedPlace = $arrEntry['entryId'] == $objEvent->host_mediadir_id ? 'selected="selected"' : '';
             $placeOptions .= '<option ' . $selectedPlace . ' value="' . $arrEntry['entryId'] . '">' . $arrEntry['entryFields'][0] . '</option>';
         }
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_PLACE_OPTIONS' => $placeOptions));
         $this->_objTpl->parse('eventHostSelect');
         if ((int) $this->arrSettings['placeDataHost'] == 2) {
             $this->_objTpl->hideBlock('eventHostInput');
             $this->_objTpl->hideBlock('eventHostTypeRadio');
         } else {
             $this->_objTpl->touchBlock('eventHostInput');
             $this->_objTpl->touchBlock('eventHostTypeRadio');
         }
     } else {
         $this->_objTpl->touchBlock('eventHostInput');
         $this->_objTpl->hideBlock('eventHostSelect');
         $this->_objTpl->hideBlock('eventHostTypeRadio');
     }
     $multiLingualFields = array('place', 'place_city', 'place_country', 'org_name', 'org_city', 'org_country');
     $isOneActiveLanguage = count($this->arrFrontendLanguages) == 1;
     foreach ($multiLingualFields as $inputField) {
         if ($isOneActiveLanguage) {
             $this->_objTpl->hideBlock('calendar_event_' . $inputField . '_expand');
         } else {
             $this->_objTpl->touchBlock('calendar_event_' . $inputField . '_expand');
         }
     }
     foreach ($this->arrFrontendLanguages as $key => $arrLang) {
         //parse globals
         $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_EVENT_LANG_SHORTCUT' => $arrLang['lang'], $this->moduleLangVar . '_EVENT_LANG_ID' => $arrLang['id'], 'TXT_' . $this->moduleLangVar . '_EVENT_LANG_NAME' => $arrLang['name']));
         //parse "show in" checkboxes
         $arrShowIn = explode(",", $objEvent->showIn);
         $langChecked = false;
         if ($eventId != 0) {
             $langChecked = in_array($arrLang['id'], $arrShowIn);
             if ($forcedLanguage && !$langChecked) {
                 $langChecked = $forcedLanguage == $arrLang['id'];
             }
         } else {
             $langChecked = $arrLang['is_default'] == 'true';
         }
         if ($langChecked) {
             $langChecked = 'checked="checked"';
         } else {
             $langChecked = '';
         }
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_LANG_CHECKED' => $langChecked));
         $this->_objTpl->parse('eventShowIn');
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_TAB_DISPLAY' => $arrLang['is_default'] == 'true' ? 'block' : 'none', $this->moduleLangVar . '_EVENT_TITLE' => !empty($objEvent->arrData['title'][$arrLang['id']]) ? $objEvent->arrData['title'][$arrLang['id']] : $objEvent->title, $this->moduleLangVar . '_EVENT_TEASER' => !empty($objEvent->arrData['teaser'][$arrLang['id']]) ? $objEvent->arrData['teaser'][$arrLang['id']] : $objEvent->teaser));
         //parse eventTabMenuDescTab
         $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_TAB_CLASS' => $defaultLang ? 'active' : ''));
         $this->_objTpl->parse('eventTabMenuDescTab');
         //parse eventDescTab
         $this->_objTpl->setVariable(array('TXT_' . $this->moduleLangVar . '_EVENT_DESCRIPTION' => $_ARRAYLANG['TXT_CALENDAR_EVENT_DESCRIPTION'], 'TXT_' . $this->moduleLangVar . '_EVENT_REDIRECT' => $_ARRAYLANG['TXT_CALENDAR_EVENT_TYPE_REDIRECT'], $this->moduleLangVar . '_EVENT_TAB_DISPLAY' => $arrLang['is_default'] == 'true' ? 'block' : 'none', $this->moduleLangVar . '_EVENT_DESCRIPTION' => new \Cx\Core\Wysiwyg\Wysiwyg('description[' . $arrLang['id'] . ']', !empty($objEvent->arrData['description'][$arrLang['id']]) ? contrexx_raw2xhtml($objEvent->arrData['description'][$arrLang['id']]) : contrexx_raw2xhtml($objEvent->description), 'full'), $this->moduleLangVar . '_EVENT_REDIRECT' => !empty($objEvent->arrData['redirect'][$arrLang['id']]) ? $objEvent->arrData['redirect'][$arrLang['id']] : $objEvent->arrData['redirect'][$_LANGID], $this->moduleLangVar . '_EVENT_TYPE_EVENT_DISPLAY' => $objEvent->type == 0 ? 'block' : 'none', $this->moduleLangVar . '_EVENT_TYPE_REDIRECT_DISPLAY' => $objEvent->type == 1 ? 'block' : 'none', $this->moduleLangVar . '_ONSUBMIT_PUBLICATION' => $onsubmitPublications));
         $this->_objTpl->parse('eventDescTab');
         //parse eventLingualFields
         foreach ($multiLingualFields as $inputField) {
             $this->_objTpl->setVariable($this->moduleLangVar . '_EVENT_' . strtoupper($inputField) . '_DEFAULT', $eventId != 0 ? $objEvent->{$inputField} : '');
             $this->_objTpl->setVariable(array($this->moduleLangVar . '_EVENT_VALUE' => !empty($objEvent->arrData[$inputField][$arrLang['id']]) ? $objEvent->arrData[$inputField][$arrLang['id']] : ($eventId != 0 ? $objEvent->{$inputField} : '')));
             $this->_objTpl->parse('calendar_event_' . $inputField);
         }
     }
     if (isset($_GET['confirm']) && $_GET['confirm']) {
         $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_SAVE_PUBLISH' => "<input type='submit' name='save_and_publish' value='{$_ARRAYLANG['TXT_CALENDAR_SAVE_AND_PUBLISH']}'>", $this->moduleLangVar . '_EVENT_DELETE' => "<input type='button' name='delete' value='{$_ARRAYLANG['TXT_CALENDAR_DELETE']}' onClick='if (confirm(\"{$_ARRAYLANG['TXT_CALENDAR_CONFIRM_DELETE_DATA']}\\n{$_ARRAYLANG['TXT_CALENDAR_ACTION_IS_IRREVERSIBLE']}\")) { window.location.href = \"index.php?cmd={$this->moduleName}&delete={$eventId}&" . \Cx\Core\Csrf\Controller\Csrf::param() . "\"} return false;'>"));
     }
     \Cx\Core\Core\Controller\Cx::instanciate()->getComponent('Cache')->deleteComponentFiles('Calendar');
 }