public function render(array $appData, $templateName, \Core\Application $app, \Core\Registry $registry) { $cur_per = $app->getCurrentPeriod(); $period_now = $cur_per->format('F Y'); $first_day = (new \DateTime())->setDate($cur_per->format('Y'), $cur_per->format('n'), 1); $next_per = (new \DateTime())->setTimeStamp($first_day->getTimestamp()); $next_per->add(new \DateInterval('P1M')); $prev_per = (new \DateTime())->setTimeStamp($first_day->getTimestamp()); $prev_per->sub(new \DateInterval('P1M')); return (new \Utility\Template())->parse($templateName, array('period_navigator_now' => $period_now, 'period_left_link' => $registry->get(REG_SITE_ROOT) . BROWSE_URL . "?year=" . $prev_per->format('Y') . "&month=" . $prev_per->format('n'), 'period_right_link' => $registry->get(REG_SITE_ROOT) . BROWSE_URL . "?year=" . $next_per->format('Y') . "&month=" . $next_per->format('n'))); }
private function setBrowseTime(\Core\Application $app, \Core\Http $http) { $cp = $app->getCurrentPeriod(); $cp_year = $cp->format('Y'); $cp_month = $cp->format('n'); if (isset($http->get()['year'])) { $cp_year = $http->get()['year']; } if (isset($http->get()['month'])) { $cp_month = $http->get()['month']; } $app->setCurrentPeriod((new \DateTime())->setDate($cp_year, $cp_month, 1)); }
public function render(array $appData, $templateName, \Core\Registry $registry, \Core\Application $app, \Core\Database $db, \DBMappers\AppointmentItem $appMapper) { $schedule = $this->getAppointmentCalendar($app->getCurrentPeriod(), $appData['browse_room_item'], $db, $appMapper); return (new \Utility\Template())->parse($templateName, array('browse_calendar' => $schedule, 'browse_first_day' => $app->getFirstDay(), 'browse_hour_mode' => $app->getHourMode(), 'browse_period' => $app->getCurrentPeriod(), 'site_root' => $registry->get(REG_SITE_ROOT))); }