You are here

function scheduler_preprocess_node in Scheduler 6

Same name and namespace in other branches
  1. 8 scheduler.module \scheduler_preprocess_node()
  2. 7 scheduler.module \scheduler_preprocess_node()

Implements hook_preprocess_node(); Makes the publish_on and unpublish_on data available as theme variables.

File

./scheduler.module, line 983

Code

function scheduler_preprocess_node(&$variables, $hook) {
  $node = $variables['node'];
  $date_format = variable_get('scheduler_date_format', SCHEDULER_DATE_FORMAT);
  if (!empty($node->publish_on)) {
    $variables['publish_on'] = format_date($node->publish_on, 'custom', $date_format);
  }
  if (!empty($node->unpublish_on)) {
    $variables['unpublish_on'] = format_date($node->unpublish_on, 'custom', $date_format);
  }
}