]> git.datanom.net - webcal.git/blob - navigate/show_week.php
Initial upload
[webcal.git] / navigate / show_week.php
1 <?php
2 /* $Id$ */
3 require_once 'config.inc.php';
4 require_once 'user_validate.php';
5 require_once 'helper.php';
6
7 valid_user();
8
9 if (! defined($_SESSION['__ROOT__']) && empty($_SESSION['__ROOT__'])) {
10 session_destroy();
11 header('Location: ' . WEB_ROOT . 'error.html');
12 exit;
13 }
14
15 if (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;
27 if ($pwd[strlen($pwd)-1] == '/')
28 $pwd = substr($pwd, 0, -1);
29
30 include TOP_FOLDER.'/include/header.inc.php';
31 include TOP_FOLDER.'/include/menu.inc.php';
32 include 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
36 if (isset($_GET['year']) && isset($_GET['week'])) {
37 $calendar = $week->getView($_GET['year'], $_GET['week']);
38 }
39 else {
40 $calendar = $week->getView();
41 }
42 print "<div id=\"ui\">$calendar</div>";
43 include TOP_FOLDER.'/include/footer.inc.php';
44
45 ?>
This page took 0.06276 seconds and 6 git commands to generate.