variable_get('collapsiblock_settings', array())), 'setting'); drupal_add_css($path .'/collapsiblock.css'); } 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']] : 2 ); } } function collapsiblock_submit($form_id, $edit) { $settings = variable_get('collapsiblock_settings', array()); $settings['block-' . $edit['module'] . '-' . $edit['delta']] = $edit['collapse_type']; variable_set('collapsiblock_settings', $settings); }