You are here

public function EntityLegalDocumentVersionUIController::hook_forms in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.entity_admin.inc \EntityLegalDocumentVersionUIController::hook_forms()

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

./entity_legal.entity_admin.inc, line 155
Admin ui controllers for entity_legal entities.

Class

EntityLegalDocumentVersionUIController
Legal Document Version entity ui controller.

Code

public function hook_forms() {
  $forms = parent::hook_forms();

  // Rewrite form ids to include the module name as a prefix.
  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'] = 'entity_legal_document_version_form';
    }
  }
  return $forms;
}