function _checkout_pane_list in Ubercart 6.2
Same name and namespace in other branches
- 5 uc_cart/uc_cart_checkout_pane.inc \_checkout_pane_list()
Builds a list of checkout panes defined in the enabled modules.
4 calls to _checkout_pane_list()
- uc_cart_checkout_form in uc_cart/
uc_cart.pages.inc - The checkout form built up from the enabled checkout panes.
- uc_cart_checkout_panes_form in uc_cart/
uc_cart.admin.inc - Settings for panes on the checkout page.
- uc_cart_checkout_review in uc_cart/
uc_cart.pages.inc - Allows a customer to review their order before finally submitting it.
- _checkout_pane_data in uc_cart/
uc_cart_checkout_pane.inc - Returns data from a checkout pane by pane ID and the array key.
File
- uc_cart/
uc_cart_checkout_pane.inc, line 532 - Callbacks for the default Ubercart checkout panes and their corresponding helper functions.
Code
function _checkout_pane_list($action = NULL) {
static $panes;
if (count($panes) > 0 && $action !== 'rebuild') {
return $panes;
}
$panes = module_invoke_all('checkout_pane', NULL);
// Set the global default values first
foreach ($panes as $i => $value) {
$panes[$i]['enabled'] = variable_get('uc_pane_' . $panes[$i]['id'] . '_enabled', !isset($panes[$i]['enabled']) ? TRUE : $panes[$i]['enabled']);
$panes[$i]['weight'] = variable_get('uc_pane_' . $panes[$i]['id'] . '_weight', !isset($panes[$i]['weight']) ? 0 : $panes[$i]['weight']);
}
// Allow other modules to alter the panes.
drupal_alter('checkout_pane', $panes);
// Make sure that all the required attributes are set
foreach ($panes as $i => $value) {
$panes[$i]['enabled'] = !isset($panes[$i]['enabled']) ? TRUE : $panes[$i]['enabled'];
$panes[$i]['weight'] = !isset($panes[$i]['weight']) ? 0 : $panes[$i]['weight'];
$panes[$i]['review'] = !isset($panes[$i]['review']) ? TRUE : $panes[$i]['review'];
$panes[$i]['process'] = !isset($panes[$i]['process']) ? TRUE : $panes[$i]['process'];
$panes[$i]['collapsible'] = !isset($panes[$i]['collapsible']) ? TRUE : $panes[$i]['collapsible'];
}
usort($panes, 'uc_weight_sort');
return $panes;
}