You are here

function blocktheme_form_basic_block_content_form_alter in Block Theme 8

Form for adding a new block.

File

./blocktheme.module, line 109
Provides a configuration option to select custom themes for blocks

Code

function blocktheme_form_basic_block_content_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
  $options = blocktheme_get_blockthemes();
  $form['settings']['#weight'] = -2;
  $form['regions']['#weight'] = -1;
  $form['custom_block_theme'] = array(
    '#type' => 'details',
    '#title' => t('Block Theme'),
    '#weight' => 0,
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#open' => TRUE,
  );
  $form['custom_block_theme']['blocktheme'] = array(
    '#type' => 'select',
    '#title' => t('Custom theme'),
    '#options' => $options,
  );
  $form['custom_block_theme']['blocktheme_vars'] = array(
    '#type' => 'textarea',
    '#default_value' => '',
    '#title' => t('Custom block variables'),
    '#description' => t('Enter one entry per line, in the format: <em>variable_name|variable_content</em>.'),
    '#wysiwyg' => FALSE,
  );
  $form['actions']['submit']['#submit'][] = 'blocktheme_save';
}