You are here

function party_get_party_piece_info in Party 7

Same name and namespace in other branches
  1. 8.2 party.module \party_get_party_piece_info()

Get all party piece definitions from hook_party_party_pieces().

This is only used by hook_menu() and an admin page so no need to cache.

Return value

An array of party pieces, keyed by path and sorted by weight. Keys in addition to those defined in hook_party_party_pieces():

  • data_set: The id of a data set if this piece is defined from one.
5 calls to party_get_party_piece_info()
party_devel_info_page in ./party.admin.inc
Menu callback of development information.
party_menu in ./party.module
Implements hook_menu().
party_menu_local_tasks_alter in ./party.module
Implements hook_menu_local_tasks_alter().
party_plugin_display_party_piece::options_validate in includes/views/party_plugin_display_party_piece.inc
Validate the options form.
party_settings_pieces_order_form in ./party.admin.inc
Settings form for ordering the party pieces.

File

./party.module, line 607
Provides a generic CRM party entity.

Code

function party_get_party_piece_info() {
  $pieces = module_invoke_all('party_party_pieces');

  // Add in weights from the admin setting.
  $weights = variable_get('party_name_pieces_weights', array());
  foreach ($pieces as $path => $piece) {

    // The weight setting overrides weights defined in the hook.
    if (isset($weights[$path])) {
      $pieces[$path]['weight'] = $weights[$path];
    }
  }

  // Sort pieces array by weight for hook_menu() to figure out the default tab
  // and the admin UI to show them in the right order.
  // drupal_sort_weight() treats a missing weight key as a 0.
  uasort($pieces, 'drupal_sort_weight');
  return $pieces;
}