class PartyHatPartyUIController in Party 7
Same name and namespace in other branches
- 8.2 modules/party_hat/includes/party_hat.entity.inc \PartyHatPartyUIController
Extends the Party UI controller to show a party's hats in the admin list.
Hierarchy
- class \EntityDefaultUIController
- class \PartyUIController
- class \PartyHatPartyUIController
- class \PartyUIController
Expanded class hierarchy of PartyHatPartyUIController
1 string reference to 'PartyHatPartyUIController'
- party_hat_entity_info_alter in modules/
party_hat/ party_hat.module - Implements hook_entity_info_alter().
File
- modules/
party_hat/ includes/ party_hat.entity.inc, line 129 - Contains the controller classes for Party entities.
View source
class PartyHatPartyUIController extends PartyUIController {
/**
* Generates the table headers for the overview table.
*/
protected function overviewTableHeaders($conditions, $rows, $additional_header = array()) {
// Get the basic row from the parent class.
$header = parent::overviewTableHeaders($conditions, $rows, $additional_header);
array_splice($header, 2, 0, t('Hats'));
return $header;
}
protected function overviewTableRow($conditions, $id, $party, $additional_cols = array()) {
// Get the basic row from the parent class.
$row = parent::overviewTableRow($conditions, $id, $party, $additional_cols);
$hats_labels = array();
$hats = party_hat_get_hats($party);
foreach ($hats as $hat) {
$hats_labels[] = $hat->label;
}
if (count($hats_labels)) {
$hats_text = check_plain(implode(', ', $hats_labels));
}
else {
$hats_text = t('None');
}
array_splice($row, 2, 0, $hats_text);
return $row;
}
}
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 | Provides definitions for implementing hook_forms(). | |
EntityDefaultUIController:: |
protected | function | Returns the operation count for calculating colspans. | |
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 | 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:: |
public | function | ||
PartyHatPartyUIController:: |
protected | function |
Generates the table headers for the overview table. Overrides PartyUIController:: |
|
PartyHatPartyUIController:: |
protected | function |
Generates the row for the passed entity and may be overridden in order to
customize the rows. Overrides PartyUIController:: |
|
PartyUIController:: |
public | function | Builds the actions form. | |
PartyUIController:: |
public | function |
Provides definitions for implementing hook_menu(). Overrides EntityDefaultUIController:: |
|
PartyUIController:: |
public | function |
Builds the entity overview form. Overrides EntityDefaultUIController:: |