10.02.2013 Views

PHP Programming Language - OpenLibra

PHP Programming Language - OpenLibra

PHP Programming Language - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Active Calendar 3<br />

• Using <strong>PHP</strong> native date functions: 1902 - 2037 (UNIX) and 1971 - 2037 (Windows)<br />

• Using ADOdb Date Library: 100 - 3000 and later [limited by the computation time of adodb_mktime()] on both<br />

UNIX and Windows. To use the ADOdb Date Library just include it in your scripts. The Active Calendar class<br />

will use the library functions automatically.<br />

Usage<br />

Basic methods overview<br />

$cal = new activeCalendar([$year,$month,$day,$gmt_zone]);<br />

Create first a new object of the class. The parameters $year, $month and $day are optional. If these parameters are<br />

not set, the current year, month and day will be passed to the program. The parameter $year should have the form<br />

"yyyy" e.g. "2005" or "1996", the parameter $month should have the form "m" e.g. "1" for January or "10" for<br />

October and the parameter $day should have the form "d" e.g. "4" for the 4th month day or "24" for the 24th<br />

month day. So for the date e.g. 7 January 2005 please set $cal = new activeCalendar("2005","1","7"). The<br />

parameter $gmt_zone is optional as well. Use this parameter to set the GMT (Greenwich Mean Time) zone for the<br />

current date calculation (e.g. 9 for Osaka Japan, 2 for Athens Greece, - 5 for New York USA). If $gmt_zone is not<br />

set, the server local time will be used.<br />

$cal->enableMonthNav([$link,$arrowBack,$arrowForw]);<br />

Call this method, if you want the generated calendar to have month navigation controls (e.g. "previous month"<br />

and "next month"). The parameter $link is optional. You can use this parameter to set the URL for the calendar<br />

links (e.g. "mycalendar.php" or "mycalendar.php?mode=4&item=test", if you need more complex urls). You<br />

should modify the private method mkUrl(), if you want to change the general structure of the generated links. The<br />

parameters $arrowBack and $arrowForw are optional as well: they set other month navigation controls, than the<br />

ones set in the configuration (an image link can be set too).<br />

$cal->enableYearNav([$link,$arrowBack,$arrowForw]);<br />

Call this method, if you want the generated calendar to have year navigation controls (e.g. "previous year" and<br />

"next year"). The parameter $link is optional. You can use this parameter to set the URL for the calendar links<br />

(e.g. "mycalendar.php" or "mycalendar.php?mode=4&item=test", if you need more complex urls). You should<br />

modify the private method mkUrl(), if you want to change the general structure of the generated links. The<br />

parameters $arrowBack and $arrowForw are optional as well: they set other year navigation controls, than the<br />

ones set in the configuration (an image link can be set too).<br />

$cal->enableDatePicker([$startYear,$endYear,$link,$button]);<br />

Call this method, if you want the generated month calendar to have a date picker control. The parameters<br />

$startYear and $endYear define the range of the years, that can be selected (e.g. $startYear=2000,<br />

$endYear=2010). This range is limited by the private class variables $startYear and $endYear. Please modify<br />

them according to your configuration. The parameter $link is optional. You can use this parameter to set the URL<br />

for the calendar links (e.g. "mycalendar.php" or "mycalendar.php?mode=4&item=test", if you need more complex<br />

urls). You should modify the private method mkUrl(), if you want to change the general structure of the generated<br />

links. The parameter $button is optional as well: it sets some other value for the date picker submit button, than<br />

the one set in the configuration.<br />

$cal->enableDayLinks([$link,$javaScript]);

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!