getCategoryFromUrl($pageParam);; parent::__construct($pageCall, $pageParam); $this->name = Util::ucFirst(Lang::game('events')); } protected function generateContent() { $condition = []; if (!User::isInGroup(U_GROUP_EMPLOYEE)) $condition[] = [['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]; if ($this->category) { switch ($this->category[0]) { case 0: $condition[] = ['e.holidayId', 0]; break; case 1: $condition[] = ['h.scheduleType', -1]; break; case 2: $condition[] = ['h.scheduleType', [0, 1]]; break; case 3: $condition[] = ['h.scheduleType', 2]; break; } } $events = new WorldEventList($condition); $this->extendGlobalData($events->getJSGlobals()); $this->deps = []; foreach ($events->iterate() as $__) if ($d = $events->getField('requires')) $this->deps[$events->id] = $d; $this->lvTabs[] = array( 'file' => 'event', 'data' => $events->getListviewData(), 'params' => [] ); if ($_ = array_filter($events->getListviewData(), function($x) {return $x['id'] > 0;})) { $this->lvTabs[] = array( 'file' => 'calendar', 'data' => $_, 'params' => ['hideCount' => 1] ); } } protected function generateTitle() { array_unshift($this->title, $this->name); if ($this->category) array_unshift($this->title, Lang::event('category')[$this->category[0]]); } protected function generatePath() { if ($this->category) $this->path[] = $this->category[0]; } protected function postCache() { // recalculate dates with now() foreach ($this->lvTabs as &$views) { foreach ($views['data'] as &$data) { // is a followUp-event if (!empty($this->deps[$data['id']])) { $data['startDate'] = $data['endDate'] = false; unset($data['_date']); continue; } $updated = WorldEventList::updateDates($data['_date']); unset($data['_date']); $data['startDate'] = $updated['start'] ? date(Util::$dateFormatInternal, $updated['start']) : false; $data['endDate'] = $updated['end'] ? date(Util::$dateFormatInternal, $updated['end']) : false; $data['rec'] = $updated['rec']; } } } } ?>