You are here

class PartyHatPartyUIController in Party 7

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

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
EntityDefaultUIController::$entityInfo protected property
EntityDefaultUIController::$entityType protected property
EntityDefaultUIController::$id_count protected property
EntityDefaultUIController::$overviewPagerLimit public property Defines the number of entries to show per page in overview table.
EntityDefaultUIController::applyOperation public function Applies an operation to the given entity.
EntityDefaultUIController::entityFormSubmitBuildEntity public function Entity submit builder invoked via entity_ui_form_submit_build_entity().
EntityDefaultUIController::hook_forms public function Provides definitions for implementing hook_forms().
EntityDefaultUIController::operationCount protected function Returns the operation count for calculating colspans.
EntityDefaultUIController::operationForm public function Builds the operation form.
EntityDefaultUIController::operationFormSubmit public function Operation form submit callback. 1
EntityDefaultUIController::operationFormValidate public function Operation form validation callback.
EntityDefaultUIController::overviewFormSubmit public function Overview form submit callback.
EntityDefaultUIController::overviewFormValidate public function Overview form validation callback.
EntityDefaultUIController::overviewTable public function Generates the render array for a overview table for arbitrary entities matching the given conditions.
EntityDefaultUIController::__construct public function
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(). Overrides EntityDefaultUIController::hook_menu
PartyUIController::overviewForm public function Builds the entity overview form. Overrides EntityDefaultUIController::overviewForm