You are here

function datex_admin_form in Datex 7

Same name and namespace in other branches
  1. 7.3 datex.admin.inc \datex_admin_form()
  2. 7.2 datex.admin.inc \datex_admin_form()

Provides administration form for datex module (menu callback).

1 string reference to 'datex_admin_form'
datex_menu in ./datex.module
Implements hook_menu().

File

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

Code

function datex_admin_form() {
  $options = array(
    DATEX_PATCHING_METHOD => t('Use patching of common.inc file.'),
    DATEX_THEMING_METHOD => t('Use theming layer whenever possible.'),
  );

  // Use PHP-Intl or not.
  $form['datex_integration_method'] = array(
    '#type' => 'radios',
    '#title' => t('Date integration method'),
    '#default_value' => variable_get('datex_integration_method', DATEX_THEMING_METHOD),
    '#description' => t('The method which datex uses to integrate with Drupal. Patching method needs patching a core file, But will support more modules and functionalities, Non patching method (by using theming layer) has a very limited support, It only supports Node authoring date and comment publishing date.'),
    '#options' => $options,
  );
  $options = array();
  foreach (system_get_date_types() as $type) {
    $options[variable_get('date_format_' . $type['type'])] = $type['title'];
  }
  $form['datex_node_format'] = array(
    '#type' => 'radios',
    '#title' => t('Date format for node display pages.'),
    '#default_value' => variable_get('datex_node_format', variable_get('date_format_medium')),
    '#description' => t('Date in node display page will be formatted with this format. Only applicable when selecting "Theming layer" method above.'),
    '#options' => $options,
  );
  $form['datex_comment_format'] = array(
    '#type' => 'radios',
    '#title' => t('Date format for comment display pages.'),
    '#default_value' => variable_get('datex_comment_format', variable_get('date_format_medium')),
    '#description' => t('Date in comment display will be formatted with this format. Only applicable when selecting "Theming layer" method above.'),
    '#options' => $options,
  );
  return system_settings_form($form);
}