You are here

function event_calendar_status in Event Calendar 7

Callback function events status, If event is expired then return a custom status as 'expired'.

1 call to event_calendar_status()
event_admin_events in ./event_calendar.list.inc
Form builder: Builds the event administration overview.
5 string references to 'event_calendar_status'
admin_event_calendar_colors_settings in event_calendar_colors/event_calendar_colors.module
Form custructor for set color.
event_calendar.module in ./event_calendar.module
The module file that allows events to be created and required admin approval.
event_calendar_tokens in ./event_calendar.tokens.inc
Implements hook_tokens().
_event_calendar_installed_fields in ./event_calendar.install
Callback to define fields.
_event_calendar_installed_instances in ./event_calendar.install
Callback to define instances of fields.

File

./event_calendar.list.inc, line 152
Event administration UI.

Code

function event_calendar_status($node) {

  // Build query to fetch status of events.
  $query = db_select('field_data_event_calendar_status', 'ecs');
  $query
    ->join('taxonomy_term_data', 'td', 'td.tid = ecs.event_calendar_status_tid');
  $query
    ->fields('td', array(
    'name',
  ))
    ->condition('ecs.entity_id', $node->nid);
  $result = $query
    ->execute();
  foreach ($result as $status) {
    return $status->name;
  }
}