You are here

public function TMGMTLocalTaskUIController::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

translators/tmgmt_local/controller/tmgmt_local.ui_controller.task.inc, line 63

Class

TMGMTLocalTaskUIController
Entity UI controller for the local task entity.

Code

public function applyOperation($op, $entity) {
  switch ($op) {
    case 'delete':
      $entity
        ->delete();
      return t('Deleted the translation local task %label.', array(
        '%label' => $entity
          ->label(),
      ));
    case 'unassign':
      $entity
        ->unassign();
      $entity
        ->save();
      return t('Unassigned from translation local task %label.', array(
        '%label' => $entity
          ->label(),
      ));
  }
  return FALSE;
}