protected function PartyHatPartyUIController::overviewTableRow in Party 7
Same name and namespace in other branches
- 8.2 modules/party_hat/includes/party_hat.entity.inc \PartyHatPartyUIController::overviewTableRow()
Generates the row for the passed entity and may be overridden in order to customize the rows.
Overrides PartyUIController::overviewTableRow
File
- modules/
party_hat/ includes/ party_hat.entity.inc, line 143 - Contains the controller classes for Party entities.
Class
- PartyHatPartyUIController
- Extends the Party UI controller to show a party's hats in the admin list.
Code
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;
}