function _payment_status_options_level in Payment 7
Helper function for payment_status_options().
Parameters
array $hierarchy: A payment status hierarchy as returned by payment_status_hierarchy().
integer $depth: The depth of $hierarchy's top-level items as seen from the original hierarchy's root (this function is recursive), starting with 0.
Return value
array The return value is identical to that of payment_status_options().
1 call to _payment_status_options_level()
- payment_status_options in ./
payment.ui.inc - Return payment statuses for use in form elements.
File
- ./
payment.ui.inc, line 1134 - The Payment user interface.
Code
function _payment_status_options_level(array $hierarchy, $depth) {
$options = array();
$prefix = $depth ? str_repeat('-', $depth) . ' ' : '';
foreach ($hierarchy as $status => $children) {
$options[$status] = $prefix . payment_status_info($status)->title;
$options += _payment_status_options_level($children, $depth + 1);
}
return $options;
}