You are here

function agenda_admin_configure in Agenda 6

Same name and namespace in other branches
  1. 6.2 agenda.admin.php \agenda_admin_configure()
  2. 7.2 agenda.admin.php \agenda_admin_configure()
  3. 7 agenda.admin.php \agenda_admin_configure()

Manage agenda

1 string reference to 'agenda_admin_configure'
agenda_menu in ./agenda.module
Implementation of hook_menu().

File

./agenda.admin.php, line 86
Administration interface for the agenda module

Code

function agenda_admin_configure($form_state, $delta) {
  $form = array();
  $form['agenda_bid'] = array(
    '#type' => 'hidden',
    '#value' => (int) $delta,
  );
  $form['agenda_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative title'),
    '#default_value' => agenda_variable_get($delta, 'title', 'New block'),
    '#description' => t('The Administrative title for this block'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_start'] = array(
    '#type' => 'textfield',
    '#title' => t('Agenda start'),
    '#default_value' => agenda_variable_get($delta, 'start', '-1 day'),
    '#description' => t('Any events that are older than this are not displayed. For example "-1 day" or "yesterday" will include events that occured yesterday, where as "now" will only include events that have not yet started. You can use any string <a href="http://php.net/strtotime">strtotime</a> can parse.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_end'] = array(
    '#type' => 'textfield',
    '#title' => t('Agenda end'),
    '#default_value' => agenda_variable_get($delta, 'end', '+2 months'),
    '#description' => t('Any events newer than this are not displayed. For example, "+2 months" will display any events that occur in the next 2 months. You can use any string <a href="http://php.net/strtotime">strtotime</a> can parse.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_datelimit'] = array(
    '#type' => 'textfield',
    '#title' => t('Dates to display'),
    '#default_value' => agenda_variable_get($delta, 'datelimit', 4),
    '#description' => t("The maximum number of unique dates to display."),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_maxevents'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum number of events to fetch'),
    '#default_value' => agenda_variable_get($delta, 'maxevents', 25),
    '#description' => t("The maximum number of events to fetch."),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_dateformat'] = array(
    '#type' => 'textfield',
    '#title' => t('Format of the dates displayed'),
    '#default_value' => agenda_variable_get($delta, 'dateformat', 'custom'),
    '#description' => t('The first parameter provided to <a href="http://api.drupal.org/api/search/6/format_date">format_date</a>; small, medium, large or custom.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_customdate'] = array(
    '#type' => 'textfield',
    '#title' => t('Custom date formatting'),
    '#default_value' => agenda_variable_get($delta, 'customdate', 'l, F jS'),
    '#description' => t('If you have specified <em>custom</em> above, then specify the date format here.'),
    '#required' => FALSE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_timeformat'] = array(
    '#type' => 'textfield',
    '#title' => t('Format of the times displayed'),
    '#default_value' => agenda_variable_get($delta, 'timeformat', 'h:ia'),
    '#description' => t('If start and finish times are displayed, specify the time format here.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_noeventstext'] = array(
    '#type' => 'textfield',
    '#title' => t('Text to display if no events are found'),
    '#default_value' => agenda_variable_get($delta, 'noeventstext', '<p>No upcoming events</p>'),
    '#description' => t('Leave blank to have the block hide when no events are found.'),
    '#agenda_setting' => TRUE,
  );
  $form['agenda_linktext'] = array(
    '#type' => 'textfield',
    '#title' => t('Calendar link text'),
    '#default_value' => agenda_variable_get($delta, 'linktext', 'View this event in Google Calendar'),
    '#description' => t('Text to display when linking to the Google Calendar event.'),
    '#agenda_setting' => TRUE,
  );
  $form['agenda_cachetime'] = array(
    '#type' => 'textfield',
    '#title' => t('Amount of time to cache event data'),
    '#default_value' => agenda_variable_get($delta, 'cachetime', 3600),
    '#description' => t("How long (in seconds) the module should hold onto the ICS data before re-requesting it from Google."),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_display_keys'] = array(
    '#type' => 'textfield',
    '#title' => t('Display fields'),
    '#default_value' => agenda_variable_get($delta, 'display_keys', 'calendar, start time, description'),
    '#description' => t("A comma separated list of fields to display in the event summary. The available fields are shown on the <em>Test settings</em> page."),
    '#required' => FALSE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_hide_labels'] = array(
    '#type' => 'textfield',
    '#title' => t('Hide labels'),
    '#default_value' => agenda_variable_get($delta, 'hide_labels', 'link, description'),
    '#description' => t("A comma separated list of fields for which the label should not be displayed."),
    '#required' => FALSE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_calendars'] = array(
    '#type' => 'textarea',
    '#title' => t('Google Calendar IDs'),
    '#default_value' => agenda_variable_get($delta, 'calendars', 'drupalagenda@gmail.com'),
    '#rows' => 4,
    '#description' => t("The public IDs of each google calendar you want to display, each on a new line."),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_confirm'] = array(
    '#type' => 'submit',
    '#value' => t('Save settings'),
  );
  return $form;
}