You are here

function datex_token_info in Datex 7.2

Implements hook_token_info().

File

./datex.tokens.inc, line 11
Token module integration.

Code

function datex_token_info() {
  $info['tokens']['datex']['jalali_now'] = t('Jalali date (now).');
  $types['datex'] = array(
    'name' => t("Localized Date (Datex)"),
    'description' => t("Tokens related to localized times and dates using datex."),
  );
  $format = variable_get('date_format_short');
  $date['short'] = array(
    'name' => t("Short format"),
    'description' => t("A date in 'short' format. (%date)", array(
      '%date' => datex_format_date('fa', REQUEST_TIME, $format),
    )),
  );
  $format = variable_get('date_format_medium');
  $date['medium'] = array(
    'name' => t("Medium format"),
    'description' => t("A date in 'medium' format. (%date)", array(
      '%date' => format_date(REQUEST_TIME, $format),
    )),
  );
  $format = variable_get('date_format_long');
  $date['long'] = array(
    'name' => t("Long format"),
    'description' => t("A date in 'long' format. (%date)", array(
      '%date' => format_date(REQUEST_TIME, $format),
    )),
  );
  $date['custom'] = array(
    'name' => t("Custom format"),
    'description' => t("A date in a custom format and a select calendar. See !php-date for details and check datex for available calendars.", array(
      '!php-date' => l(t('the PHP documentation'), 'http://php.net/manual/en/function.date.php'),
    )),
    'dynamic' => TRUE,
  );
  $tokens = array(
    'types' => $types,
    'tokens' => array(
      'datex' => $date,
    ),
  );
  return $tokens;
}