You are here

public function PartyUIController::actionsForm in Party 8.2

Same name and namespace in other branches
  1. 7 includes/party.ui.inc \PartyUIController::actionsForm()

Builds the actions form.

@todo: figure out clean parameters here!

File

includes/party.ui.inc, line 51
Provides a controller for building a party overview form.

Class

PartyUIController
Controller for providing Party UI.

Code

public function actionsForm() {

  // This gives us the bulk operations form element
  $form['options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Update options'),
    '#attributes' => array(
      'class' => array(
        'container-inline',
      ),
    ),
  );
  $options = array();

  // Get party operations from any modules that implement hook_party_operations().
  foreach (module_invoke_all('party_operations') as $operation => $array) {
    $options[$operation] = $array['label'];
  }
  $form['options']['operation'] = array(
    '#type' => 'select',
    '#title' => t('Operation'),
    '#title_display' => 'invisible',
    '#options' => $options,
    '#default_value' => 'merge',
  );
  $options = array();
  $form['options']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Update'),
  );
  return $form;
}