You are here

function agenda_admin_configure in Agenda 6.2

Same name and namespace in other branches
  1. 6 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 112
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('Date formatting'),
    '#default_value' => agenda_variable_get($delta, 'dateformat', 'l, F jS'),
    '#description' => t('Specify the date format.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_timeformat'] = array(
    '#type' => 'textfield',
    '#title' => t('Time formatting'),
    '#default_value' => agenda_variable_get($delta, 'timeformat', 'h:ia'),
    '#description' => t('Specify the time format.'),
    '#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_hangoutlinktext'] = array(
    '#type' => 'textfield',
    '#title' => t('Calendar hangout link text'),
    '#default_value' => agenda_variable_get($delta, 'hangoutlinktext', 'Join Google Calendar Event Hangout'),
    '#description' => t('Text to display when linking to the Google Calendar event Hangout.'),
    '#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 IDs of each google calendar you want to display, each on a new line. For private calendars, include the access token after the email with a forward slash."),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_timezone'] = array(
    '#type' => 'textfield',
    '#title' => t('Timezone'),
    '#default_value' => agenda_variable_get($delta, 'timezone', variable_get('date_default_timezone_name', date_default_timezone_get())),
    '#description' => t('The timezone identifier to be used for this calendar, as described in <a href="http://php.net/timezones">the PHP manual</a>.'),
    '#required' => TRUE,
    '#agenda_setting' => TRUE,
  );
  $form['agenda_googleapi_override'] = array(
    '#type' => 'textfield',
    '#title' => t('Google API Key'),
    '#default_value' => agenda_variable_get($delta, 'googleapi_override', ''),
    '#size' => 39,
    '#maxlength' => 39,
    '#description' => t("Use this Google API key instead of default set on agenda settings page."),
    '#agenda_setting' => TRUE,
  );
  $form['agenda_confirm'] = array(
    '#type' => 'submit',
    '#value' => t('Save settings'),
  );
  return $form;
}