You are here

function weight_form_system_site_information_settings_alter in Weight 7.2

Implements hook_form_FORM_ID_alter().

File

./weight.module, line 121

Code

function weight_form_system_site_information_settings_alter(&$form, &$form_state) {
  $form['front_page']['weight_frontpage'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use weighted front page?'),
    '#description' => t('Selecting this option will emulate the default front page,
      but the nodes will be sorted by weight. Only nodes of content types that are
      weight enabled will be shown.'),
    '#return_value' => 1,
    '#default_value' => variable_get('weight_frontpage', 0),
    '#weight' => 5,
  );
  $form['front_page']['site_frontpage']['#weight'] = 10;
  $form['front_page']['site_frontpage']['#states'] = array(
    'visible' => array(
      ':input[name="weight_frontpage"]' => array(
        'checked' => FALSE,
      ),
    ),
  );
  $form['#submit'][] = 'weight_site_information_form_submit';
}