function theme_availability_calendars_node in Availability Calendars 6
Same name and namespace in other branches
- 5 availability_calendars.module \theme_availability_calendars_node()
- 6.2 availability_calendars.page.inc \theme_availability_calendars_node()
- 7.2 availability_calendars.page.inc \theme_availability_calendars_node()
Themed output to display a list of node dates.
stodisplay
Parameters
object $node:
int $year:
int $month:
Return value
string
3 theme calls to theme_availability_calendars_node()
- availability_calendars_menu_callback in ./
availability_calendars.module - Create tab to show node availability.
- availability_calendars_nodeapi in ./
availability_calendars.module - Implementation hook node_nodeapi().
- availability_calendars_page in ./
availability_calendars.module - Availability calendars page.
File
- ./
availability_calendars.module, line 427 - Availability Calendars Module.
Code
function theme_availability_calendars_node($node, $year = 2008, $month = 01, $monthstodisplay = 12) {
$rows = array();
$settings = availability_calendar_getsettings('node', $node->nid);
// Calendar code based on example at http://evolt.org/node/60673 :
$day = 1;
$output = '';
// Create our key for the availability calendar if the node has it set to do so
if ($settings->showkey === 1) {
$output .= availability_calendars_key();
}
$monthsremaining = $monthstodisplay;
while ($monthsremaining > 0) {
$output .= theme('availability_calendars_month', $node, $year, $month, $settings);
$monthsremaining--;
$month++;
if ($month > 12) {
$month = 1;
$year++;
}
}
// add an extra three months for editors only
if (availability_can_edit($node->nid)) {
$monthsremaining = 3;
while ($monthsremaining > 0) {
$output .= theme('availability_calendars_month', $node, $year, $month, $settings);
$monthsremaining--;
$month++;
if ($month > 12) {
$month = 1;
$year++;
}
}
}
return $output;
}