示例#1
0
 function replaceViewMarker($page)
 {
     $next_day = new \TYPO3\CMS\Cal\Model\CalDate();
     $next_day->copy($this->controller->getDateTimeObject);
     $next_day->addSeconds(86400);
     $prev_day = new \TYPO3\CMS\Cal\Model\CalDate();
     $prev_day->copy($this->controller->getDateTimeObject);
     $prev_day->subtractSeconds(86400);
     $next_week = new \TYPO3\CMS\Cal\Model\CalDate(Calc::beginOfNextWeek($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $prev_week = new \TYPO3\CMS\Cal\Model\CalDate(Calc::beginOfPrevWeek($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $next_year = $this->conf['year'] + 1 . sprintf("%02d", $this->conf['month']) . sprintf("%02d", $this->conf['day']);
     $prev_year = $this->conf['year'] - 1 . sprintf("%02d", $this->conf['month']) . sprintf("%02d", $this->conf['day']);
     $endOfNextMonth = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfNextMonth($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $endOfNextMonth->setDay($this->conf['day']);
     $startOfPrevMonth = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfPrevMonth($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $startOfPrevMonth->setDay($this->conf['day']);
     $next_month = $endOfNextMonth->format('%Y%m%d');
     $prev_month = $startOfPrevMonth->format('%Y%m%d');
     $startOfThisWeek = new \TYPO3\CMS\Cal\Model\CalDate(Calc::beginOfWeek($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $endOfThisWeek = new \TYPO3\CMS\Cal\Model\CalDate(Calc::endOfWeek($this->conf['day'], $this->conf['month'], $this->conf['year']));
     $GLOBALS['TSFE']->register['cal_week_starttime'] = $startOfThisWeek->getTime();
     $GLOBALS['TSFE']->register['cal_week_endtime'] = $endOfThisWeek->getTime();
     $this->initLocalCObject();
     $dayViewPid = $this->conf['view.']['day.']['dayViewPid'] ? $this->conf['view.']['day.']['dayViewPid'] : false;
     $weekViewPid = $this->conf['view.']['week.']['weekViewPid'] ? $this->conf['view.']['week.']['weekViewPid'] : false;
     $monthViewPid = $this->conf['view.']['month.']['monthViewPid'] ? $this->conf['view.']['month.']['monthViewPid'] : false;
     $yearViewPid = $this->conf['view.']['year.']['yearViewPid'] ? $this->conf['view.']['year.']['yearViewPid'] : false;
     // next day
     $nextdaylinktext = $this->cObj->getSubpart($page, '###NEXT_DAYLINKTEXT###');
     $this->local_cObj->setCurrentVal($nextdaylinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $next_day->format('%Y%m%d'), 'view' => $this->conf['view.']['dayLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $dayViewPid);
     $rems['###NEXT_DAYLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['day.']['nextDayLink'], $this->conf['view.']['day.']['nextDayLink.']);
     // prev day
     $prevdaylinktext = $this->cObj->getSubpart($page, '###PREV_DAYLINKTEXT###');
     $this->local_cObj->setCurrentVal($prevdaylinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $prev_day->format('%Y%m%d'), 'view' => $this->conf['view.']['dayLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $dayViewPid);
     $rems['###PREV_DAYLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['day.']['prevDayLink'], $this->conf['view.']['day.']['prevDayLink.']);
     // next week
     $nextweeklinktext = $this->cObj->getSubpart($page, '###NEXT_WEEKLINKTEXT###');
     $this->local_cObj->setCurrentVal($nextweeklinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $next_week->format('%Y%m%d'), 'view' => $this->conf['view.']['weekLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $weekViewPid);
     $rems['###NEXT_WEEKLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['week.']['nextWeekLink'], $this->conf['view.']['week.']['nextWeekLink.']);
     // prev week
     $prevweeklinktext = $this->cObj->getSubpart($page, '###PREV_WEEKLINKTEXT###');
     $this->local_cObj->setCurrentVal($prevweeklinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $prev_week->format('%Y%m%d'), 'view' => $this->conf['view.']['weekLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $weekViewPid);
     $rems['###PREV_WEEKLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['week.']['prevWeekLink'], $this->conf['view.']['week.']['prevWeekLink.']);
     // next month
     $nextmonthlinktext = $this->cObj->getSubpart($page, '###NEXT_MONTHLINKTEXT###');
     $this->local_cObj->setCurrentVal($nextmonthlinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $next_month, 'view' => $this->conf['view.']['monthLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $monthViewPid);
     $rems['###NEXT_MONTHLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['month.']['nextMonthLink'], $this->conf['view.']['month.']['nextMonthLink.']);
     // prev month
     $prevmonthlinktext = $this->cObj->getSubpart($page, '###PREV_MONTHLINKTEXT###');
     $this->local_cObj->setCurrentVal($prevmonthlinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $prev_month, 'view' => $this->conf['view.']['monthLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $monthViewPid);
     $rems['###PREV_MONTHLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['month.']['prevMonthLink'], $this->conf['view.']['month.']['prevMonthLink.']);
     // next year
     $nextyearlinktext = $this->cObj->getSubpart($page, '###NEXT_YEARLINKTEXT###');
     $this->local_cObj->setCurrentVal($nextyearlinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $next_year, 'view' => $this->conf['view.']['yearLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $yearViewPid);
     $rems['###NEXT_YEARLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['year.']['nextYearLink'], $this->conf['view.']['year.']['nextYearLink.']);
     // prev year
     $prevyearlinktext = $this->cObj->getSubpart($page, '###PREV_YEARLINKTEXT###');
     $this->local_cObj->setCurrentVal($prevyearlinktext);
     $this->controller->getParametersForTyposcriptLink($this->local_cObj->data, array('getdate' => $prev_year, 'view' => $this->conf['view.']['yearLinkTarget'], $this->pointerName => NULL), $this->conf['cache'], $this->conf['clear_anyway'], $yearViewPid);
     $rems['###PREV_YEARLINK###'] = $this->local_cObj->cObjGetSingle($this->conf['view.']['year.']['prevYearLink'], $this->conf['view.']['year.']['prevYearLink.']);
     $this->local_cObj->setCurrentVal($this->controller->getDateTimeObject->getTime());
     $sims['###DISPLAY_DATE###'] = $this->local_cObj->cObjGetSingle($this->conf['view.'][$this->conf['view'] . '.']['displayDate'], $this->conf['view.'][$this->conf['view'] . '.']['displayDate.']);
     $wrapped = array();
     $hookObjectsArr = \TYPO3\CMS\Cal\Utility\Functions::getHookObjectsArray('tx_cal_base_model', 'searchForObjectMarker', 'model');
     // Hook: postSearchForObjectMarker
     foreach ($hookObjectsArr as $hookObj) {
         if (method_exists($hookObj, 'postSearchForObjectMarker')) {
             $hookObj->postSearchForObjectMarker($this, $page, $sims, $rems, $wrapped, $this->conf['view']);
         }
     }
     $page = \TYPO3\CMS\Cal\Utility\Functions::substituteMarkerArrayNotCached($page, $sims, $rems, array());
     $languageArray = array('getdate' => $this->conf['getdate'], 'next_month' => $next_month, 'prev_month' => $prev_month, 'calendar_name' => $this->conf['calendarName'], 'this_year' => $this->conf['year'], 'next_year' => $next_year, 'prev_year' => $prev_year);
     return \TYPO3\CMS\Cal\Controller\Controller::replace_tags($languageArray, $page);
 }