You are here

function admin_pages_settings in Util 7

Form to get and show pages.

1 string reference to 'admin_pages_settings'
admin_pages_menu in contribs/admin_pages/admin_pages.module
Implements hook_menu().

File

contribs/admin_pages/admin_pages.module, line 38
Identify pages as admin so they open as modal (overlay) pages.

Code

function admin_pages_settings($form_state) {
  $form = array();
  $pages = drupal_map_assoc(variable_get('admin_pages_pages', array(
    'user',
    'user/*',
  )));
  $form['pages'] = array(
    '#type' => 'value',
    '#value' => $pages,
  );
  $options = array();
  foreach ($pages as $path) {
    $options[$path] = array(
      'page' => $path,
    );
  }
  $form['new_page'] = array(
    '#type' => 'textfield',
    '#title' => t('Add page path'),
    '#description' => t('This is the path (the part of the URL following the site domain name) which should be displayed modally (overlay). This setting will be added to the list.'),
  );
  $form['list_wrapper'] = array(
    '#type' => 'fieldset',
    '#title' => t('Delete paths'),
    '#description' => t('Any checked paths will be deleted from the list when you click "Save configuration."'),
  );
  $form['list_wrapper']['list'] = array(
    '#type' => 'tableselect',
    '#empty' => t('There are currently no paths flagged.'),
    '#options' => $options,
    '#multiple' => TRUE,
    '#header' => array(
      'page' => t('Flagged paths'),
    ),
    '#attributes' => array(
      'style' => 'width: auto;',
    ),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save configuration'),
  );
  return $form;
}