10.02.2013 Views

PHP Programming Language - OpenLibra

PHP Programming Language - OpenLibra

PHP Programming Language - OpenLibra

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Active Calendar 4<br />

Call this method, if you want the generated calendar to have linkable dates. The parameter $link is optional. You<br />

can use this parameter to set the URL for the calendar links (e.g. "mycalendar.php" or<br />

"mycalendar.php?mode=4&item=test", if you need more complex urls). You should modify the private method<br />

mkUrl(), if you want to change the general structure of the generated links. The parameter $javaScript is optional<br />

as well. You can use this parameter to set a JavaScript function instead of a URL for the calendar links. So if you<br />

set $cal->enableDayLinks(false,"selectDate"), this link will be created on e.g. 27 May 2007:<br />

..href="javascript:selectDate(2007,5,27)".. The content of the Javascript function 'selectDate' will not be created<br />

by the class. You should develop it according to your needs.<br />

$cal->setMonthNames($monthNamesArray);<br />

Call this method, if you want the class generate different names for the calendar months, than the ones set in the<br />

configuration. The parameter $monthNamesArray must be an array of 12 month names starting with January.<br />

$cal->setDayNames($dayNamesArray);<br />

Call this method, if you want the class generate different names for the calendar weekdays, than the ones set in<br />

the configuration. The parameter $dayNamesArray must be an array of 7 day names starting with Sunday.<br />

$cal->setEvent($year,$month,$day,[$id,$eventUrl]);<br />

Call this method, if you want the class to create an HTML td class=$id on the date specified by the parameters<br />

$year, $month, $day. You can configure every 'event date' in your CSS, so that it would have e.g. a different<br />

background color. The parameter $id is optional. If you do not set an $id, a default HTML class='event' will be<br />

generated. The parameter $eventUrl is optional as well: If you set an $eventUrl, an event specific link<br />

(..href='$eventUrl'..) will be generated on the 'event date', even if the method $cal->enableDayLinks($link) was<br />

not called.<br />

$cal->setEventContent($year,$month,$day,$content,[$contentUrl,$id]);<br />

Call this method, if you want the class to create a new HTML table within the date specified by the parameters<br />

$year, $month, $day. The parameter $content can be a string or an array. If $content is a string, then the new<br />

generated table will contain one row with the value of $content. If it is an array, the generated table will contain<br />

as many rows as the array length and each row will contain the value of each array item. The parameter<br />

$contentUrl is optional: If you set a $contentUrl, an event content specific link (..href='$contentUrl'..) will be<br />

generated in the 'event content' table row(s), even if the method $cal->enableDayLinks($link) was not called. The<br />

parameter $id is optional as well: if you set an $id, an HTML class='$id' will be generated for each event content<br />

(default: 'eventcontent').<br />

$cal->showMonth([$showNoMonthDays]);<br />

This method will generate the HTML string of the month calendar. You can display the calendar by "print<br />

$cal->showMonth()". This method calls several private class functions, that create each tr tag of the generated<br />

table. So if you would like to change the table structure, you could simply modifiy the order, that these private<br />

functions are called (mkMonthHead() must remain first and mkMonthFoot() must remain last though). The<br />

parameter $showNoMonthDays is optional: if it is set true, days that do not belong to the current month will be<br />

displayed in the calendar (default: false). Please note that these days will not contain any events or event<br />

contents!.<br />

$cal->showYear([$columns]);<br />

This method will generate the HTML string of the year calendar. You can display the calendar by "print<br />

$cal->showYear()". This method calls several private class functions, that create each tr tag of the generated table.

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

Saved successfully!

Ooh no, something went wrong!