You are here

function blocktheme_form_alter in Block Theme 5

File

./blocktheme.module, line 40

Code

function blocktheme_form_alter($form_id, &$form) {
  if ($form_id == 'block_admin_configure') {
    $module = $form['module']['#value'];
    $delta = $form['delta']['#value'];
    $var_name = $module . '-' . $delta;
    $blockthemes = variable_get('blocktheme_themes', '');
    $_sets = explode("\n", $blockthemes);
    $options[] = t('<-- None -->');
    foreach ($_sets as $key => $value) {
      $set = explode('|', $value);
      $options[$set[0]] = $set[1];
    }
    $blocktheme = blocktheme_get();
    $form['block_settings']['blocktheme'] = array(
      '#type' => 'select',
      '#weight' => -1,
      '#title' => t('Custom Theme'),
      '#default_value' => $blocktheme[$var_name],
      '#options' => $options,
    );
    $form['#submit']['blocktheme_save'] = array();
  }
}