You are here

function availability_calendars_admin_settings in Availability Calendars 6

Same name and namespace in other branches
  1. 5 availability_calendars.module \availability_calendars_admin_settings()
  2. 6.2 availability_calendars.admin.inc \availability_calendars_admin_settings()
  3. 7.2 availability_calendars.admin.inc \availability_calendars_admin_settings()

Settings page callback.

Return value

array

1 string reference to 'availability_calendars_admin_settings'
availability_calendars_menu in ./availability_calendars.module
Implementation of hook_menu().

File

./availability_calendars.module, line 103
Availability Calendars Module.

Code

function availability_calendars_admin_settings() {
  $form = array();
  $settings = availability_calendar_getsettings();
  $form['display'] = array(
    '#type' => 'fieldset',
    '#title' => t('View settings'),
    '#description' => t('Check where you want availability calendars to be displayed. If you choose none of the suggested places below you will need to output it manually using %func function.', array(
      '%func' => 'theme_availability_calendars_node()',
    )),
  );
  $form['display']['availability_calendars_settings_system_nodeview'] = array(
    '#type' => 'checkbox',
    '#title' => t('Node view page'),
    '#default_value' => $settings->nodeview,
  );
  $form['display']['availability_calendars_settings_system_monthcount'] = array(
    '#type' => 'textfield',
    '#title' => t('Number of months to display'),
    '#default_value' => $settings->monthcount,
    '#description' => t("Your calendars will show this number of months to all users except those with the 'edit own availability calendars' or 'edit availability calendars' who will always see 3 extra months on the calendars they can edit. This is to allow them to enter information into future calendars before it is made publicly available."),
  );
  $form['display']['availability_calendars_settings_system_splitday'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow split day statuses.'),
    '#default_value' => $settings->splitday,
  );
  $form['display']['availability_calendars_settings_system_defaultstatus'] = array(
    '#type' => 'select',
    '#options' => availability_calendars_options(),
    '#title' => t("Set the default status in which to set all newly created nodes' statuses."),
    '#default_value' => $settings->defaultstatus,
  );
  $form['global'] = array(
    '#type' => 'fieldset',
    '#title' => t('Global settings'),
    '#description' => t('The following settings toggle their setting globally, leave them unchecked to allow configuration per node.'),
  );
  $form['global']['availability_calendars_settings_system_hideold'] = array(
    '#type' => 'checkbox',
    '#title' => t('Set past dates to fully booked.'),
    '#default_value' => $settings->hideold,
  );
  $form['global']['availability_calendars_settings_system_showteaser'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show availability calendars within teasers.'),
    '#default_value' => $settings->showteaser,
  );

  //TODO: add status codes and css classes in here
  return system_settings_form($form);
}