You are here

function calendar_jalali_admin_form in Calendar Systems 6.2

Form callback for Jalali calendar administration.

Parameters

$config: Calendar specific config options.

1 string reference to 'calendar_jalali_admin_form'
calendar_jalali_calendar_info in calendars/calendar_jalali/calendar_jalali.module
Implements hook_calendar_info().

File

calendars/calendar_jalali/calendar_jalali.module, line 46
Implements necessary hooks & helpers to support Jalali Calendar.

Code

function calendar_jalali_admin_form($config) {
  $form = array();
  $locale = function_exists('locale') ? TRUE : FALSE;
  $form['calendar_jalali_translate_numbers'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the Persian representaion of numbers in date strings.'),
    '#description' => t('e.g. Use !number-fa instead of <strong>!number-en</strong>.', array(
      '!number-fa' => '۹',
      '!number-en' => '9',
    )),
    '#default_value' => $config['calendar_jalali_translate_numbers'],
    '#return_value' => 1,
  );
  $form['translate_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Calendar Translation Settings'),
    '#description' => t('You need to have the <em>Locale</em> module enabled to make use of these options.'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['translate_options']['calendar_jalali_translate_meridiem'] = array(
    '#type' => 'checkbox',
    '#title' => t('Translate Ante/Post meridiems regardless of site language.'),
    '#description' => t('If checked, you also need to translate Ante/Post meridiem to Persian using the <a href="!link">translate interface</a>.', array(
      '!link' => url('admin/build/translate'),
    )),
    '#default_value' => !$locale ? 0 : $config['calendar_jalali_translate_meridiem'],
    '#return_value' => 1,
    '#disabled' => !$locale,
  );
  $form['translate_options']['calendar_jalali_translate_weekdays'] = array(
    '#type' => 'checkbox',
    '#title' => t('Translate weekdays and show Persian representations regardless of site language.'),
    '#description' => t('If checked, you also need to translate weekday names to Persian using the <a href="!link">translate interface</a>.', array(
      '!link' => url('admin/build/translate'),
    )),
    '#default_value' => !$locale ? 0 : $config['calendar_jalali_translate_weekdays'],
    '#return_value' => 1,
    '#disabled' => !$locale,
  );
  $form['translate_options']['calendar_jalali_translate_months'] = array(
    '#type' => 'checkbox',
    '#title' => t('Translate month names and show Persian representations regardless of site language.'),
    '#description' => t('If checked, you also need to translate month names to Persian using the <a href="!link">translate interface</a>.', array(
      '!link' => url('admin/build/translate'),
    )),
    '#default_value' => !$locale ? 0 : $config['calendar_jalali_translate_months'],
    '#return_value' => 1,
    '#disabled' => !$locale,
  );
  return $form;
}