You are here

function template_preprocess_node_accessibility_information in Node Accessibility 7

Template preprocess function for node_accessibility_information.tpl.php

File

./node_accessibility.module, line 175
Module file for the node accessibility project.

Code

function template_preprocess_node_accessibility_information(&$variables) {
  $variables['workbench_moderation'] = FALSE;
  $variables['published'] = t("No");
  drupal_add_css(drupal_get_path('module', 'node_accessibility') . '/includes/node_accessibility_information.css');
  if (!isset($variables['node']) || !is_object($variables['node'])) {
    if (class_exists('cf_error')) {
      cf_error::invalid_object('node');
    }
    return;
  }
  if ($variables['node']->status) {
    $variables['published'] = t("Yes");
  }
  if (module_exists('workbench_moderation') && property_exists($variables['node'], 'workbench_moderation')) {
    $variables['workbench_moderation'] = TRUE;
    $variables['live'] = t("No");
    $variables['current'] = t("No");
    if (isset($variables['node']->workbench_moderation['current']) && is_object($variables['node']->workbench_moderation['current'])) {
      if ($variables['node']->workbench_moderation['current']->vid == $variables['node']->vid) {
        $variables['current'] = t("Yes");
      }
    }
    if (isset($variables['node']->workbench_moderation['published']) && is_object($variables['node']->workbench_moderation['published'])) {
      if ($variables['node']->workbench_moderation['published']->vid == $variables['node']->vid) {
        $variables['live'] = t("Yes");
      }
    }
  }
}