/** * Register checkout types for form progress */ function appthemes_register_form_progress_types() { extract(appthemes_form_progress_get_args(), EXTR_SKIP); if (empty($checkout_types)) { return; } foreach ($checkout_types as $key => $params) { if (is_array($params)) { $checkout_type = $key; } else { $checkout_type = $params; $params = array(); } APP_Form_Progress_Checkout_Registry::register($checkout_type, $params); } }
/** * Retrieves the step tree ready for output * @return array The step tree list with title and CSS classes */ protected function generate_step_tree() { $steps_list = APP_Form_Progress_Checkout_Registry::steps($this->checkout_type); $active_steps = $this->get_active_checkout($part = 'steps'); foreach ($steps_list as $key => $step) { // Checkout only - keep only the steps registered by the Checkout module if (!isset($active_steps[$key])) { continue; } if (isset($step['map_to'])) { $s_key = $step['map_to']; $mapped_step = $steps_list[$step['map_to']]; } else { $s_key = $key; $mapped_step = $step; } $steps[$s_key] = $mapped_step; if ($key == $this->current_step) { $current_s_key = $s_key; } } if (!empty($current_s_key)) { $steps[$current_s_key]['current'] = true; } return $this->format_display($steps); }