/** * Perform the overview page functionalities * * @return null */ function showOverview() { global $objDatabase, $_ARRAYLANG, $_CORELANG; $this->_objTpl->loadTemplateFile('module_calendar_overview.html'); $this->_pageTitle = $_ARRAYLANG['TXT_CALENDAR_MENU_OVERVIEW']; $this->getSettings(); if (isset($_GET['switch_status'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['switch_status'])); if ($objEvent->switchStatus()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED']; } } if (isset($_GET['delete'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['delete'])); if ($objEvent->delete()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_DELETED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_DELETED']; } } if (isset($_GET['confirm'])) { \Permission::checkAccess(180, 'static'); $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['confirm'])); if ($objEvent->confirm()) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_EDITED']; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_EDITED']; } } if (isset($_GET['export'])) { $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($_GET['export'])); $objEvent->export(); } if (isset($_GET['multi'])) { \Permission::checkAccess(180, 'static'); $status = true; $messageVar = 'EDITED'; foreach ($_POST['selectedEventId'] as $key => $eventId) { $objEvent = new \Cx\Modules\Calendar\Controller\CalendarEvent(intval($eventId)); switch ($_GET['multi']) { case 'delete': $status = $objEvent->delete() ? true : false; $messageVar = 'DELETED'; break; case 'activate': $objEvent->status = 0; $status = $objEvent->switchStatus() ? true : false; $messageVar = 'EDITED'; break; case 'deactivate': $objEvent->status = 1; $status = $objEvent->switchStatus() ? true : false; $messageVar = 'EDITED'; break; case 'export': $objEvent->export(); break; } } if ($status) { $this->okMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_SUCCESSFULLY_' . $messageVar]; } else { $this->errMessage = $_ARRAYLANG['TXT_CALENDAR_EVENT_CORRUPT_' . $messageVar]; } } $categoryId = intval($_REQUEST['categoryId']) != 0 ? $categoryId = intval($_REQUEST['categoryId']) : ($categoryId = null); $searchTerm = isset($_REQUEST['term']) ? $_REQUEST['term'] : ($searchTerm = $_ARRAYLANG['TXT_CALENDAR_KEYWORD']); $startPos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : 0; $listType = 'all'; if ($_GET['list'] == 'actual' || !isset($_GET['list'])) { $styleListActual = 'underline'; $styleListAll = ''; $startDate = new \DateTime(); $listType = 'upcoming'; } else { $styleListActual = ''; $styleListAll = 'underline'; $startDate = null; } $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_OVERVIEW' => $this->_pageTitle, 'TXT_' . $this->moduleLangVar . '_UPCOMING_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_UPCOMING_EVENTS'], 'TXT_' . $this->moduleLangVar . '_ALL_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_ALL_EVENTS'], 'TXT_' . $this->moduleLangVar . '_FILTER' => $_ARRAYLANG['TXT_CALENDAR_FILTER'], 'TXT_' . $this->moduleLangVar . '_CONFIRMLIST' => $_ARRAYLANG['TXT_CALENDAR_CONFIRMLIST'], 'TXT_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_SEARCH' => $_CORELANG['TXT_USER_SEARCH'], 'TXT_' . $this->moduleLangVar . '_KEYWORD' => $searchTerm, 'TXT_' . $this->moduleLangVar . '_EVENTS' => $_ARRAYLANG['TXT_CALENDAR_EVENTS'], 'TXT_' . $this->moduleLangVar . '_STATUS' => $_ARRAYLANG['TXT_CALENDAR_STATUS'], 'TXT_' . $this->moduleLangVar . '_DATE' => $_ARRAYLANG['TXT_CALENDAR_DATE'], 'TXT_' . $this->moduleLangVar . '_TITLE' => $_ARRAYLANG['TXT_CALENDAR_TITLE'], 'TXT_' . $this->moduleLangVar . '_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CATEGORY'], 'TXT_' . $this->moduleLangVar . '_SERIES' => $_ARRAYLANG['TXT_CALENDAR_SERIES'], 'TXT_' . $this->moduleLangVar . '_RE_DEREGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_RE_DEGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_REGISTRATIONS' => $_ARRAYLANG['TXT_CALENDAR_REGISTRATIONS'], 'TXT_' . $this->moduleLangVar . '_WAITLIST' => $_ARRAYLANG['TXT_CALENDAR_WAITLIST'], 'TXT_' . $this->moduleLangVar . '_ACTION' => $_ARRAYLANG['TXT_CALENDAR_ACTION'], 'TXT_' . $this->moduleLangVar . '_EXPORT_ICAL_FORMAT' => $_ARRAYLANG['TXT_CALENDAR_EXPORT_ICAL_FORMAT'], 'TXT_' . $this->moduleLangVar . '_EDIT' => $_ARRAYLANG['TXT_CALENDAR_EDIT'], 'TXT_' . $this->moduleLangVar . '_COPY' => $_ARRAYLANG['TXT_CALENDAR_COPY'], 'TXT_' . $this->moduleLangVar . '_DELETE' => $_ARRAYLANG['TXT_CALENDAR_DELETE'], 'TXT_' . $this->moduleLangVar . '_LANGUAGES' => $_ARRAYLANG['TXT_CALENDAR_LANGUAGES'], 'TXT_SELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_MARK_ALL'], 'TXT_DESELECT_ALL' => $_ARRAYLANG['TXT_CALENDAR_REMOVE_CHOICE'], 'TXT_SUBMIT_SELECT' => $_ARRAYLANG['TXT_SUBMIT_SELECT'], 'TXT_SUBMIT_ACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_ACTIVATE'], 'TXT_SUBMIT_DEACTIVATE' => $_ARRAYLANG['TXT_SUBMIT_DEACTIVATE'], 'TXT_SUBMIT_DELETE' => $_ARRAYLANG['TXT_SUBMIT_DELETE'], 'TXT_SUBMIT_EXPORT' => $_ARRAYLANG['TXT_SUBMIT_EXPORT'], 'TXT_' . $this->moduleLangVar . '_CONFIRM_DELETE_DATA' => $_ARRAYLANG['TXT_CALENDAR_CONFIRM_DELETE_DATA'], 'TXT_' . $this->moduleLangVar . '_ACTION_IS_IRREVERSIBLE' => $_ARRAYLANG['TXT_CALENDAR_ACTION_IS_IRREVERSIBLE'], 'TXT_' . $this->moduleLangVar . '_MAKE_SELECTION' => $_ARRAYLANG['TXT_CALENDAR_MAKE_SELECTION'], 'TXT_' . $this->moduleLangVar . '_LIST_ACTUAL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ACTUAL'], 'TXT_' . $this->moduleLangVar . '_LIST_ALL' => $_ARRAYLANG['TXT_CALENDAR_LIST_ALL'], $this->moduleLangVar . '_LINKSTYLE_LIST_ACTUAL' => $styleListActual, $this->moduleLangVar . '_LINKSTYLE_LIST_ALL' => $styleListAll)); $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true); $objCategoryManager->getCategoryList(); $this->_objTpl->setVariable(array('CALENDAR_CATEGORIES' => $objCategoryManager->getCategoryDropdown($categoryId, 1))); $objConfirmEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager(null, null, null, null, null, null, true, null, null, false, null); $objConfirmEventManager->getEventList(); if (count($objConfirmEventManager->eventList) > 0) { $objConfirmEventManager->showEventList($this->_objTpl, 'confirm'); } else { $this->_objTpl->hideBlock('showConfirmList'); } 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(); } $showSeries = $listType == 'upcoming'; $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($startDate, null, $categoryId, $searchTerm, $showSeries, null, null, $startPos, $this->arrSettings['numPaging'], 'ASC', true, null, $listType); $objEventManager->getEventList(); if ($objEventManager->countEvents > $this->arrSettings['numPaging']) { $pagingCategory = !empty($categoryId) ? '&categoryId=' . $categoryId : ''; $pagingTerm = !empty($searchTerm) ? '&term=' . $searchTerm : ''; $pagingList = !empty($_GET['list']) ? '&list=' . $_GET['list'] : ''; $this->_objTpl->setVariable(array($this->moduleLangVar . '_PAGING' => getPaging($objEventManager->countEvents, $startPos, "&cmd=" . $this->moduleName . $pagingCategory . $pagingTerm . $pagingList, "<b>" . $_ARRAYLANG['TXT_CALENDAR_EVENTS'] . "</b>", true, $this->arrSettings['numPaging']))); } $objEventManager->showEventList($this->_objTpl); }
/** * set the placeholders for the category view * * @return null */ function showCategoryView() { global $_ARRAYLANG, $_CORELANG; $this->_objTpl->setTemplate($this->pageContent, true, true); // load source code if cmd value is integer if ($this->_objTpl->placeholderExists('APPLICATION_DATA')) { $page = new \Cx\Core\ContentManager\Model\Entity\Page(); $page->setVirtual(true); $page->setType(\Cx\Core\ContentManager\Model\Entity\Page::TYPE_APPLICATION); $page->setModule('Calendar'); // load source code $applicationTemplate = \Cx\Core\Core\Controller\Cx::getContentTemplateOfPage($page); \LinkGenerator::parseTemplate($applicationTemplate); $this->_objTpl->addBlock('APPLICATION_DATA', 'application_data', $applicationTemplate); } $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true); $objCategoryManager->getCategoryList(); $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_TERM' => $_ARRAYLANG['TXT_CALENDAR_KEYWORD'], 'TXT_' . $this->moduleLangVar . '_FROM' => $_ARRAYLANG['TXT_CALENDAR_FROM'], 'TXT_' . $this->moduleLangVar . '_TILL' => $_ARRAYLANG['TXT_CALENDAR_TILL'], 'TXT_' . $this->moduleLangVar . '_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CAT'], 'TXT_' . $this->moduleLangVar . '_SEARCH' => $_ARRAYLANG['TXT_CALENDAR_SEARCH'], 'TXT_' . $this->moduleLangVar . '_OCLOCK' => $_ARRAYLANG['TXT_CALENDAR_OCLOCK'], $this->moduleLangVar . '_SEARCH_TERM' => isset($_GET['term']) ? contrexx_input2xhtml($_GET['term']) : '', $this->moduleLangVar . '_SEARCH_FROM' => isset($_GET['from']) ? contrexx_input2xhtml($_GET['from']) : '', $this->moduleLangVar . '_SEARCH_TILL' => isset($_GET['till']) ? contrexx_input2xhtml($_GET['till']) : '', $this->moduleLangVar . '_SEARCH_CATEGORIES' => $objCategoryManager->getCategoryDropdown(isset($_GET['catid']) ? intval($_GET['catid']) : 0, 1))); if (isset($this->categoryId)) { $objCategory = new \Cx\Modules\Calendar\Controller\CalendarCategory($this->categoryId); $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_CATEGORY_NAME' => $objCategory->name)); $this->objEventManager->showEventList($this->_objTpl); $this->_objTpl->parse('categoryList'); } else { foreach ($objCategoryManager->categoryList as $key => $objCategory) { $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($this->startDate, $this->endDate, $objCategory->id, $this->searchTerm, true, $this->needAuth, true, $this->startPos, $this->numEvents); $objEventManager->getEventList(); $objEventManager->showEventList($this->_objTpl); $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_CATEGORY_NAME' => $objCategory->name)); $this->_objTpl->parse('categoryList'); } } }
/** * set the placeholders for the category view * * @return null */ function showCategoryView() { global $_ARRAYLANG, $_CORELANG; $this->_objTpl->setTemplate($this->pageContent, true, true); $objCategoryManager = new \Cx\Modules\Calendar\Controller\CalendarCategoryManager(true); $objCategoryManager->getCategoryList(); $this->_objTpl->setGlobalVariable(array('TXT_' . $this->moduleLangVar . '_SEARCH_TERM' => $_ARRAYLANG['TXT_CALENDAR_KEYWORD'], 'TXT_' . $this->moduleLangVar . '_FROM' => $_ARRAYLANG['TXT_CALENDAR_FROM'], 'TXT_' . $this->moduleLangVar . '_TILL' => $_ARRAYLANG['TXT_CALENDAR_TILL'], 'TXT_' . $this->moduleLangVar . '_CATEGORY' => $_ARRAYLANG['TXT_CALENDAR_CAT'], 'TXT_' . $this->moduleLangVar . '_SEARCH' => $_ARRAYLANG['TXT_CALENDAR_SEARCH'], 'TXT_' . $this->moduleLangVar . '_OCLOCK' => $_ARRAYLANG['TXT_CALENDAR_OCLOCK'], $this->moduleLangVar . '_SEARCH_TERM' => isset($_GET['term']) ? contrexx_input2xhtml($_GET['term']) : '', $this->moduleLangVar . '_SEARCH_FROM' => isset($_GET['from']) ? contrexx_input2xhtml($_GET['from']) : '', $this->moduleLangVar . '_SEARCH_TILL' => isset($_GET['till']) ? contrexx_input2xhtml($_GET['till']) : '', $this->moduleLangVar . '_SEARCH_CATEGORIES' => $objCategoryManager->getCategoryDropdown(isset($_GET['catid']) ? intval($_GET['catid']) : 0, 1))); if (isset($this->categoryId)) { $objCategory = new \Cx\Modules\Calendar\Controller\CalendarCategory($this->categoryId); $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_CATEGORY_NAME' => $objCategory->name)); $this->objEventManager->showEventList($this->_objTpl); $this->_objTpl->parse('categoryList'); } else { foreach ($objCategoryManager->categoryList as $key => $objCategory) { $objEventManager = new \Cx\Modules\Calendar\Controller\CalendarEventManager($this->startDate, $this->endDate, $objCategory->id, $this->searchTerm, true, $this->needAuth, true, $this->startPos, $this->numEvents); $objEventManager->getEventList(); $objEventManager->showEventList($this->_objTpl); $this->_objTpl->setGlobalVariable(array($this->moduleLangVar . '_CATEGORY_NAME' => $objCategory->name)); $this->_objTpl->parse('categoryList'); } } }