1 block.node_types.inc DashboardContentTypesBlock::form(&$form, &$form_state)

Build the settings form for editing this block.

Overrides Block::form

File

core/modules/dashboard/includes/block.node_types.inc, line 130
Dashboard block displaying information about content types.

Class

DashboardContentTypesBlock
@file Dashboard block displaying information about content types.

Code

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

  $node_types = node_type_get_types();
  $type_options = array();
  $type_defaults = array();

  foreach ($node_types as $machine => $node_type) {
    $type_options[$machine] = check_plain(t($node_type->name));
    if (empty($this->settings['types']) || in_array($machine, $this->settings['types'])) {
      $type_defaults[] = $machine;
    }
  }

  $form['types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Display links for the following content types'),
    '#options' => $type_options,
    '#default_value' => $type_defaults,
  );
}