You are here

function revisioning_scheduler_admin_configure in Revisioning 7

Same name and namespace in other branches
  1. 8 revisioning_scheduler/revisioning_scheduler.module \revisioning_scheduler_admin_configure()

Menu callback for admin settings.

1 string reference to 'revisioning_scheduler_admin_configure'
revisioning_scheduler_menu in revisioning_scheduler/revisioning_scheduler.module
Implements hook_menu().

File

revisioning_scheduler/revisioning_scheduler.module, line 34
Allows revisions to be published at specified dates and times.

Code

function revisioning_scheduler_admin_configure() {
  $date_format = variable_get('revisioning_scheduler_date_format');
  $default_date_format = REVISIONING_SCHEDULER_DEFAULT_DATE_FORMAT;
  if (empty($date_format)) {
    $date_format = $default_date_format;
  }
  $help_text = t('Date and time must be separated by a space. See this <a target="_blank" href="!php_manual_page">manual page</a> for available symbols and their meaning.', array(
    '!php_manual_page' => 'http://php.net/manual/en/function.date.php',
  ));
  $t_args = array(
    '%date_format' => $default_date_format,
    '%date' => date($date_format),
  );
  $form['revisioning_scheduler_date_format'] = array(
    '#type' => 'textfield',
    '#size' => 25,
    '#title' => t('Format used for entering publication dates'),
    '#default_value' => $date_format,
    '#description' => $help_text . '<br/>' . ($date_format == $default_date_format ? t('The default input format %date_format is used. <br/>Time now in this format: %date.', $t_args) : t('Time now in above format: %date <br/>If left blank the date input format defaults to %date_format', $t_args)),
  );
  $form['revisioning_scheduler_on_edit_form'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow publication dates to be scheduled on the content edit form'),
    '#default_value' => variable_get('revisioning_scheduler_on_edit_form', TRUE),
    '#description' => t('In addition publication dates may be scheduled when you press the Publish or Revert links.'),
  );
  return system_settings_form($form);
}