You are here

public function NodeActivityActionHandler::optionForm in Activity 7

Display an FAPI form.

Parameters

&$form: An FAPI form array.

$form_state: The form_state from FAPI.

Overrides ActivityActionHandler::optionForm

File

./activity_action_handlers.inc, line 453

Class

NodeActivityActionHandler
Activity handler for node module.

Code

public function optionForm(&$form, $form_state) {
  parent::optionForm($form, $form_state);
  $node_types = array();
  foreach (node_type_get_types() as $type) {
    $node_types[$type->type] = check_plain($type->name);
  }
  $form['types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Allowed Node Types'),
    '#options' => $node_types,
    '#default_value' => $this->options['types'],
  );
  $node_entity_info = entity_get_info('node');
  $view_mode_options = array();
  foreach ($node_entity_info['view modes'] as $mode => $information) {
    $view_mode_options[$mode] = $information['label'];
  }

  // This is a node_view specific option.
  $form['view_modes'] = array(
    '#type' => 'checkboxes',
    '#title' => t('View Modes'),
    '#options' => $view_mode_options,
    '#default_value' => $this->options['view_modes'],
    '#access' => $this->type == 'node_view',
  );
}