class TMGMTLocalTaskUIController in Translation Management Tool 7
Entity UI controller for the local task entity.
Hierarchy
- class \EntityDefaultUIController
- class \TMGMTLocalTaskUIController
Expanded class hierarchy of TMGMTLocalTaskUIController
1 string reference to 'TMGMTLocalTaskUIController'
- tmgmt_local_entity_info in translators/
tmgmt_local/ tmgmt_local.module - Implements hook_entity_info().
File
- translators/
tmgmt_local/ controller/ tmgmt_local.ui_controller.task.inc, line 6
View source
class TMGMTLocalTaskUIController extends EntityDefaultUIController {
/**
* {@inheritdoc}
*/
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;
}
/**
* {@inheritdoc}
*/
public function operationForm($form, &$form_state, $entity, $op) {
switch ($op) {
case 'delete':
$confirm_question = t('Are you sure you want to delete the translation task %label?', array(
'%label' => $entity
->label(),
));
return confirm_form($form, $confirm_question, $this->path);
case 'unassign':
$confirm_question = t('Are you sure you want to unassign from the translation task %label?', array(
'%label' => $entity
->label(),
));
return confirm_form($form, $confirm_question, $this->path);
}
drupal_not_found();
exit;
}
/**
* {@inheritdoc}
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
protected | property | ||
EntityDefaultUIController:: |
public | property | Defines the number of entries to show per page in overview table. | |
EntityDefaultUIController:: |
public | function | Entity submit builder invoked via entity_ui_form_submit_build_entity(). | |
EntityDefaultUIController:: |
public | function | Provides definitions for implementing hook_forms(). | |
EntityDefaultUIController:: |
protected | function | Returns the operation count for calculating colspans. | |
EntityDefaultUIController:: |
public | function | Operation form submit callback. | 1 |
EntityDefaultUIController:: |
public | function | Operation form validation callback. | |
EntityDefaultUIController:: |
public | function | Builds the entity overview form. | |
EntityDefaultUIController:: |
public | function | Overview form submit callback. | |
EntityDefaultUIController:: |
public | function | Overview form validation callback. | |
EntityDefaultUIController:: |
public | function | Generates the render array for a overview table for arbitrary entities matching the given conditions. | |
EntityDefaultUIController:: |
protected | function | Generates the table headers for the overview table. | |
EntityDefaultUIController:: |
protected | function | Generates the row for the passed entity and may be overridden in order to customize the rows. | |
EntityDefaultUIController:: |
public | function | ||
TMGMTLocalTaskUIController:: |
public | function |
Applies an operation to the given entity. Overrides EntityDefaultUIController:: |
|
TMGMTLocalTaskUIController:: |
public | function |
Provides definitions for implementing hook_menu(). Overrides EntityDefaultUIController:: |
|
TMGMTLocalTaskUIController:: |
public | function |
Builds the operation form. Overrides EntityDefaultUIController:: |