You are here

function collapsiblock_form_alter in Javascript Tools 5

File

collapsiblock/collapsiblock.module, line 58
Make blocks collapsible.

Code

function collapsiblock_form_alter($form_id, &$form) {
  if ($form_id == 'block_admin_configure') {
    $settings = variable_get('collapsiblock_settings', array());
    $form['#submit']['collapsiblock_submit'] = array();
    $form['collapsiblock'] = array(
      '#type' => 'fieldset',
      '#title' => t('Collapsible'),
      '#collapsible' => true,
      '#weight' => -5,
    );
    $form['collapsiblock']['collapse_type'] = array(
      '#type' => 'radios',
      '#title' => t('Block collapse behavior'),
      '#options' => array(
        1 => t('None.'),
        2 => t('Collapsible, expanded by default.'),
        3 => t('Collapsible, collapsed by default.'),
      ),
      '#default_value' => $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] ? $settings['block-' . $form['module']['#value'] . '-' . $form['delta']['#value']] : variable_get('collapsiblock_default_state', 1),
    );
  }
}