You are here

function pagerer_settings_form in Pagerer 7

Main Pagerer settings admin form.

1 string reference to 'pagerer_settings_form'
pagerer_menu in ./pagerer.module
Implements hook_menu().

File

./pagerer.admin.inc, line 15
Pagerer administration

Code

function pagerer_settings_form($form, &$form_state) {

  // Add Pagerer's css.
  drupal_add_css(drupal_get_path('module', 'pagerer') . '/pagerer.css');

  // Prepare fake pager for previews.
  pager_default_initialize(47884, 50);

  // Presets table.
  $form['presets'] = array(
    '#theme' => 'pagerer_preset_list',
  );

  // Container for global options.
  $form['pagerer'] = array(
    '#type' => 'fieldset',
    '#title' => t("General"),
  );

  // Global option for pager override.
  $options = array(
    t('Default:') => array(
      'core' => t('No - use Drupal core pager'),
    ),
    t('Replace with:') => _pagerer_list_presets(),
  );
  $form['pagerer']['core_override_preset'] = array(
    '#type' => 'select',
    '#title' => t("Replace standard pager"),
    '#description' => t("Core pager theme requests can be overridden with any Pagerer preset. Select whether they need to be fulfilled by Drupal core pager, or the Pagerer preset to use."),
    '#options' => $options,
    '#default_value' => _pagerer_get_variable('core_override_preset'),
  );

  // Save configuration.
  $form['save'] = array(
    '#type' => 'submit',
    '#name' => 'save',
    '#value' => t("Save configuration"),
  );
  return $form;
}