You are here

public function TMGMTTranslatorUIController::applyOperation in Translation Management Tool 7

Applies an operation to the given entity.

Note: the export operation is directly carried out by the operationForm() method.

Parameters

string $op: The operation (revert, delete or import).

$entity: The entity to manipulate.

Return value

string The status message of what has been applied.

Overrides EntityDefaultUIController::applyOperation

File

ui/includes/tmgmt_ui.controller.translator.inc, line 156
Contains the translator UI controller.

Class

TMGMTTranslatorUIController
Entity UI controller for the Translator Entity.

Code

public function applyOperation($op, $entity) {
  if ($op == 'delete' && tmgmt_translator_busy($entity->name)) {
    drupal_set_message(t("The translator %translator could not be deleted because it is currently being used by at least one active translation job.", array(
      '%translator' => $entity
        ->label(),
    )), 'error');
    return FALSE;
  }
  return parent::applyOperation($op, $entity);
}