You are here

function _timefield_weekly_summary_build_header in Timefield 7

Same name and namespace in other branches
  1. 1.0.x timefield.module \_timefield_weekly_summary_build_header()

Build a header for a schedule table

2 calls to _timefield_weekly_summary_build_header()
TimefieldPluginStyleMinical::render in views/timefield_plugin_style_minical.inc
Renders views
timefield_field_formatter_view in ./timefield.module
Implements hook_field_formatter_view().

File

./timefield.module, line 1329
Defines a Field API field for time

Code

function _timefield_weekly_summary_build_header($first_day) {
  $days = _timefield_weekly_summary_days();
  $day_list = $days;
  $header = array(
    'time' => t('Time'),
  );
  $found_header = FALSE;
  foreach ($days as $index => $day) {
    if ($index == $first_day) {
      $found_header = TRUE;
    }
    if ($found_header) {
      $header[$index] = $day;
      unset($day_list[$index]);
    }
  }
  $header += $day_list;
  return $header;
}