You are here

class PartyHatPartyUIController in Party 8.2

Same name and namespace in other branches
  1. 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

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

Namesort descending Modifiers Type Description Overrides
PartyHatPartyUIController::overviewTableHeaders protected function Generates the table headers for the overview table. Overrides PartyUIController::overviewTableHeaders
PartyHatPartyUIController::overviewTableRow protected function Generates the row for the passed entity and may be overridden in order to customize the rows. Overrides PartyUIController::overviewTableRow
PartyUIController::actionsForm public function Builds the actions form.
PartyUIController::hook_menu public function Provides definitions for implementing hook_menu().
PartyUIController::overviewForm public function Builds the entity overview form.