You are here

function availability_calenders_day in Availability Calendars 7.2

Same name and namespace in other branches
  1. 6.2 availability_calendars.page.inc \availability_calenders_day()

Helper function that returns the html for 1 day.

Parameters

int $day The day number.:

object $settings settings (for the current node).:

1 call to availability_calenders_day()
theme_availability_calendars_month in ./availability_calendars.page.inc
Themes the calendar for a given month.

File

./availability_calendars.page.inc, line 211

Code

function availability_calenders_day($day, $settings) {

  // Represent whole days with 1 div, split ays woth 2 span's.
  // This allows to generate all css at once and then just switch settings
  if (!$settings->splitday) {

    // Whole day, the background and border color will take care of the coloring.
    // Border color may change on hover for "selectable" cells.
    $result = "<div>{$day}</div>";
  }
  else {

    // Split day:
    // - The border-color of the outer span will take care of the coloring.
    //    the outer span will have zero sized content and full sized borders.
    // - The inner span will contain the day number and the selectable border
    //   It will be positioned absolute, half way up and left.
    // However, to be able to position it absolute, it needs to be within another
    // positioned element, and td's cannot be positioned.
    $result = "<span><span>{$day}</span></span>";
  }
  return $result;
}