You are here

function uc_cart_cart_pane_list in Ubercart 7.3

Same name and namespace in other branches
  1. 5 uc_cart/uc_cart.module \uc_cart_cart_pane_list()
  2. 6.2 uc_cart/uc_cart.module \uc_cart_cart_pane_list()

Gets all of the enabled, sorted cart panes.

Parameters

$items: The contents of the cart.

2 calls to uc_cart_cart_pane_list()
uc_cart_cart_settings_form in uc_cart/uc_cart.admin.inc
General settings for the shopping cart.
uc_cart_view in uc_cart/uc_cart.pages.inc
Displays the cart view page.

File

uc_cart/uc_cart.module, line 1303

Code

function uc_cart_cart_pane_list($items) {
  $panes = array();
  foreach (module_invoke_all('uc_cart_pane', $items) as $id => $pane) {

    // Preserve backward compatibility for panes with no key specified.
    if (is_numeric($id)) {
      $id = $pane['id'];
    }

    // Set defaults.
    $pane += array(
      'id' => $id,
      'enabled' => TRUE,
      'weight' => 0,
      'body' => array(),
    );
    $pane['enabled'] = variable_get('uc_cap_' . $id . '_enabled', $pane['enabled']);
    $pane['weight'] = variable_get('uc_cap_' . $id . '_weight', $pane['weight']);
    $panes[$id] = $pane;
  }

  // Allow other modules to alter the defaults.
  drupal_alter('uc_cart_pane', $panes, $items);
  uasort($panes, 'uc_weight_sort');
  return $panes;
}