You are here

function uc_cart_cart_pane_list in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \uc_cart_cart_pane_list()
  2. 7.3 uc_cart/uc_cart.module \uc_cart_cart_pane_list()
3 calls to uc_cart_cart_pane_list()
uc_cart_cart_panes_form in uc_cart/uc_cart.module
uc_cart_cart_settings_overview in uc_cart/uc_cart.module
uc_cart_view in uc_cart/uc_cart.module

File

uc_cart/uc_cart.module, line 2058

Code

function uc_cart_cart_pane_list($items, $action = NULL) {
  static $panes;
  if (count($panes) > 0 && $action !== 'rebuild') {
    return $panes;
  }
  $panes = module_invoke_all('cart_pane', $items);
  if (!is_array($panes) || count($panes) == 0) {
    return array();
  }
  foreach ($panes as $i => $value) {
    $panes[$i]['enabled'] = variable_get('uc_cap_' . $panes[$i]['id'] . '_enabled', !isset($panes[$i]['enabled']) ? TRUE : $panes[$i]['enabled']);
    $panes[$i]['weight'] = variable_get('uc_cap_' . $panes[$i]['id'] . '_weight', !isset($panes[$i]['weight']) ? 0 : $panes[$i]['weight']);
  }
  usort($panes, 'uc_weight_sort');
  return $panes;
}