You are here

function viewport_settings_form in Viewport 7

Configuration form for viewport tag values and presence settings.

Presented at: admin/config/user-interface/viewport.

1 string reference to 'viewport_settings_form'
viewport_menu in ./viewport.module
Implements hook_menu().

File

./viewport.admin.inc, line 12
Admin interfaces for viewport module.

Code

function viewport_settings_form() {
  $form = array();
  $form['viewport'] = array(
    '#type' => 'fieldset',
    '#description' => t('The values for the viewport metatag will be output in the same way as entered here
      for the selected pages below. <br/>
      For the numeric values with decimal digits, use the decimal point "." instead of a comma "," <br/>
      If you don\'t know what are these values for, you should visit the !help-page to learn more about the Viewport metatag', array(
      '!help-page' => l(t("Viewport's help page"), 'admin/help/viewport'),
    )),
  );
  $form['viewport']['viewport_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Width'),
    '#default_value' => variable_get('viewport_width', ''),
    '#description' => t('You probably want this to be %device-width, but a fixed number of pixels (only the number) is accepted too.', array(
      '%device-width' => 'device-width',
    )),
  );
  $form['viewport']['viewport_height'] = array(
    '#type' => 'textfield',
    '#title' => t('Height'),
    '#default_value' => variable_get('viewport_height', ''),
    '#description' => t('%device-height, or a fixed number of pixels (only the number).', array(
      '%device-height' => 'device-height',
    )),
  );
  $form['viewport']['viewport_initial_scale'] = array(
    '#type' => 'textfield',
    '#title' => t('Initial Scale'),
    '#default_value' => variable_get('viewport_initial_scale', ''),
    '#description' => t('Any value in the range (0, 10.0]. Usually this is set to 1.0'),
  );
  $form['viewport']['viewport_minimum_scale'] = array(
    '#type' => 'textfield',
    '#title' => t('Minimum Scale'),
    '#default_value' => variable_get('viewport_minimum_scale', ''),
    '#description' => t('Any value in the range (0, 10.0]. Usually this is set to the same value as the %initial-scale property', array(
      '%initial-scale' => 'initial-scale',
    )),
  );
  $form['viewport']['viewport_maximum_scale'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum Scale'),
    '#default_value' => variable_get('viewport_maximum_scale', ''),
    '#description' => t('Any value in the range (0, 10.0]. Usually this is set to 1.0'),
  );
  $form['viewport']['viewport_user_scalable'] = array(
    '#type' => 'checkbox',
    '#title' => t('User Scalable'),
    '#default_value' => variable_get('viewport_user_scalable', TRUE),
  );
  $form['viewport']['viewport_selected_pages'] = array(
    '#type' => 'textarea',
    '#title' => t('Selected pages'),
    '#default_value' => variable_get('viewport_selected_pages'),
    '#description' => t("The viewport settings will be applied to the following paths. <br/>\n    Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard.\n    Example paths are %blog for the blog page and %blog-wildcard for every personal blog.\n    %front is the front page.", array(
      '%blog' => 'blog',
      '%blog-wildcard' => 'blog/*',
      '%front' => '<front>',
    )),
  );
  return system_settings_form($form);
}