public function TMGMTJobItemUIController::hook_menu in Translation Management Tool 7
Provides definitions for implementing hook_menu().
Overrides EntityDefaultUIController::hook_menu
File
- ui/
includes/ tmgmt_ui.controller.job_item.inc, line 16 - Contains the job item UI controller.
Class
- TMGMTJobItemUIController
- Entity UI controller for the Job 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_ui_job_item_view',
'page arguments' => array(
$id_count,
),
'load arguments' => array(
$this->entityType,
),
'access callback' => 'entity_access',
'access arguments' => array(
'view',
'tmgmt_job_item',
$id_count,
),
'file' => $this->entityInfo['admin ui']['file'],
'file path' => $this->entityInfo['admin ui']['file path'],
);
$items[$this->path . '/' . $wildcard . '/view'] = array(
'title' => 'View',
'load arguments' => array(
$this->entityType,
),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items[$this->path . '/' . $wildcard . '/reject/%'] = array(
'title' => 'Reject',
'page callback' => 'drupal_get_form',
'page arguments' => array(
'tmgmt_ui_translation_review_form_reject_confirm',
$id_count,
$id_count + 2,
),
'load arguments' => array(
$this->entityType,
),
'access callback' => 'entity_access',
'access arguments' => array(
'accept',
$this->entityType,
$id_count,
),
'type' => MENU_VISIBLE_IN_BREADCRUMB,
'file' => $this->entityInfo['admin ui']['file'],
'file path' => $this->entityInfo['admin ui']['file path'],
);
$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 . '/accept'] = 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(
'accept',
$this->entityType,
$id_count,
),
'type' => MENU_CALLBACK,
);
return $items;
}