@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | define('CALENDAR_ENGINE', 'PearDate'); |
9 | 9 | |
10 | 10 | if (!@include 'Calendar/Calendar.php') { |
11 | - define('CALENDAR_ROOT','../../'); |
|
11 | + define('CALENDAR_ROOT', '../../'); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | * |
74 | 74 | * @return bool |
75 | 75 | */ |
76 | - function build($events=array()) |
|
76 | + function build($events = array()) |
|
77 | 77 | { |
78 | 78 | require_once CALENDAR_ROOT . 'Day.php'; |
79 | - require_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
79 | + require_once CALENDAR_ROOT . 'Table/Helper.php'; |
|
80 | 80 | |
81 | 81 | $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay); |
82 | 82 | $this->cE = & $this->getEngine(); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $this->month = $this->thisMonth(); |
85 | 85 | |
86 | 86 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
87 | - for ($i=1; $i<=$daysInMonth; ++$i) { |
|
88 | - $Day = new Calendar_Day(2000,1,1); // Create Day with dummy values |
|
87 | + for ($i = 1; $i <= $daysInMonth; ++$i) { |
|
88 | + $Day = new Calendar_Day(2000, 1, 1); // Create Day with dummy values |
|
89 | 89 | $Day->setTimeStamp($this->cE->dateToStamp($this->year, $this->month, $i)); |
90 | 90 | $this->children[$i] = new DiaryEvent($Day); |
91 | 91 | } |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | function setSelection($events) |
107 | 107 | { |
108 | 108 | $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month); |
109 | - for ($i=1; $i<=$daysInMonth; ++$i) { |
|
109 | + for ($i = 1; $i <= $daysInMonth; ++$i) { |
|
110 | 110 | $stamp1 = $this->cE->dateToStamp($this->year, $this->month, $i); |
111 | - $stamp2 = $this->cE->dateToStamp($this->year, $this->month, $i+1); |
|
111 | + $stamp2 = $this->cE->dateToStamp($this->year, $this->month, $i + 1); |
|
112 | 112 | foreach ($events as $event) { |
113 | 113 | if (($stamp1 >= $event['start'] && $stamp1 < $event['end']) || |
114 | 114 | ($stamp2 >= $event['start'] && $stamp2 < $event['end']) || |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | <h2>Sample Calendar Payload Decorator (using <?php echo CALENDAR_ENGINE; ?> engine)</h2> |
222 | 222 | <table class="calendar" width="98%" cellspacing="0" cellpadding="0"> |
223 | 223 | <caption> |
224 | - <?php echo $MonthDecorator->thisMonth().' / '.$MonthDecorator->thisYear(); ?> |
|
224 | + <?php echo $MonthDecorator->thisMonth() . ' / ' . $MonthDecorator->thisYear(); ?> |
|
225 | 225 | </caption> |
226 | 226 | <tr> |
227 | 227 | <th>Monday</th> |
@@ -246,14 +246,14 @@ discard block |
||
246 | 246 | echo ' calCellEmpty'; |
247 | 247 | } |
248 | 248 | echo '">'; |
249 | - echo '<div class="dayNumber">'.$Day->thisDay().'</div>'; |
|
249 | + echo '<div class="dayNumber">' . $Day->thisDay() . '</div>'; |
|
250 | 250 | |
251 | 251 | if ($Day->isEmpty()) { |
252 | 252 | echo ' '; |
253 | 253 | } else { |
254 | 254 | echo '<div class="dayContents"><ul>'; |
255 | 255 | while ($entry = $Day->getEntry()) { |
256 | - echo '<li>'.$entry['desc'].'</li>'; |
|
256 | + echo '<li>' . $entry['desc'] . '</li>'; |
|
257 | 257 | //you can print the time range as well |
258 | 258 | } |
259 | 259 | echo '</ul></div>'; |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | if (!@include 'Calendar/Calendar.php') { |
7 | 7 | define('CALENDAR_ROOT', '../../'); |
8 | 8 | } |
9 | -require_once CALENDAR_ROOT.'Day.php'; |
|
10 | -require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
11 | -require_once CALENDAR_ROOT.'Decorator/Textual.php'; |
|
9 | +require_once CALENDAR_ROOT . 'Day.php'; |
|
10 | +require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
11 | +require_once CALENDAR_ROOT . 'Decorator/Textual.php'; |
|
12 | 12 | |
13 | 13 | // Could change language like this |
14 | 14 | // setlocale (LC_TIME, "de_DE"); // Unix based (probably) |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | // Decorate |
29 | 29 | $Textual = new Calendar_Decorator_Textual($Calendar); |
30 | 30 | |
31 | -echo '<hr>Previous month is: '.$Textual->prevMonthName('two').'<br />'; |
|
32 | -echo 'This month is: '.$Textual->thisMonthName('short').'<br />'; |
|
33 | -echo 'Next month is: '.$Textual->nextMonthName().'<br /><hr />'; |
|
34 | -echo 'Previous day is: '.$Textual->prevDayName().'<br />'; |
|
35 | -echo 'This day is: '.$Textual->thisDayName('short').'<br />'; |
|
36 | -echo 'Next day is: '.$Textual->nextDayName('one').'<br /><hr />'; |
|
31 | +echo '<hr>Previous month is: ' . $Textual->prevMonthName('two') . '<br />'; |
|
32 | +echo 'This month is: ' . $Textual->thisMonthName('short') . '<br />'; |
|
33 | +echo 'Next month is: ' . $Textual->nextMonthName() . '<br /><hr />'; |
|
34 | +echo 'Previous day is: ' . $Textual->prevDayName() . '<br />'; |
|
35 | +echo 'This day is: ' . $Textual->thisDayName('short') . '<br />'; |
|
36 | +echo 'Next day is: ' . $Textual->nextDayName('one') . '<br /><hr />'; |
|
37 | 37 | |
38 | 38 | echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br />"; |
39 | 39 | $Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | ?> |
44 | 44 | <p>Rendering calendar....</p> |
45 | 45 | <table> |
46 | -<caption><?php echo $Textual->thisMonthName().' '.$Textual->thisYear(); ?></caption> |
|
46 | +<caption><?php echo $Textual->thisMonthName() . ' ' . $Textual->thisYear(); ?></caption> |
|
47 | 47 | <tr> |
48 | 48 | <?php |
49 | 49 | $dayheaders = $Textual->orderedWeekdays('short'); |
50 | 50 | foreach ($dayheaders as $dayheader) { |
51 | - echo '<th>'.$dayheader.'</th>'; |
|
51 | + echo '<th>' . $dayheader . '</th>'; |
|
52 | 52 | } |
53 | 53 | ?> |
54 | 54 | </tr> |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | if ($Day->isEmpty()) { |
62 | 62 | echo '<td> </td>'; |
63 | 63 | } else { |
64 | - echo '<td>'.$Day->thisDay().'</td>'; |
|
64 | + echo '<td>' . $Day->thisDay() . '</td>'; |
|
65 | 65 | } |
66 | 66 | if ($Day->isLast()) { |
67 | 67 | echo "</tr>\n"; |
@@ -3,13 +3,13 @@ |
||
3 | 3 | * Description: simple example on i18N |
4 | 4 | */ |
5 | 5 | if (!@include 'Calendar/Calendar.php') { |
6 | - define('CALENDAR_ROOT','../../'); |
|
6 | + define('CALENDAR_ROOT', '../../'); |
|
7 | 7 | } |
8 | -require_once CALENDAR_ROOT.'Day.php'; |
|
8 | +require_once CALENDAR_ROOT . 'Day.php'; |
|
9 | 9 | |
10 | -$Day = new Calendar_Day(2003,10,23); |
|
10 | +$Day = new Calendar_Day(2003, 10, 23); |
|
11 | 11 | |
12 | -setlocale (LC_TIME, "de_DE"); // Unix based (probably) |
|
12 | +setlocale(LC_TIME, "de_DE"); // Unix based (probably) |
|
13 | 13 | // setlocale (LC_TIME, "ge"); // Windows |
14 | 14 | |
15 | -echo ( strftime('%A %d %B %Y',$Day->getTimeStamp())); |
|
15 | +echo (strftime('%A %d %B %Y', $Day->getTimeStamp())); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | if (!@include 'Calendar/Calendar.php') { |
14 | 14 | define('CALENDAR_ROOT', '../../'); |
15 | 15 | } |
16 | -require_once CALENDAR_ROOT.'Second.php'; |
|
16 | +require_once CALENDAR_ROOT . 'Second.php'; |
|
17 | 17 | |
18 | 18 | if (!isset($_GET['y'])) $_GET['y'] = date('Y'); |
19 | 19 | if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
@@ -24,15 +24,15 @@ discard block |
||
24 | 24 | |
25 | 25 | $Unit = new Calendar_Second($_GET['y'], $_GET['m'], $_GET['d'], $_GET['h'], $_GET['i'], $_GET['s']); |
26 | 26 | |
27 | -echo '<p><b>Result:</b> '.$Unit->thisYear().'-'.$Unit->thisMonth().'-'.$Unit->thisDay(). |
|
28 | - ' '.$Unit->thisHour().':'.$Unit->thisMinute().':'.$Unit->thisSecond(); |
|
27 | +echo '<p><b>Result:</b> ' . $Unit->thisYear() . '-' . $Unit->thisMonth() . '-' . $Unit->thisDay() . |
|
28 | + ' ' . $Unit->thisHour() . ':' . $Unit->thisMinute() . ':' . $Unit->thisSecond(); |
|
29 | 29 | if ($Unit->isValid()) { |
30 | 30 | echo ' is valid!</p>'; |
31 | 31 | } else { |
32 | - $V= & $Unit->getValidator(); |
|
32 | + $V = & $Unit->getValidator(); |
|
33 | 33 | echo ' is invalid:</p>'; |
34 | 34 | while ($error = $V->fetch()) { |
35 | - echo $error->toString() .'<br />'; |
|
35 | + echo $error->toString() . '<br />'; |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | ?> |
@@ -48,4 +48,4 @@ discard block |
||
48 | 48 | </form> |
49 | 49 | <p><b>Note:</b> Error messages can be controlled with the constants <code>CALENDAR_VALUE_TOOSMALL</code> and <code>CALENDAR_VALUE_TOOLARGE</code> - see <code>Calendar_Validator.php</code></p> |
50 | 50 | |
51 | -<?php echo '<p><b>Took: '.(getmicrotime()-$start).' seconds</b></p>'; |
|
51 | +<?php echo '<p><b>Took: ' . (getmicrotime() - $start) . ' seconds</b></p>'; |
@@ -4,11 +4,11 @@ discard block |
||
4 | 4 | * to make it available when iterating over calendar children |
5 | 5 | */ |
6 | 6 | if (!@include 'Calendar/Calendar.php') { |
7 | - define('CALENDAR_ROOT','../../'); |
|
7 | + define('CALENDAR_ROOT', '../../'); |
|
8 | 8 | } |
9 | -require_once CALENDAR_ROOT.'Day.php'; |
|
10 | -require_once CALENDAR_ROOT.'Hour.php'; |
|
11 | -require_once CALENDAR_ROOT.'Decorator.php'; |
|
9 | +require_once CALENDAR_ROOT . 'Day.php'; |
|
10 | +require_once CALENDAR_ROOT . 'Hour.php'; |
|
11 | +require_once CALENDAR_ROOT . 'Decorator.php'; |
|
12 | 12 | |
13 | 13 | // Decorator to "attach" functionality to selected hours |
14 | 14 | /** |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | // Create a day to view the hours for |
43 | -$Day = new Calendar_Day(2003,10,24); |
|
43 | +$Day = new Calendar_Day(2003, 10, 24); |
|
44 | 44 | |
45 | 45 | // A sample query to get the data for today (NOT ACTUALLY USED HERE) |
46 | 46 | $sql = " |
@@ -49,15 +49,15 @@ discard block |
||
49 | 49 | FROM |
50 | 50 | diary |
51 | 51 | WHERE |
52 | - eventtime >= '".$Day->thisDay(TRUE)."' |
|
52 | + eventtime >= '".$Day->thisDay(TRUE) . "' |
|
53 | 53 | AND |
54 | - eventtime < '".$Day->nextDay(TRUE)."';"; |
|
54 | + eventtime < '".$Day->nextDay(TRUE) . "';"; |
|
55 | 55 | |
56 | 56 | // An array simulating data from a database |
57 | -$result = array ( |
|
58 | - array('eventtime'=>mktime(9,0,0,10,24,2003),'entry'=>'Meeting with sales team'), |
|
59 | - array('eventtime'=>mktime(11,0,0,10,24,2003),'entry'=>'Conference call with Widget Inc.'), |
|
60 | - array('eventtime'=>mktime(15,0,0,10,24,2003),'entry'=>'Presentation to board of directors') |
|
57 | +$result = array( |
|
58 | + array('eventtime'=>mktime(9, 0, 0, 10, 24, 2003), 'entry'=>'Meeting with sales team'), |
|
59 | + array('eventtime'=>mktime(11, 0, 0, 10, 24, 2003), 'entry'=>'Conference call with Widget Inc.'), |
|
60 | + array('eventtime'=>mktime(15, 0, 0, 10, 24, 2003), 'entry'=>'Presentation to board of directors') |
|
61 | 61 | ); |
62 | 62 | |
63 | 63 | // An array to place selected hours in |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | // Loop through the "database result" |
67 | 67 | foreach ($result as $row) { |
68 | - $Hour = new Calendar_Hour(2000,1,1,1); // Create Hour with dummy values |
|
68 | + $Hour = new Calendar_Hour(2000, 1, 1, 1); // Create Hour with dummy values |
|
69 | 69 | $Hour->setTimeStamp($row['eventtime']); // Set the real time with setTimeStamp |
70 | 70 | |
71 | 71 | // Create the decorator, passing it the Hour |
@@ -89,36 +89,36 @@ discard block |
||
89 | 89 | <body> |
90 | 90 | <h1>Passing a Selection "Payload" using a Decorator</h1> |
91 | 91 | <table> |
92 | -<caption><b>Your Schedule for <?php echo ( date('D nS F Y',$Day->thisDay(TRUE)) ); ?></b></caption> |
|
92 | +<caption><b>Your Schedule for <?php echo (date('D nS F Y', $Day->thisDay(TRUE))); ?></b></caption> |
|
93 | 93 | <tr> |
94 | 94 | <th width="5%">Time</th> |
95 | 95 | <th>Entry</th> |
96 | 96 | </tr> |
97 | 97 | <?php |
98 | -while ( $Hour = & $Day->fetch() ) { |
|
98 | +while ($Hour = & $Day->fetch()) { |
|
99 | 99 | |
100 | 100 | $hour = $Hour->thisHour(); |
101 | 101 | $minute = $Hour->thisMinute(); |
102 | 102 | |
103 | 103 | // Office hours only... |
104 | 104 | if ($hour >= 8 && $hour <= 18) { |
105 | - echo ( "<tr>\n" ); |
|
106 | - echo ( "<td>$hour:$minute</td>\n" ); |
|
105 | + echo ("<tr>\n"); |
|
106 | + echo ("<td>$hour:$minute</td>\n"); |
|
107 | 107 | |
108 | 108 | // If the hour is selected, call the decorator method... |
109 | - if ( $Hour->isSelected() ) { |
|
110 | - echo ( "<td bgcolor=\"silver\">".$Hour->getEntry()."</td>\n" ); |
|
109 | + if ($Hour->isSelected()) { |
|
110 | + echo ("<td bgcolor=\"silver\">" . $Hour->getEntry() . "</td>\n"); |
|
111 | 111 | } else { |
112 | - echo ( "<td> </td>\n" ); |
|
112 | + echo ("<td> </td>\n"); |
|
113 | 113 | } |
114 | - echo ( "</tr>\n" ); |
|
114 | + echo ("</tr>\n"); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | ?> |
118 | 118 | </table> |
119 | 119 | <p>The query to fetch this data, with help from PEAR::Calendar, might be;</p> |
120 | 120 | <pre> |
121 | -<?php echo ( $sql ); ?> |
|
121 | +<?php echo ($sql); ?> |
|
122 | 122 | </pre> |
123 | 123 | </body> |
124 | 124 | </html> |
@@ -7,10 +7,10 @@ discard block |
||
7 | 7 | * format the month while the days are accessed via the normal Month object |
8 | 8 | */ |
9 | 9 | if (!@include 'Calendar/Calendar.php') { |
10 | - define('CALENDAR_ROOT','../../'); |
|
10 | + define('CALENDAR_ROOT', '../../'); |
|
11 | 11 | } |
12 | -require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
13 | -require_once CALENDAR_ROOT.'Decorator.php'; |
|
12 | +require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
13 | +require_once CALENDAR_ROOT . 'Decorator.php'; |
|
14 | 14 | |
15 | 15 | // Decorate a Month with methods to improve formatting |
16 | 16 | /** |
@@ -32,8 +32,8 @@ discard block |
||
32 | 32 | { |
33 | 33 | $prevStamp = parent::prevMonth(TRUE); |
34 | 34 | // Build the URL for the previous month |
35 | - return $_SERVER['PHP_SELF'].'?y='.date('Y',$prevStamp). |
|
36 | - '&m='.date('n',$prevStamp).'&d='.date('j',$prevStamp); |
|
35 | + return $_SERVER['PHP_SELF'] . '?y=' . date('Y', $prevStamp) . |
|
36 | + '&m=' . date('n', $prevStamp) . '&d=' . date('j', $prevStamp); |
|
37 | 37 | } |
38 | 38 | /** |
39 | 39 | * Override the thisMonth method to format the output |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $thisStamp = parent::thisMonth(TRUE); |
44 | 44 | // A human readable string from this month |
45 | - return date('F Y',$thisStamp); |
|
45 | + return date('F Y', $thisStamp); |
|
46 | 46 | } |
47 | 47 | /** |
48 | 48 | * Override the nextMonth method to format the output |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | { |
52 | 52 | $nextStamp = parent::nextMonth(TRUE); |
53 | 53 | // Build the URL for next month |
54 | - return $_SERVER['PHP_SELF'].'?y='.date('Y',$nextStamp). |
|
55 | - '&m='.date('n',$nextStamp).'&d='.date('j',$nextStamp); |
|
54 | + return $_SERVER['PHP_SELF'] . '?y=' . date('Y', $nextStamp) . |
|
55 | + '&m=' . date('n', $nextStamp) . '&d=' . date('j', $nextStamp); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | if (!isset($_GET['m'])) $_GET['m'] = date('n'); |
61 | 61 | |
62 | 62 | // Creata a month as usual |
63 | -$Month = new Calendar_Month_Weekdays($_GET['y'],$_GET['m']); |
|
63 | +$Month = new Calendar_Month_Weekdays($_GET['y'], $_GET['m']); |
|
64 | 64 | |
65 | 65 | // Pass it to the decorator and use the decorator from now on... |
66 | 66 | $MonthDecorator = new MonthDecorator($Month); |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | <body> |
76 | 76 | <h1>A Simple Decorator</h1> |
77 | 77 | <table> |
78 | -<caption><?php echo ( $MonthDecorator->thisMonth() ); ?></caption> |
|
78 | +<caption><?php echo ($MonthDecorator->thisMonth()); ?></caption> |
|
79 | 79 | <?php |
80 | -while ( $Day = $MonthDecorator->fetch() ) { |
|
81 | - if ( $Day->isFirst() ) { |
|
82 | - echo ( "\n<tr>\n" ); |
|
80 | +while ($Day = $MonthDecorator->fetch()) { |
|
81 | + if ($Day->isFirst()) { |
|
82 | + echo ("\n<tr>\n"); |
|
83 | 83 | } |
84 | - if ( $Day->isEmpty() ) { |
|
85 | - echo ( "<td> </td>" ); |
|
84 | + if ($Day->isEmpty()) { |
|
85 | + echo ("<td> </td>"); |
|
86 | 86 | } else { |
87 | - echo ( "<td>".$Day->thisDay()."</td>" ); |
|
87 | + echo ("<td>" . $Day->thisDay() . "</td>"); |
|
88 | 88 | } |
89 | - if ( $Day->isLast() ) { |
|
90 | - echo ( "\n</tr>\n" ); |
|
89 | + if ($Day->isLast()) { |
|
90 | + echo ("\n</tr>\n"); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | ?> |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | array('in' => array('year' => 'int', 'month'=>'int'), |
25 | 25 | 'out' => array('month' => '{urn:PEAR_SOAP_Calendar}Month'), |
26 | 26 | ); |
27 | - $this->__typedef['Month'] = array ( |
|
27 | + $this->__typedef['Month'] = array( |
|
28 | 28 | 'monthname' => 'string', |
29 | 29 | 'days' => '{urn:PEAR_SOAP_Calendar}MonthDays' |
30 | 30 | ); |
31 | - $this->__typedef['MonthDays'] = array (array ('{urn:PEAR_SOAP_Calendar}Day')); |
|
32 | - $this->__typedef['Day'] = array ( |
|
31 | + $this->__typedef['MonthDays'] = array(array('{urn:PEAR_SOAP_Calendar}Day')); |
|
32 | + $this->__typedef['Day'] = array( |
|
33 | 33 | 'isFirst' => 'int', |
34 | 34 | 'isLast' => 'int', |
35 | 35 | 'isEmpty' => 'int', |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | */ |
58 | 58 | function getMonth($year, $month) |
59 | 59 | { |
60 | - require_once(CALENDAR_ROOT.'Month/Weekdays.php'); |
|
61 | - $Month = new Calendar_Month_Weekdays($year,$month); |
|
60 | + require_once(CALENDAR_ROOT . 'Month/Weekdays.php'); |
|
61 | + $Month = new Calendar_Month_Weekdays($year, $month); |
|
62 | 62 | if (!$Month->isValid()) { |
63 | 63 | $V = & $Month->getValidator(); |
64 | 64 | $errorMsg = ''; |
65 | 65 | while ($error = $V->fetch()) { |
66 | - $errorMsg .= $error->toString()."\n"; |
|
66 | + $errorMsg .= $error->toString() . "\n"; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return new SOAP_Fault($errorMsg, 'Client'); |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | $calendar = new Calendar_Server(); |
92 | 92 | $server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar'); |
93 | 93 | |
94 | -if (strtoupper($_SERVER['REQUEST_METHOD'])=='POST') { |
|
94 | +if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') { |
|
95 | 95 | $server->service($GLOBALS['HTTP_RAW_POST_DATA']); |
96 | 96 | } else { |
97 | 97 | require_once 'SOAP/Disco.php'; |
98 | 98 | $disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar"); |
99 | 99 | if (isset($_SERVER['QUERY_STRING']) && |
100 | - strcasecmp($_SERVER['QUERY_STRING'], 'wsdl')==0) { |
|
100 | + strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) { |
|
101 | 101 | header("Content-type: text/xml"); |
102 | 102 | echo $disco->getWSDL(); |
103 | 103 | } else { |
@@ -6,9 +6,9 @@ discard block |
||
6 | 6 | if (!@include 'Calendar/Calendar.php') { |
7 | 7 | define('CALENDAR_ROOT', '../../'); |
8 | 8 | } |
9 | -require_once CALENDAR_ROOT.'Day.php'; |
|
10 | -require_once CALENDAR_ROOT.'Month/Weekdays.php'; |
|
11 | -require_once CALENDAR_ROOT.'Util/Textual.php'; |
|
9 | +require_once CALENDAR_ROOT . 'Day.php'; |
|
10 | +require_once CALENDAR_ROOT . 'Month/Weekdays.php'; |
|
11 | +require_once CALENDAR_ROOT . 'Util/Textual.php'; |
|
12 | 12 | |
13 | 13 | // Could change language like this |
14 | 14 | // setlocale (LC_TIME, "de_DE"); // Unix based (probably) |
@@ -25,12 +25,12 @@ discard block |
||
25 | 25 | echo "<hr>Creating: new Calendar_Day(date('Y'), date('n'), date('d'));<br />"; |
26 | 26 | $Calendar = new Calendar_Day(date('Y'), date('n'), date('d')); |
27 | 27 | |
28 | -echo '<hr>Previous month is: '.Calendar_Util_Textual::prevMonthName($Calendar,'two').'<br />'; |
|
29 | -echo 'This month is: '.Calendar_Util_Textual::thisMonthName($Calendar,'short').'<br />'; |
|
30 | -echo 'Next month is: '.Calendar_Util_Textual::nextMonthName($Calendar).'<br /><hr />'; |
|
31 | -echo 'Previous day is: '.Calendar_Util_Textual::prevDayName($Calendar).'<br />'; |
|
32 | -echo 'This day is: '.Calendar_Util_Textual::thisDayName($Calendar,'short').'<br />'; |
|
33 | -echo 'Next day is: '.Calendar_Util_Textual::nextDayName($Calendar,'one').'<br /><hr />'; |
|
28 | +echo '<hr>Previous month is: ' . Calendar_Util_Textual::prevMonthName($Calendar, 'two') . '<br />'; |
|
29 | +echo 'This month is: ' . Calendar_Util_Textual::thisMonthName($Calendar, 'short') . '<br />'; |
|
30 | +echo 'Next month is: ' . Calendar_Util_Textual::nextMonthName($Calendar) . '<br /><hr />'; |
|
31 | +echo 'Previous day is: ' . Calendar_Util_Textual::prevDayName($Calendar) . '<br />'; |
|
32 | +echo 'This day is: ' . Calendar_Util_Textual::thisDayName($Calendar, 'short') . '<br />'; |
|
33 | +echo 'Next day is: ' . Calendar_Util_Textual::nextDayName($Calendar, 'one') . '<br /><hr />'; |
|
34 | 34 | |
35 | 35 | echo "Creating: new Calendar_Month_Weekdays(date('Y'), date('n'), 6); - Saturday is first day of week<br />"; |
36 | 36 | $Calendar = new Calendar_Month_Weekdays(date('Y'), date('n'), 6); |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | ?> |
39 | 39 | <p>Rendering calendar....</p> |
40 | 40 | <table> |
41 | -<caption><?php echo Calendar_Util_Textual::thisMonthName($Calendar).' '.$Calendar->thisYear(); ?></caption> |
|
41 | +<caption><?php echo Calendar_Util_Textual::thisMonthName($Calendar) . ' ' . $Calendar->thisYear(); ?></caption> |
|
42 | 42 | <tr> |
43 | 43 | <?php |
44 | -$dayheaders = Calendar_Util_Textual::orderedWeekdays($Calendar,'short'); |
|
44 | +$dayheaders = Calendar_Util_Textual::orderedWeekdays($Calendar, 'short'); |
|
45 | 45 | foreach ($dayheaders as $dayheader) { |
46 | - echo '<th>'.$dayheader.'</th>'; |
|
46 | + echo '<th>' . $dayheader . '</th>'; |
|
47 | 47 | } |
48 | 48 | ?> |
49 | 49 | </tr> |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if ($Day->isEmpty()) { |
57 | 57 | echo '<td> </td>'; |
58 | 58 | } else { |
59 | - echo '<td>'.$Day->thisDay().'</td>'; |
|
59 | + echo '<td>' . $Day->thisDay() . '</td>'; |
|
60 | 60 | } |
61 | 61 | if ($Day->isLast()) { |
62 | 62 | echo "</tr>\n"; |
@@ -4,21 +4,21 @@ discard block |
||
4 | 4 | */ |
5 | 5 | function getmicrotime() |
6 | 6 | { |
7 | - list($usec, $sec) = explode(" ",microtime()); |
|
7 | + list($usec, $sec) = explode(" ", microtime()); |
|
8 | 8 | |
9 | 9 | return ((float) $usec + (float) $sec); |
10 | 10 | } |
11 | 11 | $start = getmicrotime(); |
12 | 12 | |
13 | 13 | if (!@include 'Calendar/Calendar.php') { |
14 | - define('CALENDAR_ROOT','../../'); |
|
14 | + define('CALENDAR_ROOT', '../../'); |
|
15 | 15 | } |
16 | 16 | |
17 | -require_once CALENDAR_ROOT.'Year.php'; |
|
17 | +require_once CALENDAR_ROOT . 'Year.php'; |
|
18 | 18 | |
19 | -define('CALENDAR_MONTH_STATE',CALENDAR_USE_MONTH_WEEKDAYS); |
|
19 | +define('CALENDAR_MONTH_STATE', CALENDAR_USE_MONTH_WEEKDAYS); |
|
20 | 20 | |
21 | -if ( !isset($_GET['year']) ) $_GET['year'] = date('Y'); |
|
21 | +if (!isset($_GET['year'])) $_GET['year'] = date('Y'); |
|
22 | 22 | |
23 | 23 | $Year = new Calendar_Year($_GET['year']); |
24 | 24 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
28 | 28 | <html> |
29 | 29 | <head> |
30 | -<title> <?php echo ( $Year->thisYear() ); ?> </title> |
|
30 | +<title> <?php echo ($Year->thisYear()); ?> </title> |
|
31 | 31 | <style type="text/css"> |
32 | 32 | body { |
33 | 33 | font-family: Georgia, serif; |
@@ -64,55 +64,55 @@ discard block |
||
64 | 64 | <body> |
65 | 65 | <table> |
66 | 66 | <caption class="year"> |
67 | -<?php echo ( $Year->thisYear() ); ?> |
|
67 | +<?php echo ($Year->thisYear()); ?> |
|
68 | 68 | <div id="next"> |
69 | -<a href="?year=<?php echo ( $Year->nextYear() ); ?>">>></a> |
|
69 | +<a href="?year=<?php echo ($Year->nextYear()); ?>">>></a> |
|
70 | 70 | </div> |
71 | 71 | <div id="prev"> |
72 | -<a href="?year=<?php echo ( $Year->prevYear() ); ?>"><<</a> |
|
72 | +<a href="?year=<?php echo ($Year->prevYear()); ?>"><<</a> |
|
73 | 73 | </div> |
74 | 74 | </caption> |
75 | 75 | <?php |
76 | 76 | $i = 0; |
77 | -while ( $Month = $Year->fetch() ) { |
|
77 | +while ($Month = $Year->fetch()) { |
|
78 | 78 | |
79 | 79 | switch ($i) { |
80 | 80 | case 0: |
81 | - echo ( "<tr>\n" ); |
|
81 | + echo ("<tr>\n"); |
|
82 | 82 | break; |
83 | 83 | case 3: |
84 | 84 | case 6: |
85 | 85 | case 9: |
86 | - echo ( "</tr>\n<tr>\n" ); |
|
86 | + echo ("</tr>\n<tr>\n"); |
|
87 | 87 | break; |
88 | 88 | case 12: |
89 | - echo ( "</tr>\n" ); |
|
89 | + echo ("</tr>\n"); |
|
90 | 90 | break; |
91 | 91 | } |
92 | 92 | |
93 | - echo ( "<td>\n<table class=\"month\">\n" ); |
|
94 | - echo ( "<caption class=\"month\">".date('F',$Month->thisMonth(TRUE))."</caption>" ); |
|
95 | - echo ( "<tr>\n<th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>" ); |
|
93 | + echo ("<td>\n<table class=\"month\">\n"); |
|
94 | + echo ("<caption class=\"month\">" . date('F', $Month->thisMonth(TRUE)) . "</caption>"); |
|
95 | + echo ("<tr>\n<th>M</th><th>T</th><th>W</th><th>T</th><th>F</th><th>S</th><th>S</th>\n</tr>"); |
|
96 | 96 | $Month->build(); |
97 | - while ( $Day = $Month->fetch() ) { |
|
98 | - if ( $Day->isFirst() ) { |
|
99 | - echo ( "<tr>\n" ); |
|
97 | + while ($Day = $Month->fetch()) { |
|
98 | + if ($Day->isFirst()) { |
|
99 | + echo ("<tr>\n"); |
|
100 | 100 | } |
101 | - if ( $Day->isEmpty() ) { |
|
102 | - echo ( "<td> </td>\n" ); |
|
101 | + if ($Day->isEmpty()) { |
|
102 | + echo ("<td> </td>\n"); |
|
103 | 103 | } else { |
104 | - echo ( "<td>".$Day->thisDay()."</td>\n" ); |
|
104 | + echo ("<td>" . $Day->thisDay() . "</td>\n"); |
|
105 | 105 | } |
106 | - if ( $Day->isLast() ) { |
|
107 | - echo ( "</tr>\n" ); |
|
106 | + if ($Day->isLast()) { |
|
107 | + echo ("</tr>\n"); |
|
108 | 108 | } |
109 | 109 | } |
110 | - echo ( "</table>\n</td>\n" ); |
|
110 | + echo ("</table>\n</td>\n"); |
|
111 | 111 | |
112 | 112 | ++$i; |
113 | 113 | } |
114 | 114 | ?> |
115 | 115 | </table> |
116 | -<p>Took: <?php echo ((getmicrotime()-$start)); ?></p> |
|
116 | +<p>Took: <?php echo ((getmicrotime() - $start)); ?></p> |
|
117 | 117 | </body> |
118 | 118 | </html> |