You are here

function datex_preprocess_comment in Datex 7

Same name and namespace in other branches
  1. 7.3 datex.module \datex_preprocess_comment()
  2. 7.2 datex.module \datex_preprocess_comment()

Implements hook_preprocess_comment().

File

./datex.module, line 145
Convert output of date_format() to Jalali in a patched drupal installation.

Code

function datex_preprocess_comment(&$variables) {
  if (_datex_skip_language() || _datex_integration_mode(DATEX_PATCHING_METHOD)) {
    return;
  }
  $format = variable_get('datex_node_format', variable_get('date_format_medium'));
  $variables['changed'] = DatexFormatter::format($variables['elements']['#comment']->created, $format, drupal_get_user_timezone(), _datex_intl());
  $variables['created'] = DatexFormatter::format($variables['elements']['#comment']->changed, $format, drupal_get_user_timezone(), _datex_intl());
  $variables['submitted'] = t('Submitted by !username on !datetime', array(
    '!username' => $variables['author'],
    '!datetime' => $variables['created'],
  ));
}