class EntityLegalDocumentUIController in Entity Legal 7
Same name and namespace in other branches
- 7.2 entity_legal.entity_admin.inc \EntityLegalDocumentUIController
Legal Document entity ui controller.
Hierarchy
- class \EntityDefaultUIController
Expanded class hierarchy of EntityLegalDocumentUIController
1 string reference to 'EntityLegalDocumentUIController'
- entity_legal_entity_info in ./
entity_legal.module - Implements hook_entity_info().
File
- ./
entity_legal.entity_admin.inc, line 10 - Admin ui controllers for entity_legal entities.
View source
class EntityLegalDocumentUIController extends EntityDefaultUIController {
/**
* {@inheritdoc}
*/
public function hook_menu() {
$items = parent::hook_menu();
// Remove title callbacks that cause bundle notices.
foreach ($items as &$item) {
if (isset($item['title callback']) && $item['title callback'] == 'entity_ui_get_action_title') {
unset($item['title callback']);
$item['title'] = ucfirst($item['title arguments'][0]);
}
}
return $items;
}
/**
* Returns the operation count for calculating colspans.
*/
protected function operationCount() {
return 4;
}
/**
* {@inheritdoc}
*/
protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {
$entity_uri = entity_uri($this->entityType, $entity);
$row[] = array(
'data' => array(
'#theme' => 'entity_ui_overview_item',
'#label' => check_plain(entity_label($this->entityType, $entity)),
'#name' => !empty($this->entityInfo['exportable']) ? entity_id($this->entityType, $entity) : FALSE,
'#url' => $entity_uri ? $entity_uri : FALSE,
'#entity_type' => $this->entityType,
),
);
// Add a row for the exportable status.
$row[] = array(
'data' => array(
'#theme' => 'entity_status',
'#status' => $entity->{$this->statusKey},
),
);
// Add operations depending on the status.
if (entity_has_status($this->entityType, $entity, ENTITY_FIXED)) {
$row[] = array(
'data' => l(t('clone'), $this->path . '/manage/' . $id . '/clone'),
'colspan' => $this
->operationCount(),
);
}
else {
$row[] = l(t('edit'), $this->path . '/manage/' . $id);
$row[] = l(t('clone'), $this->path . '/manage/' . $id . '/clone');
if (empty($this->entityInfo['exportable']) || !entity_has_status($this->entityType, $entity, ENTITY_IN_CODE)) {
$row[] = l(t('delete'), $this->path . '/manage/' . $id . '/delete', array(
'query' => drupal_get_destination(),
));
}
elseif (entity_has_status($this->entityType, $entity, ENTITY_OVERRIDDEN)) {
$row[] = l(t('revert'), $this->path . '/manage/' . $id . '/revert', array(
'query' => drupal_get_destination(),
));
}
else {
$row[] = '';
}
}
$row[] = l(t('export'), $this->path . '/manage/' . $id . '/export');
return $row;
}
/**
* {@inheritdoc}
*/
public function hook_forms() {
$forms = parent::hook_forms();
// Rewrite form ids to include the module name as a prefix.
$forms[$this->entityType . '_form']['callback'] = 'entity_legal_document_form';
return $forms;
}
}
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 | Applies an operation to the given entity. | |
EntityDefaultUIController:: |
public | function | Entity submit builder invoked via entity_ui_form_submit_build_entity(). | |
EntityDefaultUIController:: |
public | function | Builds the operation form. | |
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:: |
public | function | ||
EntityLegalDocumentUIController:: |
public | function |
Provides definitions for implementing hook_forms(). Overrides EntityDefaultUIController:: |
|
EntityLegalDocumentUIController:: |
public | function |
Provides definitions for implementing hook_menu(). Overrides EntityDefaultUIController:: |
|
EntityLegalDocumentUIController:: |
protected | function |
Returns the operation count for calculating colspans. Overrides EntityDefaultUIController:: |
|
EntityLegalDocumentUIController:: |
protected | function |
Generates the row for the passed entity and may be overridden in order to
customize the rows. Overrides EntityDefaultUIController:: |