You are here

function print_html_settings in Printer, email and PDF versions 7.2

Same name and namespace in other branches
  1. 5.4 print.admin.inc \print_html_settings()
  2. 5.3 print.admin.inc \print_html_settings()
  3. 6 print.admin.inc \print_html_settings()
  4. 7 print.admin.inc \print_html_settings()
  5. 5.x print.admin.inc \print_html_settings()

Form constructor for the Printer-friendly pages HTML settings form.

2 string references to 'print_html_settings'
print_menu in ./print.module
Implements hook_menu().
print_update_7200 in ./print.install
Delete old variables.

File

./print.admin.inc, line 217
Contains the administrative functions of the PF module.

Code

function print_html_settings() {
  $link = print_print_link();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Web page options'),
  );
  $form['settings']['print_html_new_window'] = array(
    '#type' => 'checkbox',
    '#title' => t('Open the printer-friendly version in a new window'),
    '#default_value' => variable_get('print_html_new_window', PRINT_HTML_NEW_WINDOW_DEFAULT),
    '#description' => t('Setting this option will make the printer-friendly version open in a new window/tab.'),
  );
  $form['settings']['print_html_sendtoprinter'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send to printer'),
    '#default_value' => variable_get('print_html_sendtoprinter', PRINT_HTML_SENDTOPRINTER_DEFAULT),
    '#description' => t("Automatically calls the browser's print function when the printer-friendly version is displayed."),
  );
  $form['settings']['print_html_windowclose'] = array(
    '#type' => 'checkbox',
    '#title' => t('Close window after sending to printer'),
    '#default_value' => variable_get('print_html_windowclose', PRINT_HTML_WINDOWCLOSE_DEFAULT),
    '#description' => t("When the above options are enabled, this option will close the window after its contents are printed."),
  );
  $form['settings']['print_html_display_sys_urllist'] = array(
    '#type' => 'checkbox',
    '#title' => t('Printer-friendly URLs list in system pages'),
    '#default_value' => variable_get('print_html_display_sys_urllist', PRINT_TYPE_SYS_URLLIST_DEFAULT),
    '#description' => t('Enabling this option will display a list of printer-friendly destination URLs at the bottom of the page.'),
  );
  $form['settings']['print_robots_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Robots META tags'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['settings']['print_robots_settings']['print_robots_noindex'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add noindex'),
    '#default_value' => variable_get('print_robots_noindex', PRINT_ROBOTS_NOINDEX_DEFAULT),
    '#description' => t('Instruct robots to not index printer-friendly pages. Recommended for good search engine karma.'),
  );
  $form['settings']['print_robots_settings']['print_robots_nofollow'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add nofollow'),
    '#default_value' => variable_get('print_robots_nofollow', PRINT_ROBOTS_NOFOLLOW_DEFAULT),
    '#description' => t('Instruct robots to not follow outgoing links on printer-friendly pages.'),
  );
  $form['settings']['print_robots_settings']['print_robots_noarchive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add noarchive'),
    '#default_value' => variable_get('print_robots_noarchive', PRINT_ROBOTS_NOARCHIVE_DEFAULT),
    '#description' => t('Non-standard tag to instruct search engines to not show a "Cached" link for your printer-friendly pages. Recognized by Googlebot.'),
  );
  $form['settings']['link_text'] = array(
    '#type' => 'fieldset',
    '#title' => t('Custom link text'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['settings']['link_text']['print_html_link_text_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable custom link text'),
    '#default_value' => variable_get('print_html_link_text_enabled', PRINT_TYPE_LINK_TEXT_ENABLED_DEFAULT),
  );
  $form['settings']['link_text']['print_html_link_text'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('print_html_link_text', $link['text']),
    '#description' => t('Text used in the link to the printer-friendly version.'),
  );
  return system_settings_form($form);
}