You are here

function cleanpager_admin_settings in Clean Pagination 6

Same name and namespace in other branches
  1. 5 cleanpager.module \cleanpager_admin_settings()
  2. 7 cleanpager.module \cleanpager_admin_settings()

Defines admin settings form

1 string reference to 'cleanpager_admin_settings'
cleanpager_menu in ./cleanpager.module
Implementation of hook_menu()

File

./cleanpager.module, line 26

Code

function cleanpager_admin_settings() {
  $form = array();
  $form['cleanpager_pages'] = array(
    '#title' => t('Pages'),
    '#description' => t('Set which pages to apply clean pagination to. Put each page on a new line and use the full page name, without a leading slash. Probably the easiest way to test this out to to create a view with only 1 or 2 nodes per page and add the URL to this list. An example how you would type a page is "admin/content/node".'),
    '#type' => 'textarea',
    '#rows' => '7',
    '#default_value' => variable_get('cleanpager_pages', ''),
  );
  $form['cleanpager_use_seo_links'] = array(
    '#title' => t('Use SEO Links'),
    '#description' => t('Using SEO links will add the page URL to the pagination links, and then will remove them via jquery once the page is loaded.'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('cleanpager_use_seo_links', ''),
  );
  $form['cleanpager_redirect_301'] = array(
    '#title' => t('Use 301 Redirects'),
    '#description' => t('If a user lands on a page that has ?page=X in the query string but should have clean pagination, issue a 301 redirect.'),
    '#type' => 'checkbox',
    '#default_value' => variable_get('cleanpager_redirect_301', FALSE),
  );
  $form['cleanpager_use_additional_path'] = array(
    '#title' => t('Use !page_variable/page_number', array(
      '!page_variable' => CLEANPAGER_ADDITIONAL_PATH_VARIABLE,
    )),
    '#description' => t('Instead of simply adding /page_number at the end of paged urls, use /!page_variable/page_number.', array(
      '!page_variable' => CLEANPAGER_ADDITIONAL_PATH_VARIABLE,
    )),
    '#type' => 'checkbox',
    '#default_value' => variable_get('cleanpager_use_additional_path', TRUE),
  );
  return system_settings_form($form);
}