1 block.taxonomy.inc DashboardTaxonomyBlock::form(&$form, &$form_state)

Build the settings form for editing this block.

Overrides Block::form

File

core/modules/dashboard/includes/block.taxonomy.inc, line 138
Dashboard block displaying information about taxonomy, including: -

Class

DashboardTaxonomyBlock
@file Dashboard block displaying information about taxonomy, including: -

Code

function form(&$form, &$form_state) {
  parent::form($form, $form_state);

  if (!module_exists('taxonomy')) {
    return $form;
  }

  $vocabularies = taxonomy_get_vocabularies();
  $options = array();
  foreach ($vocabularies as $machine => $vocabulary) {
    $options[$machine] = check_plain(t($vocabulary->name));
  }

  $form['vocabularies'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Display the following Vocabularies'),
    '#multiple' => TRUE,
    '#options' => $options,
    // An empty array indicates enabled on all.
    '#default_value' => empty($this->settings['vocabularies']) ? array_keys($options) : $this->settings['vocabularies'],
  );
}