You are here

function mobile_tools_form_alter in Mobile Tools 7.2

Same name and namespace in other branches
  1. 5 mobile_tools.module \mobile_tools_form_alter()
  2. 6.3 mobile_tools.module \mobile_tools_form_alter()
  3. 6 mobile_tools.module \mobile_tools_form_alter()

Alteration to global setting form

File

./mobile_tools.module, line 211
Functionality to ease the creation of mixed device environments.

Code

function mobile_tools_form_alter(&$form, $form_state, $form_id) {
  switch ($form_id) {
    case 'node_configure':
      $form['default_nodes_main_mobile'] = array(
        '#type' => 'select',
        '#title' => t('Number of posts on main page for the mobile version'),
        '#default_value' => variable_get('default_nodes_main_mobile', variable_get('default_nodes_main')),
        '#options' => array(
          1 => 1,
          2 => 2,
          3 => 3,
          4 => 4,
          5 => 5,
          6 => 6,
          7 => 7,
          8 => 8,
          9 => 9,
          10 => 10,
          15 => 15,
          20 => 20,
          25 => 25,
          30 => 30,
        ),
        '#description' => t('The default maximum number of posts to display per page on overview pages such as the main page (on Mobile).'),
      );
      break;
    case 'system_site_information_settings':
      $form['site_frontpage_mobile'] = array(
        '#type' => 'textfield',
        '#title' => t('Choose another frontpage for mobile visitors.'),
        '#default_value' => variable_get('site_frontpage_mobile', variable_get('site_frontpage', 'node')),
        '#description' => t('If you want a different page as the frontpage of your site for mobile users, specify it here.'),
        '#weight' => 1,
      );
      break;
  }
}