You are here

function zenophile_midnight_form_zenophile_create_alter in Zenophile 6.2

Same name and namespace in other branches
  1. 7 zenophile_midnight/zenophile_midnight.module \zenophile_midnight_form_zenophile_create_alter()

Implementation of hook_form_FORM_ID_alter().

Add our controls to Zenophile's form.

This seems inelegant, but it's the simplest way to add your own controls to Zenophile's form. Zenophile's unmodified form will have #weight values set for everything; use them for precise placement of your controls. Also, please set #weight values for your own elements, for the benefit of other modules.

You should also add a #validate callback to the form, if your controls need one. Zenophile Midnight is just adding a checkbox, so it's not necessary in this case.

When creating and debugging your own Zenophile add-on, you'll find it helpful to set the ZENOPHILE_DEBUG constant to TRUE in zenophile.module. When this is set, Zenophile will not actually create the new subtheme; if you have the Devel module installed (strongly recommended!), it will instead use the dsm() function to print out the value of the $files array (see the comments for hook_zenophile_alter() below for more info on the $files array). It's usually faster to find glitches by checking out what's in $files instead of inspecting the files of the created theme (though you should eventually do that too).

File

zenophile_midnight/zenophile_midnight.module, line 40
Aid to create light-on-dark Zen-based themes with Zenophile.

Code

function zenophile_midnight_form_zenophile_create_alter(&$form, $form_state) {
  if (isset($form['advanced_fset'])) {
    $form['advanced_fset']['midnight'] = array(
      '#type' => 'checkbox',
      '#title' => t('Include Zen Midnight stylesheet and images'),
      '#weight' => $form['advanced_fset']['fresh']['#weight'] + 5,
      '#description' => t('The Zen Midnight stylesheet and images invert or darken the colors in the standard Zen Sub-theme Starter Kit (STARTERKIT) theme so that the theme you create will better serve as the base of a theme with a light-on-dark color scheme (light-colored text on a dark-colored background).'),
    );
  }
}