You are here

function datex_block_configure in Datex 7.3

Implements hook_block_configure().

File

./datex.module, line 92
Datex main module file, Datex adds php-intl support to drupal.

Code

function datex_block_configure($delta = '') {
  $f = [];
  for ($i = 0; $i < variable_get('datex_block_count', 1); $i++) {
    if ($delta === "datex_block_{$i}") {
      $cfg = _datex_block_cfg($i);
      $f['datex_calendar'] = [
        '#title' => t('Calendar'),
        '#type' => 'select',
        '#options' => _datex_available_calendars(),
        '#default_value' => $cfg['cal'],
      ];
      $f['datex_format'] = [
        '#title' => t('Date/Time format'),
        '#type' => 'textfield',
        '#description' => 'TODO add medium short and ... See php.net/manual/en/function.date.php for date formats',
        '#default_value' => $cfg['fmt'],
      ];
      $f['datex_timezone'] = [
        '#title' => t('Timezone'),
        '#type' => 'select',
        '#options' => [
          'site' => t("Use site's timezone"),
          'user' => t("Use user's timezone"),
        ] + system_time_zones(),
        '#default_value' => $cfg['tz'],
      ];
      $f['datex_text'] = [
        '#title' => t('Content'),
        '#type' => 'textfield',
        '#description' => t('The blocks content. {} is replaced with the actual date. If unsure, leave this field empty or set it to {}'),
        '#default_value' => $cfg['text'],
      ];
      break;
    }
  }
  return $f;
}