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

Documentation generated by phpDocumentor 1.3.0RC3