source: branches/version-2/data/module/Calendar/docs/examples/16.phps @ 17143

Revision 17143, 1.0 KB checked in by adachi, 16 years ago (diff)

calendar bloc by Yammy (merge r17073, r17076, r17087, r17091)

Line 
1<?php
2/**
3* Description: demonstrates using the Uri decorator
4*/
5if (!@include 'Calendar/Calendar.php') {
6    define('CALENDAR_ROOT', '../../');
7}
8require_once CALENDAR_ROOT.'Month/Weekdays.php';
9require_once CALENDAR_ROOT.'Decorator/Uri.php';
10
11if (!isset($_GET['jahr'])) $_GET['jahr'] = date('Y');
12if (!isset($_GET['monat'])) $_GET['monat'] = date('m');
13
14// Build the month
15$Calendar = new Calendar_Month_Weekdays($_GET['jahr'], $_GET['monat']);
16
17echo ( '<p>The current month is '
18        .$Calendar->thisMonth().' of year '.$Calendar->thisYear().'</p>');
19
20$Uri = & new Calendar_Decorator_Uri($Calendar);
21$Uri->setFragments('jahr','monat');
22// $Uri->setSeperator('/'); // Default is &
23// $Uri->setScalar(); // Omit variable names
24echo ( "<pre>Previous Uri:\t".$Uri->prev('month')."\n" );
25echo ( "This Uri:\t".$Uri->this('month')."\n" );
26echo ( "Next Uri:\t".$Uri->next('month')."\n</pre>" );
27?>
28<p>
29<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->prev('month'));?>">Prev</a> :
30<a href="<?php echo($_SERVER['PHP_SELF'].'?'.$Uri->next('month'));?>">Next</a>
31</p>
Note: See TracBrowser for help on using the repository browser.