You are here

public function TMGMTLocalTaskUIController::hook_menu in Translation Management Tool 7

Provides definitions for implementing hook_menu().

Overrides EntityDefaultUIController::hook_menu

File

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

Class

TMGMTLocalTaskUIController
Entity UI controller for the local task entity.

Code

public function hook_menu() {
  $id_count = count(explode('/', $this->path));
  $wildcard = isset($this->entityInfo['admin ui']['menu wildcard']) ? $this->entityInfo['admin ui']['menu wildcard'] : '%entity_object';
  $items[$this->path . '/' . $wildcard] = array(
    'title callback' => 'entity_label',
    'title arguments' => array(
      $this->entityType,
      $id_count,
    ),
    'page callback' => 'tmgmt_local_task_view',
    'page arguments' => array(
      $id_count,
    ),
    'load arguments' => array(
      $this->entityType,
    ),
    'access callback' => 'entity_access',
    'access arguments' => array(
      'view',
      $this->entityType,
      $id_count,
    ),
    'file' => 'tmgmt_local.pages.inc',
    'file path' => drupal_get_path('module', 'tmgmt_local') . '/includes',
  );
  $items[$this->path . '/' . $wildcard . '/delete'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      $this->entityType . '_operation_form',
      $this->entityType,
      $id_count,
      $id_count + 1,
    ),
    'load arguments' => array(
      $this->entityType,
    ),
    'access callback' => 'entity_access',
    'access arguments' => array(
      'delete',
      $this->entityType,
      $id_count,
    ),
    'type' => MENU_CALLBACK,
  );
  $items[$this->path . '/' . $wildcard . '/unassign'] = array(
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      $this->entityType . '_operation_form',
      $this->entityType,
      $id_count,
      $id_count + 1,
    ),
    'load arguments' => array(
      $this->entityType,
    ),
    'access callback' => 'entity_access',
    'access arguments' => array(
      'unassign',
      $this->entityType,
      $id_count,
    ),
    'type' => MENU_CALLBACK,
  );
  return $items;
}