You are here

function magic_dev_form_system_theme_settings in Magic 7.2

Implements hook_form_alter()-ish.

Called from within magic.module's alter to ensure we always just add it in.

1 call to magic_dev_form_system_theme_settings()
magic_form_system_theme_settings_alter in ./magic.module
Implements hook_form_alter().

File

magic_dev/magic_dev.module, line 13
Development settings for the magic module.

Code

function magic_dev_form_system_theme_settings(&$form, &$form_state, $theme) {

  // Development Magic Grouping
  $form['magic']['dev'] = array(
    '#type' => 'fieldset',
    '#title' => t('Development Enhancements'),
  );

  // Footer JavaScript Option
  $form['magic']['dev']['magic_rebuild_registry'] = array(
    '#type' => 'checkbox',
    '#title' => t('Rebuild Theme Registry on Reload'),
    '#description' => t('<a href="!link" target="_blank">Rebuild the theme registry</a> during project development.', array(
      '!link' => 'http://drupal.org/node/173880#theme-registry',
    )),
    '#default_value' => theme_get_setting('magic_rebuild_registry', $theme),
  );

  // Viewport Indicator Option
  $form['magic']['dev']['magic_viewport_indicator'] = array(
    '#type' => 'checkbox',
    '#title' => t('Viewport Width Indicator'),
    '#description' => t('Displays an indicator of the viewport. Tap/click to toggle between <em>em</em> and <em>px</em>. The CSS and JavaScript for this will bypass your CSS and JavaScript exclude options.'),
    '#default_value' => theme_get_setting('magic_viewport_indicator', $theme),
  );
  if (module_exists('modernizr')) {

    // Modernizr Debug Option
    $options = array(
      'attributes' => array(
        'target' => '_blank',
      ),
    );
    $form['magic']['dev']['magic_modernizr_debug'] = array(
      '#type' => 'checkbox',
      '#title' => t('Modernizr Indicator'),
      '#description' => t('Displays an indicator of !modernizr detected features. Tap/click to toggle display of all of the available features. Install the !module for full Modernizr support. The CSS and JavaScript for this will bypass your CSS and JavaScript exclude options.', array(
        '!modernizr' => l('Modernizr', 'http://modernizr.com/', $options),
        '!module' => l('Modernizr Drupal module', 'http://drupal.org/project/modernizr', $options),
      )),
      '#default_value' => theme_get_setting('magic_modernizr_debug', $theme),
    );
  }
  else {

    // We don't have modernizr :-(
    $form['magic']['dev']['magic_modernizr_debug'] = array(
      '#type' => 'hidden',
      '#value' => FALSE,
    );
  }
  return $form;
}