]> git.datanom.net - webcal.git/blame - navigate/show_week.php
Initial upload
[webcal.git] / navigate / show_week.php
CommitLineData
a5eae6b7
MR
1<?php
2/* $Id$ */
3require_once 'config.inc.php';
4require_once 'user_validate.php';
5require_once 'helper.php';
6
7valid_user();
8
9if (! defined($_SESSION['__ROOT__']) && empty($_SESSION['__ROOT__'])) {
10 session_destroy();
11 header('Location: ' . WEB_ROOT . 'error.html');
12 exit;
13}
14
15if (isset($_SESSION['authenticate']) && $_SESSION['authenticate']->validUser()) {
16 $view_style = ($_SESSION['user_settings']->getViewStyle()) ?
17 $_SESSION['user_settings']->getViewStyle() : VIEW_STYLE;
18 $week_start_sunday = ($_SESSION['user_settings']->getStartWeek() !== NULL) ?
19 $_SESSION['user_settings']->getStartWeek() : WEEK_START_SUNDAY;
20 $start_hour = ($_SESSION['user_settings']->getStartHour() != NULL) ?
21 (int) $_SESSION['user_settings']->getStartHour() : START_HOUR;
22 $end_hour = ($_SESSION['user_settings']->getEndHour() != NULL) ?
23 (int) $_SESSION['user_settings']->getEndHour() : END_HOUR;
24}
25
26$pwd = WEB_ROOT;
27if ($pwd[strlen($pwd)-1] == '/')
28 $pwd = substr($pwd, 0, -1);
29
30include TOP_FOLDER.'/include/header.inc.php';
31include TOP_FOLDER.'/include/menu.inc.php';
32include TOP_FOLDER.'/templates/view.class.php';
33$pageView = new PageView($pwd, $start_hour, $end_hour, $week_start_sunday);
34$week = $pageView->createView(PageView::WEEK);
35
36if (isset($_GET['year']) && isset($_GET['week'])) {
37 $calendar = $week->getView($_GET['year'], $_GET['week']);
38}
39else {
40 $calendar = $week->getView();
41}
42print "<div id=\"ui\">$calendar</div>";
43include TOP_FOLDER.'/include/footer.inc.php';
44
45?>
This page took 0.031873 seconds and 5 git commands to generate.