[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/station/schedule/ -> station_schedule.pages.inc (source)

   1  <?php
   2  // $Id: station_schedule.pages.inc,v 1.10 2010/09/13 18:54:05 timplunkett Exp $
   3  
   4  /**
   5   * Redirect the visitor to the schedule's current day view.
   6   */
   7  function station_schedule_goto_today($schedule) {
   8    drupal_goto('node/'. $schedule->nid .'/view/'. drupal_strtolower(station_day_name(date('w'))));
   9  }
  10  
  11  function theme_station_schedule_hour($hour) {
  12    $class = 'station-sch-box station-sch-hour';
  13    $height = 80;
  14    //$output = "<div class='{$class}'>";
  15    $output = "<div class='{$class}' style='height:{$height}px;'>";
  16    $output .= theme('station_hour', $hour * 60);
  17    $output .= "</div>\n";
  18    return $output;
  19  }
  20  
  21  function theme_station_schedule_spacer($start, $finish) {
  22    $class = 'station-sch-box station-sch-unscheduled';
  23    $height = ($finish - $start);
  24    $output = "<div class='{$class}' style='height:{$height}px;'>";
  25    $output .= "<span class='station-sch-time'>". theme('station_hour_range', $start, $finish) ."</span>";
  26    $output .= "</div>\n";
  27    return $output;
  28  }
  29  
  30  function theme_station_schedule_item($start, $finish, $program) {
  31    $class = 'station-sch-box station-sch-scheduled';
  32    $height = 80*(($finish - $start)/60);
  33    $link = url('node/'. $program->nid);
  34    $time = theme('station_hour_range', $start, $finish);
  35  
  36    $output = "<div class='{$class}'><a href='{$link}' style='height: {$height}px;' title='{$time}'>";
  37    $output .= "<span class='station-sch-time'>{$time}</span>";
  38    $output .= '<span class="station-sch-title">'. check_plain($program->title) .'</span>';
  39    if (!empty($program->field_station_program_dj)) {
  40      $djs = array();
  41      foreach ($program->field_station_program_dj as $entry) {
  42        $user = user_load($entry);
  43        $djs[] .= $user->name;
  44      }
  45      $output .= '<span class="station-sch-djs">'. check_plain(implode(', ', $djs)) .'</span>';
  46    }
  47    $output .= "</a></div>\n";
  48    return $output;
  49  }
  50  
  51  /**
  52   * Print a day's schedule page.
  53   */
  54  function station_schedule_day_page($node, $day) {
  55    if ($view = views_get_view('station_schedule_day')) {
  56      $display_id = 'default';
  57      if ($view->access($display_id)) {
  58        return $view->execute_display($display_id, array($node->nid, $day));
  59      }
  60      $view->destroy();
  61    }
  62    return drupal_not_found();
  63  }
  64  


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7