public function TMGMTDefaultSourceUIController::hook_menu in Translation Management Tool 7
Overrides TMGMTSourceUIControllerInterface::hook_menu
See also
1 call to TMGMTDefaultSourceUIController::hook_menu()
- TMGMTEntityDefaultSourceUIController::hook_menu in sources/
entity/ tmgmt_entity.ui.inc
2 methods override TMGMTDefaultSourceUIController::hook_menu()
- TMGMTEntityDefaultSourceUIController::hook_menu in sources/
entity/ tmgmt_entity.ui.inc - TMGMTNodeSourceUIController::hook_menu in sources/
node/ tmgmt_node.ui.inc
File
- plugin/
tmgmt.ui.source.inc, line 63
Class
- TMGMTDefaultSourceUIController
- Default ui controller class for source plugin.
Code
public function hook_menu() {
$items = array();
if ($types = tmgmt_source_translatable_item_types($this->pluginType)) {
$defaults = array(
'page callback' => 'drupal_get_form',
'access callback' => 'tmgmt_job_access',
'access arguments' => array(
'create',
),
);
if (isset($this->pluginInfo['file'])) {
$defaults['file'] = $this->pluginInfo['file'];
}
if (isset($this->pluginInfo['file path'])) {
$defaults['file path'] = $this->pluginInfo['file path'];
}
foreach ($types as $type => $name) {
$items['admin/tmgmt/sources/' . $this->pluginType . '_' . $type] = $defaults + array(
'title' => check_plain($name),
'page arguments' => array(
'tmgmt_ui_' . $this->pluginType . '_source_' . $type . '_overview_form',
$this->pluginType,
$type,
),
'type' => MENU_LOCAL_TASK,
);
}
}
return $items;
}