You are here

function _touch_icons_themesettings_checkbox in Touch Icons 6

Helper function for touch icons theme settings form elements.

Provides core-style checkboxes for touch icon theme settings.

See also

touch_icons_form_alter()

1 call to _touch_icons_themesettings_checkbox()
touch_icons_form_system_theme_settings_alter in ./touch_icons.module
Implementation of hook_form_FORM_ID_alter(). Implementation of hook_form_system_theme_settings_alter().

File

./touch_icons.module, line 144
Adds a fieldset to theme settings form which allows site administrators to specify Apple Touch icons for Drupal websites. The Touch icon settings behave in a similar manner to the Site Logo and Favicon settings provided by Drupal core.

Code

function _touch_icons_themesettings_checkbox(&$form, &$form_state, &$settings) {

  // toggle-display checkboxes
  $form['theme_settings']['toggle_touch_icon_plain'] = array(
    '#type' => 'checkbox',
    '#title' => t('iOS touch icon'),
    '#default_value' => $settings['toggle_touch_icon_plain'],
  );
  $form['theme_settings']['toggle_touch_icon_precomp'] = array(
    '#type' => 'checkbox',
    '#title' => t('iOS touch icon (precomposed)'),
    '#default_value' => $settings['toggle_touch_icon_precomp'],
  );

  // use default icon checkboxes
  $form['touch_icons']['plain']['default_touch_icon_plain'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the default iOS touch icon.'),
    '#default_value' => $settings['default_touch_icon_plain'],
    '#tree' => FALSE,
    '#description' => t('Check here if you want the theme to use the touch icon supplied with it.'),
  );
  $form['touch_icons']['precomp']['default_touch_icon_precomp'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the default precomposed iOS touch icon.'),
    '#default_value' => $settings['default_touch_icon_precomp'],
    '#tree' => FALSE,
    '#description' => t('Check here if you want the theme to use the precomposed touch icon supplied with it.'),
  );

  // integrate with themsettings_verticaltabs.module
  if (module_exists('themesettings_verticaltabs')) {
    $form['touch_icons']['#attached'] = array(
      'js' => array(
        'vertical-tabs' => drupal_get_path('module', 'touch_icons') . '/touch_icons_verticaltabs.js',
      ),
    );
  }
}