You are here

function calendar_systems_preprocess_comment in Calendar Systems 7

Same name and namespace in other branches
  1. 8 calendar_systems.module \calendar_systems_preprocess_comment()
  2. 7.2 calendar_systems.module \calendar_systems_preprocess_comment()

The usage is to improve compatibility when the core patch is not available Implements hook_preprocess_comment().

File

./calendar_systems.module, line 271
Contains Calendar Systems hook implementations and helpers.

Code

function calendar_systems_preprocess_comment(&$variables) {
  if (!_calendar_systems_is_patch_applied()) {
    $calendar = calendar_systems_get_calendar_instance();
    if ($calendar) {
      $format = variable_get('date_format_medium');
      $variables['changed'] = $calendar
        ->smartGet($format, $variables['elements']['#comment']->created);
      $variables['created'] = $calendar
        ->smartGet($format, $variables['elements']['#comment']->changed);
      $variables['submitted'] = t('Submitted by !username on !datetime', array(
        '!username' => $variables['author'],
        '!datetime' => $variables['created'],
      ));
    }
  }
}