You are here

public function AssetsUIController::hook_forms in Asset 7

Provides definitions for implementing hook_forms().

Use per bundle form ids if possible, such that easy per bundle alterations are supported too.

Note that for performance reasons, this method is invoked only for forms which receive the entity_type as first argument. Thus any forms added must follow that pattern.

Overrides EntityDefaultUIController::hook_forms

See also

entity_forms()

File

includes/asset.controllers.inc, line 82
Provides a controller classes for Asset and related entities

Class

AssetsUIController
UI controller for Asset.

Code

public function hook_forms() {

  // The overview and the operation form are implemented by the controller,
  // the callback and validation + submit handlers just invoke the controller.
  $forms[$this->entityType . '_overview_form'] = array(
    'callback' => 'entity_ui_overview_form',
    'wrapper_callback' => 'entity_ui_form_defaults',
  );
  $forms[$this->entityType . '_operation_form'] = array(
    'callback' => 'entity_ui_operation_form',
    'wrapper_callback' => 'entity_ui_form_defaults',
  );
  if (!(count($this->entityInfo['bundles']) == 1 && isset($this->entityInfo['bundles'][$this->entityType]))) {
    foreach ($this->entityInfo['bundles'] as $bundle => $bundle_info) {
      $forms[$this->entityType . '_edit_' . $bundle . '_form']['callback'] = 'asset_base_form';
    }
  }
  return $forms;
}