class PartyHatPartyUIController in Party 8.2
Same name and namespace in other branches
- 7 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 \PartyUIController extends \EntityDefaultUIController
- class \PartyHatPartyUIController
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 |
---|---|---|---|---|
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(). | |
PartyUIController:: |
public | function | Builds the entity overview form. |