Source for file calendar-defs.php

Documentation is available at calendar-defs.php

  1. <?php
  2. /* ******************************************************************** */
  3. /* CATALYST PHP Source Code */
  4. /* -------------------------------------------------------------------- */
  5. /* This program is free software; you can redistribute it and/or modify */
  6. /* it under the terms of the GNU General Public License as published by */
  7. /* the Free Software Foundation; either version 2 of the License, or */
  8. /* (at your option) any later version. */
  9. /* */
  10. /* This program is distributed in the hope that it will be useful, */
  11. /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
  12. /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
  13. /* GNU General Public License for more details. */
  14. /* */
  15. /* You should have received a copy of the GNU General Public License */
  16. /* along with this program; if not, write to: */
  17. /* The Free Software Foundation, Inc., 59 Temple Place, Suite 330, */
  18. /* Boston, MA 02111-1307 USA */
  19. /* -------------------------------------------------------------------- */
  20. /* */
  21. /* Filename: calendar-defs.php */
  22. /* Author: Paul Waite */
  23. /* Description: Definitions for a calendar 'widget' */
  24. /* */
  25. /* ******************************************************************** */
  26. /** @package datetime *//**
  27. * Calendar
  28. * We define a class called 'Calendar' which renders a nice-looking
  29. * graphical calendar 'widget' in the page and allows the user to click
  30. * on dates and submit them to choose a date and 'do' something which
  31. * is application-specific. The class contains various properties and
  32. * methods to allow the user to find the current date that the calendar
  33. * is set to, and acquire this date as a timestamp, nicely-formatted
  34. * string or a DB-compliant value.
  35. * @package datetime
  36. */
  37. class Calendar extends RenderableObject {
  38. var $initDD = 1; // Initial day-date 1-31
  39. var $initMM = 1; // Initial month 1-12
  40. var $initYY = 1970; // Initial year in YYYY format
  41. var $DD; // Current day-date 1-31
  42. var $MM; // Current month 1-12
  43. var $YY; // Current year in YYYY format
  44. var $dayname; // Current day name
  45. var $daysinmonth; // Days in current month
  46. var $posturl = ""; // URL to POST the form to
  47. var $render_form = true; // Whether to render as form elements
  48. var $render_subform = false; // Whether to render elements as sub-form
  49. var $days_clickable = true; // Whether days are rendered clickable or not
  50. var $formname = "fm_calendar"; // Form name to use
  51.  
  52.  
  53. var $days = 7;
  54. var $weeks = 6;
  55. var $months = 12;
  56. var $startyear = 1970;
  57. var $endyear = 9999;
  58.  
  59. // ....................................................................
  60. /** Constructor. Create a new Calendar object with optional centre
  61. * date (defaults to 'today'). This date is the one we return to when
  62. * the 'today' button is clicked on the calendar & is the starting point.
  63. * @param mixed $today Today's date, either int timestamp or date string
  64. */
  65. function Calendar($today="") {
  66. global $RESPONSE;
  67. $this->posturl = $RESPONSE->requested;
  68.  
  69. // Set initial 'todays' date..
  70. $this->set_today($today);
  71.  
  72. // Do our normal processing..
  73. $this->POSTprocess();
  74.  
  75. // Set default year limits. We do this after the POST processing
  76. // so that our default limits don't mess up the settings..
  77. $this->set_year_limits($this->initYY - 5, $this->initYY + 5);
  78. } // Calendar
  79. // ....................................................................
  80. /** Set the 'today' date for the calendar. This is the date that is
  81. * reset to when the user clicks on the 'TODAY' button. Of course it
  82. * defaults to the current date when the calendar object is created,
  83. * but this method allows for customised 'today' settings.
  84. * NB: If you call this with no paramters, it sets it to 'today'
  85. * @param mixed $today Today's date, either int timestamp or date string
  86. */
  87. function set_today($today="") {
  88. // Set initial date..
  89. $init_ts = time();
  90. if ($today !== "") {
  91. if (is_integer($today)) {
  92. $init_ts = $today;
  93. }
  94. elseif (is_string($today)) {
  95. $init_ts = strtotime($today);
  96. }
  97. }
  98. $this->initDD = date("j", $init_ts);
  99. $this->initMM = date("m", $init_ts);
  100. $this->initYY = date("Y", $init_ts);
  101. } // set_today
  102. // ....................................................................
  103. /** Set the starting and finishing year for the calendar - the range
  104. * of operation. This defaults to +/-10 years around the current year.
  105. * @param integer $startyear Starting year for calendar (>= 1970)
  106. * @param integer $endyear Ending year for calendar
  107. */
  108. function set_year_limits($startyear, $endyear) {
  109. $this->startyear = $startyear;
  110. if ($startyear < 1970) {
  111. $this->startyear = 1970;
  112. }
  113. if ($endyear >= $startyear) {
  114. $this->endyear = $endyear;
  115. }
  116. else {
  117. $endyear = $startyear;
  118. }
  119. } // set_year_limits
  120. // ....................................................................
  121. /** Set the URL of script to POST the calendar form to.
  122. * @param string $posturl URL to post the calendar to.
  123. */
  124. function post_to($posturl) {
  125. $this->posturl = $posturl;
  126. } // post_to
  127. // ....................................................................
  128. /** Render calendar dates (the individual days) as clickable. This will
  129. * cause a form submit, with the details of the date clicked on and the
  130. * calendar will be set to that date.
  131. * @param boolean $mode If true, then render days as clickable links
  132. */
  133. function render_days_clickable($mode=true) {
  134. $this->days_clickable = $mode;
  135. } // render_days_clickable
  136. // ....................................................................
  137. /** Set the calendar to be rendered in its own form. If your calendar
  138. * sits in an existing form, then call this method with 'false' to
  139. * prevent it rendering its own form.
  140. * @param boolean $mode If true, then render form, else just the calendar.
  141. */
  142. function render_in_form($mode=true) {
  143. $this->render_form = $mode;
  144. } // render_in_form
  145. // ....................................................................
  146. /** Set the calendar to be rendered in a sub-form. This is just the same
  147. * as rendering in a form, except we miss off the form tags.
  148. * @param boolean $mode If true, then render as a sub-form.
  149. */
  150. function render_as_subform($mode=true) {
  151. if ($mode == true) {
  152. $this->render_in_form(true);
  153. }
  154. $this->render_subform = $mode;
  155. } // render_in_form
  156. // ....................................................................
  157. /** Process GET/POST from form.
  158. * The form works in a GET mode, therefore new date settings are as if
  159. * passed in on the URL. This method processes these, and sets the
  160. * internal calendar date values accordingly.
  161. */
  162. function POSTprocess() {
  163. global $calDD, $calMM, $calYY;
  164. global $calDD_current, $calMM_current, $calYY_current;
  165. global $calReset, $calReset_x;
  166.  
  167. // Report present settings..
  168. if (isset($calYY_current)) {
  169. debugbr("calendar: Pre-POSTprocess current year: $calYY_current", DBG_DEBUG);
  170. }
  171. if (isset($calMM_current)) {
  172. debugbr("calendar: Pre-POSTprocess current month: $calMM_current", DBG_DEBUG);
  173. }
  174. if (isset($calDD_current)) {
  175. debugbr("calendar: Pre-POSTprocess current day: $calDD_current", DBG_DEBUG);
  176. }
  177.  
  178. // RESET TO TODAY
  179. if ( isset($calReset) || isset($calReset_x) ) {
  180. $this->DD = $this->initDD;
  181. $this->MM = $this->initMM;
  182. $this->YY = $this->initYY;
  183. debugbr("calendar: Today click (reset): YY=$this->YY MM=$this->MM DD=$this->DD", DBG_DEBUG);
  184. }
  185. // GET/POST PROCESSING
  186. else {
  187. for ( $i = 1; $i <= $this->days * $this->weeks; $i++ ) {
  188. global ${"calDD" . trim($i) . "_x"};
  189. if ( isset(${"calDD" . trim($i) . "_x"}) ) {
  190. $this->DD = $i;
  191. debugbr("calendar: day click: $this->DD", DBG_DEBUG);
  192. }
  193. } // for
  194.  
  195. for ( $i = 0; $i <= $this->months + 1; $i++ ) {
  196. global ${"calMM" . trim($i) . "_x"};
  197. if ( isset(${"calMM" . trim($i) . "_x"}) ) {
  198. $this->MM = $i;
  199. debugbr("calendar: Prev/Next month click: $this->MM", DBG_DEBUG);
  200. }
  201. } // for
  202.  
  203. // Assign values..
  204. // YEAR
  205. if (!isset($this->YY)) {
  206. if (isset($calYY)) {
  207. $this->YY = $calYY;
  208. debugbr("calendar: Year set from dropdown menu: $this->YY", DBG_DEBUG);
  209. }
  210. elseif (isset($calYY_current)) {
  211. $this->YY = $calYY_current;
  212. debugbr("calendar: Year set from current value: $this->YY", DBG_DEBUG);
  213. }
  214. else {
  215. $this->YY = $this->initYY;
  216. debugbr("calendar: Year fall-back to default/today: $this->YY", DBG_DEBUG);
  217. }
  218. }
  219. // MONTH
  220. if (!isset($this->MM)) {
  221. if (isset($calMM)) {
  222. $this->MM = $calMM;
  223. debugbr("calendar: Month set from dropdown menu: $this->MM", DBG_DEBUG);
  224. }
  225. elseif (isset($calMM_current)) {
  226. $this->MM = $calMM_current;
  227. debugbr("calendar: Month set to current value: $this->MM", DBG_DEBUG);
  228. }
  229. else {
  230. $this->MM = $this->initMM;
  231. debugbr("calendar: Month fall-back to default/today: $this->MM", DBG_DEBUG);
  232. }
  233. }
  234. // DAY
  235. if (!isset($this->DD)) {
  236. if (isset($calDD)) {
  237. $this->DD = $calDD;
  238. debugbr("calendar: Day set from dropdown menu: $this->DD", DBG_DEBUG);
  239. }
  240. elseif (isset($calDD_current)) {
  241. $this->DD = $calDD_current;
  242. debugbr("calendar: Day set from current value: $this->DD", DBG_DEBUG);
  243. }
  244. else {
  245. $this->DD = $this->initDD;
  246. debugbr("calendar: Day fall-back to default/today: $this->DD", DBG_DEBUG);
  247. }
  248. }
  249. } // GET/POST processing
  250.  
  251. // BOUNDARY & SANITY CHECKING
  252. if ( $this->MM <= 0 ) {
  253. if ($this->YY > $this->startyear) {
  254. $this->MM += 12;
  255. $this->YY -= 1;
  256. debugbr("calendar: Crossed year boundary moving backwards: Month now: $this->MM, Year now: $this->YY", DBG_DEBUG);
  257. }
  258. else {
  259. $this->MM = 1;
  260. debugbr("calendar: Attempt to go back earlier than start year: Month now: $this->MM, Year stays as: $this->YY", DBG_DEBUG);
  261. }
  262. }
  263.  
  264. if ( $this->MM > 12 ) {
  265. if ($this->YY < $this->endyear) {
  266. $this->MM -= 12;
  267. $this->YY += 1;
  268. debugbr("calendar: Crossed year boundary moving forwards: Month now: $this->MM, Year now: $this->YY", DBG_DEBUG);
  269. }
  270. else {
  271. $this->MM = 12;
  272. debugbr("calendar: Attempt to go forward beyond end year: Month now: $this->MM, Year stays as: $this->YY", DBG_DEBUG);
  273. }
  274. }
  275.  
  276. // DAY NAME
  277. $this->dayname = date("l", $this->get_timestamp());
  278. debugbr("calendar: day name set to $this->dayname", DBG_DEBUG);
  279.  
  280. // Set the days in this month using Php to check for leaps..
  281. $this->daysinmonth = 0;
  282. for ($i=28; $i < 32; $i++) {
  283. if ( checkdate($this->MM, $i, $this->YY) ) {
  284. $this->daysinmonth = $i;
  285. }
  286. else break;
  287. }
  288. debugbr("calendar: days in month set to $this->daysinmonth", DBG_DEBUG);
  289.  
  290. // END-OF-MONTH BOUNDARY CHECK
  291. if ($this->DD > $this->daysinmonth) {
  292. debugbr("calendar: attempt to set days > day in month ($this->DD, day set to $this->daysinmonth", DBG_DEBUG);
  293. $this->DD = $this->daysinmonth;
  294. }
  295.  
  296. // Final summary of what it got set to..
  297. if (debugging()) {
  298. debugbr("calendar: POSTprocess final date setting (ISO): " . $this->get_displaydate("Y-m-d"), DBG_DEBUG);
  299. }
  300.  
  301. } // POSTprocess
  302. // ....................................................................
  303. /** Return the current calendar date as a timestamp. This will return
  304. * the timestamp at 00:00:00 (hh:mm:ss) ie. at the beginning of that day.
  305. * @return integer Return current calendar date as a timestamp.
  306. */
  307. function get_timestamp() {
  308. return mktime(0, 0, 0, $this->MM, $this->DD, $this->YY);
  309. } // get_timsetamp
  310. // ....................................................................
  311. /** Return the currently stored calendar date as a string in a given
  312. * date format (see Axyl datetime-defs.php for pre-defined formats).
  313. * The format is comprised of format characters as per the standard
  314. * Php function 'date()' (see Php manual entry).
  315. * @return string The current calendar date as a formatted date string.
  316. */
  317. function get_displaydate($displayformat) {
  318. return timestamp_to_displaydate($displayformat, $this->get_timestamp());
  319. } // get_displaydate
  320. // ....................................................................
  321. /** Return the currently stored calendar date as a string which will
  322. * be formatted so as to go into a database field nicely. This normally
  323. * means ISO format (YYYY-MM-DD).
  324. * @return string The current calendar date in DB-compatible format.
  325. */
  326. function get_DB_datetime() {
  327. return timestamp_to_datetime($this->get_timestamp());
  328. } // get_DB_datetime
  329. // ....................................................................
  330. /** Return the currently stored day-date as a two-digit string
  331. * @return string Set date in '99' format
  332. */
  333. function get_DDstr() {
  334. return sprintf("%02d", $this->DD);
  335. }
  336. // ....................................................................
  337. /** Return the currently stored month as a two-digit string
  338. * @return string Set month in '99' format
  339. */
  340. function get_MMstr() {
  341. return sprintf("%02d", $this->MM);
  342. }
  343. // ....................................................................
  344. /** Return the currently stored year as a two-digit string
  345. * @return string Set year in '9999' format
  346. */
  347. function get_YYstr() {
  348. return sprintf("%04d", $this->YY);
  349. }
  350. // ....................................................................
  351. /** Check that currently stored Month, Day and Year make a correct
  352. * date. Returns true if so.
  353. * @return boolean True if current date is valid
  354. */
  355. function is_valid() {
  356. return ( checkdate($this->MM, $this->DD, $this->YY) );
  357. } // is_valid
  358. // ....................................................................
  359. /**
  360. * Return the calendar HTML
  361. * @return string The calendar HTML.
  362. */
  363. function html() {
  364. global $RESPONSE, $LIBDIR;
  365.  
  366. // -- Build the array of the day of the month
  367.  
  368. // Calculate the Day of the Week offset for the 1st of the month
  369. $offset = date("w", mktime(0,0,0, $this->MM, 1, $this->YY));
  370.  
  371. // Build a Day of the Month array for later display
  372. $dom = Array();
  373. for ( $i = 1; $i <= $offset; $i++ ) {
  374. $dom[$i] = 0;
  375. }
  376.  
  377. for ( $i = 1; $i <= $this->days * $this->weeks; $i++ ) {
  378. if ( checkdate($this->MM, $i, $this->YY) ) {
  379. $dom[$i + $offset] = $i;
  380. }
  381. else {
  382. $dom[$i + $offset] = 0;
  383. }
  384. }
  385.  
  386. // -- Now actually draw the calendar
  387. $s = "";
  388. if ( $this->render_form ) {
  389. if (!$this->render_subform) {
  390. $s .= "\n<form name=\"$this->formname\" action=\"$this->posturl\" method=\"get\">\n";
  391. }
  392. $s .= "\n<input type=\"hidden\" name=\"calDD_current\" value=\"$this->DD\">\n";
  393. $s .= "\n<input type=\"hidden\" name=\"calMM_current\" value=\"$this->MM\">\n";
  394. $s .= "\n<input type=\"hidden\" name=\"calYY_current\" value=\"$this->YY\">\n";
  395. }
  396.  
  397. // Adjust the post url so it ends on the right thing ...
  398. if ( ! ereg("\?", $this->posturl) ) {
  399. $this->posturl .= "?";
  400. }
  401. else {
  402. $this->posturl .= "&amp;";
  403. }
  404.  
  405. $s .= "
  406. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  407. <tr valign=\"top\">
  408. <td>
  409. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  410. <tr valign=\"top\">
  411. <td><img name=\"cal_1_1\" src=\"$LIBDIR/img/calendar/cal_1_1.gif\" width=\"64\" height=\"20\" border=\"0\"></td>
  412. <td>
  413. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  414. <tr valign=\"top\">
  415. <td><img name=\"cal_1_2\" src=\"$LIBDIR/img/calendar/cal_1_2.gif\" width=\"54\" height=\"9\" border=\"0\"></td>
  416. </tr>
  417. <tr valign=\"top\">
  418. <td>";
  419.  
  420. if ( $this->render_form ) {
  421. $s .= "<input type=\"image\" src=\"$LIBDIR/img/calendar/cal_1_4.gif\" width=\"54\" height=\"11\" border=\"0\" ";
  422. $s .= " name=\"calReset\" title=\"Reset to 'today'\" alt=\"\">";
  423. } else {
  424. $s .= "<a href=\"" . $this->posturl . "calReset=\">";
  425. $s .= "<img src=\"$LIBDIR/img/calendar/cal_1_4.gif\" width=\"54\" height=\"11\" border=\"0\" title=\"Reset date\">";
  426. $s .= "</a>";
  427. }
  428.  
  429. $s .= "</td>
  430. </tr>
  431. </table>
  432. </td>
  433. <td><img name=\"cal_1_3\" src=\"$LIBDIR/img/calendar/cal_1_3.gif\" width=\"126\" height=\"20\" border=\"0\"></td>
  434. </tr>
  435. </table>
  436. </td>
  437. </tr>
  438. <tr valign=\"top\">
  439. <td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  440. <tr valign=\"top\">
  441. <td><img name=\"calendar_2\" src=\"$LIBDIR/img/calendar/calendar_2.jpg\" width=\"16\" height=\"256\" border=\"0\"></td>
  442. <td><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  443. <tr valign=\"top\">
  444. <td width=\"212\" height=\"46\" background=\"$LIBDIR/img/calendar/calendar_3.jpg\" valign=\"middle\">";
  445.  
  446. if ( $this->render_form ) {
  447. $s .= " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">
  448. <tr align=\"left\" valign=\"middle\">
  449. <td>&nbsp;&nbsp;<select name=\"calMM\" onchange='javascript:document.$this->formname.submit();'>";
  450.  
  451. for ( $m = 1; $m <= 12; $m++ ) {
  452. $selected = ( $this->MM == $m ) ? " selected" : "";
  453. $s .= "<option value=\"$m\"$selected>" . date("F", mktime(0,0,0,$m,1,2000)) . "</option>\n";
  454. }
  455.  
  456. $s .= "</select>
  457. </td>
  458. <td align=right>
  459. <select name=\"calYY\" onchange='javascript:document.$this->formname.submit();'>";
  460.  
  461. for ($y = $this->startyear; $y <= $this->endyear; $y++) {
  462. $selected = ($this->YY == $y) ? " selected" : "";
  463. $s .= "<option value=\"$y\"$selected>$y</option>\n";
  464. }
  465. $s .= "</select>&nbsp;&nbsp;
  466. </td>
  467. </tr>
  468. </table>";
  469. }
  470. else {
  471. $s .= "<p style=\"font-size:x-small;letter-spacing:+0.5pt;font-family:Arial, Helvetica, sans-serif;\" align=\"center\">";
  472. $s .= date("l, jS of F Y", mktime(0,0,0,$this->MM,$this->DD,$this->YY)) . "</p>";
  473. }
  474. $s .= "</td>
  475. </tr>
  476. <tr valign=\"top\">
  477. <td><img name=\"calendar_5\" src=\"$LIBDIR/img/calendar/calendar_5.gif\" width=\"212\" height=\"14\" border=\"0\"></td>
  478. </tr>
  479. <tr valign=\"top\">
  480. <td width=\"212\" height=\"158\" background=\"$LIBDIR/img/calendar/calendar_6.jpg\" align=\"center\" valign=\"middle\">
  481. <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"150\">";
  482.  
  483. for ( $w = 0; $w < $this->weeks; $w++ ) {
  484. $s .= "<tr align=\"center\" valign=\"middle\">";
  485. for ( $dow = 1; $dow <= $this->days; $dow++ ) {
  486. $image = $dom[$dow + $this->days*$w];
  487. $s .= "<td height=\"25\" width=\"27\">";
  488. if ( $image ) {
  489. $title = date("l jS of F Y", mktime(0,0,0,$this->MM,$image,$this->YY));
  490. if ( $this->DD == $image ) {
  491. $inverted = "-inverted";
  492. }
  493. else {
  494. $inverted = "";
  495. }
  496. if ($this->days_clickable) {
  497. if ( $this->render_form ) {
  498. $s .= "<input type=\"image\" src=\"$LIBDIR/img/calendar/$image$inverted.gif\" width=\"27\" height=\"25\" border=\"0\" ";
  499. $s .= " name=\"calDD$image\" title=\"$title\">";
  500. } else {
  501. $s .= "<a href=\"" . $this->posturl . "calDD=$image&amp;calMM=$this->MM&amp;calYY=$this->YY\">";
  502. $s .= "<img src=\"$LIBDIR/img/calendar/$image$inverted.gif\" width=\"27\" height=\"25\" border=\"0\" title=\"$title\" alt=\"\">";
  503. $s .= "</a>";
  504. }
  505. }
  506. else {
  507. $s .= "<img src=\"$LIBDIR/img/calendar/$image$inverted.gif\" width=\"27\" height=\"25\" border=\"0\" title=\"$title\" alt=\"\">";
  508. }
  509. }
  510. else {
  511. $s .= "<img src=\"$LIBDIR/img/calendar/$image.gif\" width=\"27\" height=\"25\" border=\"0\">";
  512. }
  513. $s .= "</td>\n";
  514. }
  515. $s .= "</tr>\n";
  516. }
  517.  
  518. $s .= "</table>
  519. </td>
  520. </tr>
  521. <tr valign=\"top\">
  522. <td>
  523. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  524. <tr valign=\"top\">
  525. <td>
  526. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
  527. <tr valign=\"top\">
  528. <td><img name=\"cal_7_1\" src=\"$LIBDIR/img/calendar/cal_7_1.gif\" width=\"68\" height=\"10\" border=\"0\"></td>
  529. </tr>
  530. <tr valign=\"top\">
  531. <td>
  532. <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"68\">
  533. <tr valign=\"top\">
  534. <td>";
  535.  
  536. if ( $this->render_form ) {
  537. $s .= "<input type=\"image\" src=\"$LIBDIR/img/calendar/cal_7_3.gif\" width=\"8\" height=\"16\" border=\"0\" ";
  538. $s .= " name=\"calMM" . ($this->MM - 1) . "\" title=\"Previous month\">";
  539. }
  540. else {
  541. $s .= "<a href=\"" . $this->posturl . "calDD=$this->DD&amp;calMM=" . ( $this->MM - 1 ) . "&amp;calYY=$this->YY\">";
  542. $s .= "<img src=\"$LIBDIR/img/calendar/cal_7_3.gif\" width=\"8\" height=\"16\" border=\"0\" title=\"Previous month\">";
  543. $s .= "</a>";
  544. }
  545. $s .= "</td>
  546. <td><img name=\"cal_7_4\" src=\"$LIBDIR/img/calendar/cal_7_4.gif\" width=\"50\" height=\"16\" border=\"0\"></td>
  547. <td>";
  548.  
  549. if ( $this->render_form ) {
  550. $s .= "<input type=\"image\" src=\"$LIBDIR/img/calendar/cal_7_5.gif\" width=\"8\" height=\"16\" border=\"0\" ";
  551. $s .= " name=\"calMM" . ( $this->MM + 1 ) . "\" title=\"Next month\">";
  552. }
  553. else {
  554. $s .= "<a href=\"" . $this->posturl . "calDD=$this->DD&amp;calMM=" . ( $this->MM + 1 ) . "&amp;calYY=$this->YY\">";
  555. $s .= "<img src=\"$LIBDIR/img/calendar/cal_7_5.gif\" width=\"8\" height=\"16\" border=\"0\" title=\"Next month\">";
  556. $s .= "</a>";
  557. }
  558.  
  559. $s .= "</td>
  560. </tr>
  561. </table>
  562. </td>
  563. </tr>
  564. <tr valign=\"top\">
  565. <td><img name=\"cal_7_6\" src=\"$LIBDIR/img/calendar/cal_7_6.gif\" width=\"68\" height=\"12\" border=\"0\"></td>
  566. </tr>
  567. </table>
  568. </td>
  569. <td><img name=\"cal_7_2\" src=\"$LIBDIR/img/calendar/cal_7_2.gif\" width=\"144\" height=\"37\" border=\"0\"></td>
  570. </tr>
  571. </table>
  572. </td>
  573. </tr>
  574. </table></td>
  575. <td><img name=\"calendar_4\" src=\"$LIBDIR/img/calendar/calendar_4.jpg\" width=\"16\" height=\"256\" border=\"0\"></td>
  576. </tr>
  577. </table></td>
  578. </tr>
  579. </table>";
  580.  
  581. if ($this->render_form && !$this->render_subform) {
  582. $s .= "</form>\n";
  583. }
  584. return $s;
  585. } // html
  586.  
  587.  
  588.  
  589. }
  590. ?>

Documentation generated by phpDocumentor 1.3.0RC3