Example #1
0
 function evaluateRange(&$date, $range, $rangeValue)
 {
     if (!is_numeric($range)) {
         if ($range == 'last') {
             $range = -1;
         } else {
             if ($range == 'next') {
                 $range = 1;
             }
         }
     }
     if (is_numeric($rangeValue)) {
         $date->addSeconds($rangeValue * $range);
     } else {
         if (is_array($rangeValue)) {
             foreach ($rangeValue as $key => $value) {
                 if ($key == 'weekday' && $range > 0) {
                     for ($i = 0; $i < $range; $i++) {
                         $formatedDate = Calc::nextDayOfWeek($value, $date->getDay(), $date->getMonth(), $date->getYear());
                         $date = new \TYPO3\CMS\Cal\Model\CalDate($formatedDate);
                         $date->setTZbyId('UTC');
                     }
                 } else {
                     if ($key == 'weekday' && $range < 0) {
                         for ($i = 0; $i > $range; $i--) {
                             $formatedDate = Calc::prevDayOfWeek($value, $date->getDay(), $date->getMonth(), $date->getYear());
                             $date = new \TYPO3\CMS\Cal\Model\CalDate($formatedDate);
                             $date->setTZbyId('UTC');
                         }
                     } else {
                         if ($value == 'week' && $range > 0) {
                             $date->addSeconds($range * 604800);
                         } else {
                             if ($value == 'week' && $range < 0) {
                                 $date->subtractSeconds($range * 604800);
                             }
                         }
                     }
                 }
             }
         } else {
             if ($range > 0) {
                 if ($rangeValue == 'month') {
                     for ($i = 0; $i < $range; $i++) {
                         $days = Calc::daysInMonth($date->getMonth(), $date->getYear());
                         $endOfNextMonth = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfNextMonth($date->getDay(), $date->getMonth(), $date->getYear()));
                         $date->addSeconds(60 * 60 * 24 * $days);
                         if ($date->after($endOfNextMonth)) {
                             $date->setDay($endOfNextMonth->getDay());
                             $date->setMonth($endOfNextMonth->getMonth());
                             $date->setYear($endOfNextMonth->getYear());
                         }
                     }
                 } else {
                     if ($rangeValue == 'year') {
                         $date->setYear($date->getYear() + $range);
                     } else {
                         if ($rangeValue == 'hour') {
                             $date->addSeconds($range * 3600);
                         } else {
                             if ($rangeValue == 'minute') {
                                 $date->addSeconds($range * 60);
                             } else {
                                 $date->addSeconds($range * 86400);
                             }
                         }
                     }
                 }
             } else {
                 if ($range < 0) {
                     if ($rangeValue == 'month') {
                         for ($i = 0; $i > $range; $i--) {
                             $endOfPrevMonth = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfPrevMonth($date->getDay(), $date->getMonth(), $date->getYear()));
                             $days = Calc::daysInMonth($endOfPrevMonth->getMonth(), $endOfPrevMonth->getYear());
                             $date->subtractSeconds(60 * 60 * 24 * $days);
                         }
                     } else {
                         if ($rangeValue == 'year') {
                             $date->setYear($date->getYear() - abs($range));
                         } else {
                             if ($rangeValue == 'hour') {
                                 $date->subtractSeconds(abs($range) * 3600);
                             } else {
                                 if ($rangeValue == 'minute') {
                                     $date->subtractSeconds(abs($range) * 60);
                                 } else {
                                     $date->subtractSeconds(abs($range) * 86400);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $date->subtractSeconds(1);
 }
Example #2
0
 function getMonthDaysAccordingly(&$event, $month, $year)
 {
     $byDayArray = $event->getByDay();
     $byMonthDays = $event->getByMonthDay();
     $resultDays = array();
     if (count($byDayArray) == 0) {
         $resultDays = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31);
         return $resultDays;
     }
     for ($i = 0; $i < count($byDayArray); $i++) {
         if (preg_match('/([-\\+]{0,1})?([0-9]{1})?([A-Z]{2})/', $byDayArray[$i], $byDaySplit)) {
             $dayOfWeekday = \TYPO3\CMS\Cal\Controller\Calendar::two2threeCharDays($byDaySplit[3], false);
             $monthStartTime = new \TYPO3\CMS\Cal\Model\CalDate($year . '-' . sprintf("%02d", $month) . '-01 00:00:00');
             $monthStartTime->setTZbyId('UTC');
             $monthEndTime = \TYPO3\CMS\Cal\Controller\Calendar::calculateEndMonthTime($monthStartTime);
             if ($byDaySplit[2] > 0) {
                 if ($byDaySplit[1] == '-') {
                     $monthTime = new \TYPO3\CMS\Cal\Model\CalDate(Calc::prevDayOfWeek($dayOfWeekday, $monthEndTime->getDay(), $monthEndTime->getMonth(), $monthEndTime->getYear(), '%Y%m%d', true));
                     $monthTime->setTZbyId('UTC');
                     $monthTime->subtractSeconds(($byDaySplit[2] - 1) * 604800);
                 } else {
                     $monthTime = new \TYPO3\CMS\Cal\Model\CalDate(Calc::nextDayOfWeek($dayOfWeekday, $monthStartTime->getDay(), $monthStartTime->getMonth(), $monthStartTime->getYear(), '%Y%m%d', true));
                     $monthTime->setTZbyId('UTC');
                     $monthTime->addSeconds(($byDaySplit[2] - 1) * 604800);
                 }
                 if ($monthTime->getMonth() == $month && in_array($monthTime->getDay(), $byMonthDays)) {
                     $resultDays[] = $monthTime->getDay();
                 }
             } else {
                 $monthTime = new \TYPO3\CMS\Cal\Model\CalDate(Calc::prevDayOfWeek($dayOfWeekday, $monthStartTime->getDay(), $monthStartTime->getMonth(), $monthStartTime->getYear(), '%Y%m%d', true));
                 $monthTime->setTZbyId('UTC');
                 if ($monthTime->before($monthStartTime)) {
                     $monthTime->addSeconds(604800);
                 }
                 while ($monthTime->before($monthEndTime)) {
                     $resultDays[] = $monthTime->getDay();
                     $monthTime->addSeconds(604800);
                 }
             }
         }
     }
     $resultDays = array_intersect($resultDays, $event->getByMonthDay());
     sort($resultDays);
     return $resultDays;
 }
Example #3
0
 function processObjects(&$master_array, &$sims, &$rems)
 {
     /* Subtract strtotimeOffset because we're going from GMT back to local time */
     if ($this->reverse) {
         $GLOBALS['TSFE']->register['cal_list_starttime'] = $this->endtime->getTime();
         $GLOBALS['TSFE']->register['cal_list_endtime'] = $this->starttime->getTime();
     } else {
         $GLOBALS['TSFE']->register['cal_list_starttime'] = $this->starttime->getTime();
         $GLOBALS['TSFE']->register['cal_list_endtime'] = $this->endtime->getTime();
     }
     // clear the register
     $GLOBALS['TSFE']->register['cal_list_firstevent'] = 0;
     $GLOBALS['TSFE']->register['cal_list_lastevent'] = 0;
     $GLOBALS['TSFE']->register['cal_list_events_total'] = 0;
     $GLOBALS['TSFE']->register['cal_list_eventcounter'] = 0;
     $GLOBALS['TSFE']->register['cal_list_days_total'] = 0;
     $sectionMenu = '';
     // only proceed if the master_array is not empty
     if (count($master_array)) {
         $this->count = 0;
         $this->eventCounter = array();
         $this->listStartOffsetCounter = 0;
         $this->listStartOffset = intval($this->conf['view.']['list.']['listStartOffset']);
         if ($this->conf['view.']['list.']['pageBrowser.']['usePageBrowser']) {
             $this->offset = intval($this->controller->piVars[$this->pointerName]);
             $this->recordsPerPage = intval($this->conf['view.']['list.']['pageBrowser.']['recordsPerPage']);
         }
         $this->walkThroughMasterArray($master_array, $this->reverse, $firstEventDate);
         if ($firstEventDate) {
             $GLOBALS['TSFE']->register['cal_list_firstevent'] = $firstEventDate->getTime();
         }
         if ($this->count) {
             $GLOBALS['TSFE']->register['cal_list_events_total'] = $this->count;
             // reference the array with all event counts in the TYPO3 register for usage from within hooks or whatever
             $GLOBALS['TSFE']->register['cal_list_eventcounter'] =& $this->eventCounter;
         }
         if ($days = count($this->objectsInList)) {
             $GLOBALS['TSFE']->register['cal_list_days_total'] = $days;
         }
         // start rendering the events
         if (count($this->objectsInList) && $this->count > 0) {
             $times = array_keys($this->objectsInList);
             // preset vars
             $firstTime = true;
             $listItemCount = 0;
             $alternationCount = 0;
             $pageItemCount = $this->recordsPerPage * $this->offset;
             // don't assign these dates in one line like "$date1 = $date2 = $date3 = new CalDate()", as this will make all dates references to each other!!!
             $lastEventDay = new \TYPO3\CMS\Cal\Model\CalDate('000000001000000');
             $lastEventWeek = new \TYPO3\CMS\Cal\Model\CalDate('000000001000000');
             $lastEventMonth = new \TYPO3\CMS\Cal\Model\CalDate('000000001000000');
             $lastEventYear = new \TYPO3\CMS\Cal\Model\CalDate('000000001000000');
             $categoryGroupArray = array();
             $categoryArray = array();
             if ($this->conf['view.']['list.']['enableCategoryWrapper']) {
                 $allCategoryArray = $this->modelObj->findAllCategories('', '', $this->conf['pidList']);
                 $categoryArray = (array) $allCategoryArray['tx_cal_category'][0][0];
             }
             $calendarGroupArray = array();
             $calendarArray = array();
             if ($this->conf['view.']['list.']['enableCalendarWrapper']) {
                 $allCalendarArray = $this->modelObj->findAllCalendar('', $this->conf['pidList']);
                 $calendarArray = (array) $allCalendarArray['tx_cal_calendar'];
             }
             // prepare alternating layouts
             $alternatingLayoutConfig = $this->conf['view.']['list.']['alternatingLayoutMarkers.'];
             if (is_array($alternatingLayoutConfig) && count($alternatingLayoutConfig)) {
                 $alternatingLayouts = array();
                 $layout_keys = array_keys($alternatingLayoutConfig);
                 foreach ($layout_keys as $key) {
                     if (substr($key, strlen($key) - 1) != '.') {
                         $suffix = $this->cObj->stdWrap($alternatingLayoutConfig[$key], $alternatingLayoutConfig[$key . '.']);
                         if ($suffix) {
                             $alternatingLayouts[] = $suffix;
                         }
                     }
                 }
             } else {
                 $alternatingLayouts = array('LIST_ODD', 'LIST_EVEN');
             }
             // Hook: get hook objects for drawList
             $hookObjectsArr = \TYPO3\CMS\Cal\Utility\Functions::getHookObjectsArray('tx_cal_listview', 'drawList', 'view');
             if ($this->reverse) {
                 arsort($times);
             } else {
                 asort($times);
             }
             foreach ($times as $cal_time) {
                 $e_keys = array_keys($this->objectsInList[$cal_time]);
                 // Hook: postSort
                 if (count($hookObjectsArr)) {
                     // use referenced hook objects, so that hook objects can store variables among different hook calls internally and don't have to mess with globals or registers
                     $hookObjectKeys = array_keys($hookObjectsArr);
                     foreach ($hookObjectKeys as $hookObjKey) {
                         $hookObj =& $hookObjectsArr[$hookObjKey];
                         if (method_exists($hookObj, 'postSort')) {
                             $hookObj->postSort($this, $e_keys, $cal_time);
                         }
                     }
                 }
                 unset($calTimeObject);
                 $calTimeObject = new \TYPO3\CMS\Cal\Model\CalDate($cal_time . '000000');
                 $calTimeObject->setTZbyId('UTC');
                 $cal_day = $calTimeObject->getDay();
                 $cal_month = $calTimeObject->getMonth();
                 $cal_year = $calTimeObject->getYear();
                 $cal_week = $calTimeObject->getWeekOfYear();
                 if (count($hookObjectsArr)) {
                     $hookParams = array('cal_day' => &$cal_day, 'cal_month' => &$cal_month, 'cal_year' => &$cal_year, 'cal_week' => &$cal_week, 'alternationCount' => &$alternationCount, 'reverse' => $this->reverse);
                 }
                 if ($firstTime) {
                     $yearItemCounter = (int) $this->eventCounter['byYear'][$cal_year]['previousPages'];
                     $monthItemCounter = (int) $this->eventCounter['byYearMonth'][$cal_year][$cal_month]['previousPages'];
                     $weekItemCounter = (int) $this->eventCounter['byWeek'][$cal_week]['previousPages'];
                     $dayItemCounter = (int) $this->eventCounter['byDate'][$cal_year][$cal_month][$cal_day]['previousPages'];
                 }
                 foreach ($e_keys as $e_key) {
                     $event =& $this->objectsInList[$cal_time][$e_key];
                     if ($firstTime) {
                         $eventStart = $event->getStart();
                         $lastEventDay->copy($eventStart);
                         $lastEventMonth->copy($eventStart);
                         $lastEventWeek->copy($eventStart);
                         $lastEventYear->copy($eventStart);
                     }
                     // Hook: preInnerEventWrapper
                     if (count($hookObjectsArr)) {
                         // use referenced hook objects, so that hook objects can store variables among different hook calls internally and don't have to mess with globals or registers
                         $hookObjectKeys = array_keys($hookObjectsArr);
                         foreach ($hookObjectKeys as $hookObjKey) {
                             $hookObj =& $hookObjectsArr[$hookObjKey];
                             if (method_exists($hookObj, 'preInnerEventWrapper')) {
                                 $hookObj->preInnerEventWrapper($this, $middle, $event, $calTimeObject, $firstTime, $hookParams);
                             }
                         }
                     }
                     // yearwrapper
                     if ($this->conf['view.']['list.']['enableYearWrapper'] && ($this->hasPeriodChanged($lastEventYear->getYear(), $cal_year, $this->reverse) || $firstTime)) {
                         $this->initLocalCObject();
                         if ($this->conf['view.']['list.']['enableSectionMenu']) {
                             $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['yearSectionMenuFormat']));
                             $this->local_cObj->data['link_parameter'] = '#' . $calTimeObject->format('%Y');
                             $sectionMenu .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['sectionMenuItem'], $this->conf['view.']['list.']['sectionMenuItem.']);
                         }
                         $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['yearWrapperFormat']));
                         if (!$firstTime) {
                             $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['yearWrapperEnd'], $this->conf['view.']['list.']['yearWrapperEnd.']);
                         }
                         $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['yearWrapper'], $this->conf['view.']['list.']['yearWrapper.']);
                         $lastEventYear->copy($calTimeObject);
                         if ($this->conf['view.']['list.']['restartAlternationAfterYearWrapper']) {
                             $alternationCount = 0;
                         }
                         if (!$firstTime) {
                             $yearItemCounter = 0;
                         }
                     }
                     // monthwrapper
                     if ($this->conf['view.']['list.']['enableMonthWrapper'] && ($this->hasPeriodChanged($lastEventMonth->format('%Y%m'), $calTimeObject->format('%Y%m'), $this->reverse) || $firstTime || $this->hasPeriodChanged($lastEventMonth->getYear(), $cal_year, $this->reverse))) {
                         $this->initLocalCObject();
                         if ($this->conf['view.']['list.']['enableSectionMenu']) {
                             $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['monthSectionMenuFormat']));
                             $this->local_cObj->data['link_parameter'] = '#' . $calTimeObject->format('%Y%m');
                             $sectionMenu .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['sectionMenuItem'], $this->conf['view.']['list.']['sectionMenuItem.']);
                         }
                         $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['monthWrapperFormat']));
                         if (!$firstTime) {
                             $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['monthWrapperEnd'], $this->conf['view.']['list.']['monthWrapperEnd.']);
                         }
                         $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['monthWrapper'], $this->conf['view.']['list.']['monthWrapper.']);
                         $lastEventMonth->copy($calTimeObject);
                         if ($this->conf['view.']['list.']['restartAlternationAfterMonthWrapper']) {
                             $alternationCount = 0;
                         }
                         if (!$firstTime) {
                             $monthItemCounter = 0;
                         }
                     }
                     // weekwrapper
                     if ($this->conf['view.']['list.']['enableWeekWrapper'] && ($this->hasPeriodChanged($lastEventWeek->getWeekOfYear(), $cal_week, $this->reverse) || $firstTime || $this->hasPeriodChanged($lastEventWeek->getYear(), $cal_year, $this->reverse))) {
                         $this->initLocalCObject();
                         if ($this->conf['view.']['list.']['enableSectionMenu']) {
                             $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['weekSectionMenuFormat']));
                             $this->local_cObj->data['link_parameter'] = '#' . $calTimeObject->format('%Y%U');
                             $sectionMenu .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['sectionMenuItem'], $this->conf['view.']['list.']['sectionMenuItem.']);
                         }
                         $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['weekWrapperFormat']));
                         if (!$firstTime) {
                             $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['weekWrapperEnd'], $this->conf['view.']['list.']['weekWrapperEnd.']);
                         }
                         $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['weekWrapper'], $this->conf['view.']['list.']['weekWrapper.']);
                         $lastEventWeek->copy($calTimeObject);
                         if ($this->conf['view.']['list.']['restartAlternationAfterWeekWrapper']) {
                             $alternationCount = 0;
                         }
                         if (!$firstTime) {
                             $weekItemCounter = 0;
                         }
                     }
                     // daywrapper
                     if ($this->conf['view.']['list.']['enableDayWrapper'] && (($this->reverse ? $lastEventDay->after($calTimeObject) : $lastEventDay->before($calTimeObject)) || $firstTime || $this->hasPeriodChanged($lastEventDay->getYear(), $cal_year, $this->reverse))) {
                         $this->initLocalCObject();
                         if ($this->conf['view.']['list.']['enableSectionMenu']) {
                             $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['daySectionMenuFormat']));
                             $this->local_cObj->data['link_parameter'] = '#' . $calTimeObject->format('%Y%m%d');
                             $sectionMenu .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['sectionMenuItem'], $this->conf['view.']['list.']['sectionMenuItem.']);
                         }
                         $this->local_cObj->setCurrentVal($calTimeObject->format($this->conf['view.']['list.']['dayWrapperFormat']));
                         if (!$firstTime) {
                             $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['dayWrapperEnd'], $this->conf['view.']['list.']['dayWrapperEnd.']);
                         }
                         $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['dayWrapper'], $this->conf['view.']['list.']['dayWrapper.']);
                         $lastEventDay->copy($calTimeObject);
                         if ($this->conf['view.']['list.']['restartAlternationAfterDayWrapper']) {
                             $alternationCount = 0;
                         }
                         if (!$firstTime) {
                             $dayItemCounter = 0;
                         }
                     }
                     // Hook: postInnerEventWrapper
                     if (count($hookObjectsArr)) {
                         // use referenced hook objects, so that hook objects can store variables among different hook calls internally and don't have to mess with globals or registers
                         $hookObjectKeys = array_keys($hookObjectsArr);
                         foreach ($hookObjectKeys as $hookObjKey) {
                             $hookObj =& $hookObjectsArr[$hookObjKey];
                             if (method_exists($hookObj, 'postInnerEventWrapper')) {
                                 $hookObj->postInnerEventWrapper($this, $middle, $event, $calTimeObject, $firstTime, $hookParams);
                             }
                         }
                     }
                     $listItemCount++;
                     $monthItemCounter++;
                     $weekItemCounter++;
                     $dayItemCounter++;
                     $yearItemCounter++;
                     $totalListCount = $listItemCount + $pageItemCount;
                     $GLOBALS['TSFE']->register['cal_event_list_num'] = $listItemCount;
                     $GLOBALS['TSFE']->register['cal_event_list_num_total'] = $totalListCount;
                     $GLOBALS['TSFE']->register['cal_event_list_num_in_day'] = $dayItemCounter;
                     $GLOBALS['TSFE']->register['cal_event_list_num_in_week'] = $weekItemCounter;
                     $GLOBALS['TSFE']->register['cal_event_list_num_in_month'] = $monthItemCounter;
                     $GLOBALS['TSFE']->register['cal_event_list_num_in_year'] = $yearItemCounter;
                     $layoutNum = $alternationCount % count($alternatingLayouts);
                     $layoutSuffix = $alternatingLayouts[$layoutNum];
                     $eventText = '';
                     if ($this->conf['view'] == 'location' || $this->conf['view'] == 'organizer' || $this->conf['view'] == 'event') {
                         $eventText = $event->renderEventForList(strtoupper($this->conf['view']) . '_' . $layoutSuffix);
                     } else {
                         $eventText = $event->renderEventForList($layoutSuffix);
                     }
                     $allowFurtherGrouping = true;
                     // Hook: prepareOuterEventWrapper
                     if (count($hookObjectsArr)) {
                         // use referenced hook objects, so that hook objects can store variables among different hook calls internally and don't have to mess with globals or registers
                         $hookObjectKeys = array_keys($hookObjectsArr);
                         foreach ($hookObjectKeys as $hookObjKey) {
                             $hookObj =& $hookObjectsArr[$hookObjKey];
                             if (method_exists($hookObj, 'prepareOuterEventWrapper')) {
                                 $hookObj->prepareOuterEventWrapper($this, $middle, $event, $calTimeObject, $firstTime, $hookParams, $allowFurtherGrouping);
                             }
                         }
                     }
                     if ($allowFurtherGrouping) {
                         if ($this->conf['view.']['list.']['enableCategoryWrapper']) {
                             $ids = $event->getCategoryUidsAsArray();
                             if (empty($ids)) {
                                 $categoryGroupArray[$this->conf['view.']['list.']['noCategoryWrapper.']['uid']] .= $eventText;
                             } else {
                                 $rememberUid = array();
                                 foreach ($categoryArray as $categoryObject) {
                                     if (!in_array($categoryObject->getUid(), $rememberUid)) {
                                         if (in_array($categoryObject->getUid(), $ids)) {
                                             $categoryGroupArray[$categoryObject->getUid()] .= $eventText;
                                         }
                                         $rememberUid[] = $categoryObject->getUid();
                                     }
                                 }
                             }
                         } else {
                             if ($this->conf['view.']['list.']['enableCalendarWrapper']) {
                                 $id = $event->getCalendarUid();
                                 foreach ($calendarArray as $calendarObject) {
                                     if ($calendarObject->getUid() == $id) {
                                         $calendarGroupArray[$calendarObject->getTitle()] .= $eventText;
                                     }
                                 }
                             } else {
                                 $middle .= $eventText;
                             }
                         }
                     }
                     $alternationCount++;
                     $firstTime = false;
                 }
             }
             $allowFurtherGrouping = true;
             // Hook: applyOuterEventWrapper
             if (count($hookObjectsArr)) {
                 // use referenced hook objects, so that hook objects can store variables among different hook calls internally and don't have to mess with globals or registers
                 $hookObjectKeys = array_keys($hookObjectsArr);
                 foreach ($hookObjectKeys as $hookObjKey) {
                     $hookObj =& $hookObjectsArr[$hookObjKey];
                     if (method_exists($hookObj, 'applyOuterEventWrapper')) {
                         $hookObj->applyOuterEventWrapper($this, $middle, $event, $allowFurtherGrouping);
                     }
                 }
             }
             if ($allowFurtherGrouping) {
                 // additional Wrapper
                 if ($this->conf['view.']['list.']['enableCalendarWrapper']) {
                     $this->initLocalCObject();
                     foreach ($calendarGroupArray as $calTitel => $calendarEntries) {
                         $this->local_cObj->setCurrentVal($calTitel);
                         $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['calendarWrapper'], $this->conf['view.']['list.']['calendarWrapper.']);
                         $middle .= $calendarEntries;
                     }
                 }
                 if ($this->conf['view.']['list.']['enableCategoryWrapper']) {
                     $keys = array_keys($categoryGroupArray);
                     sort($keys);
                     foreach ($keys as $categoryId) {
                         if ($categoryId == $this->conf['view.']['list.']['noCategoryWrapper.']['uid']) {
                             $this->initLocalCObject();
                             $middle .= $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['noCategoryWrapper'], $this->conf['view.']['list.']['noCategoryWrapper.']);
                         } else {
                             $currentCategory =& $categoryArray[$categoryId];
                             $this->initLocalCObject($currentCategory->getValuesAsArray());
                             $this->local_cObj->setCurrentVal($currentCategory->getTitle());
                             $text = $this->local_cObj->cObjGetSingle($this->conf['view.']['list.']['categoryWrapper.']['10'], $this->conf['view.']['list.']['categoryWrapper.']['10.']);
                             $middle .= str_replace('###CATEGORY_STYLE###', $currentCategory->getHeaderStyle(), $text);
                         }
                         $middle .= $categoryGroupArray[$categoryId];
                     }
                 }
             }
         }
     }
     return $middle;
 }
Example #4
0
 /**
  * 
  * @param string $dateObject
  * @return \TYPO3\CMS\Cal\Model\CalDate
  */
 public static function calculateEndMonthTime($dateObject = '')
 {
     $timeObj = Calendar::calculateStartDayTime($dateObject);
     $timeObj = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfNextMonth($timeObj->getDay(), $timeObj->getMonth(), $timeObj->getYear()));
     $timeObj->setDay(1);
     $timeObj->subtractSeconds(1);
     $timeObj->setTZbyId('UTC');
     return $timeObj;
 }