function __construct() { $path = GFCOmmon::get_base_path() . '/includes/wizard/steps/'; require_once $path . 'class-gf-installation-wizard-step.php'; $classes = array(); foreach (glob($path . 'class-gf-installation-wizard-step-*.php') as $filename) { require_once $filename; $regex = '/class-gf-installation-wizard-step-(.*?).php/'; preg_match($regex, $filename, $matches); $class_name = 'GF_Installation_Wizard_Step_' . str_replace('-', '_', $matches[1]); $step = new $class_name(); $step_name = $step->get_name(); $classes[$step_name] = $class_name; } $sorted = array(); foreach ($this->get_sorted_step_names() as $sorted_step_name) { $sorted[$sorted_step_name] = $classes[$sorted_step_name]; } $this->_step_class_names = $sorted; }
function spgfle_gform_submit_button($button_input, $form) { /** * If the form is called from this plugin */ if (isset($_REQUEST['gform_edit_mode'])) { switch ($_REQUEST['gform_edit_mode']) { case 'view': $button_input = "<button class='button' id='gform_submit_button_{$form["id"]}'><span>" . __("Cancel", 'spgfel') . "</span></button>"; break; case 'addnew': break; case 'delete': $button_input = "<button class='button' id='gform_submit_button_{$form["id"]}'><span>" . __("Delete", 'spgfel') . "</span></button>"; break; case 'update': $button_input = "<button class='button' id='gform_submit_button_{$form["id"]}'><span>" . __("Place Order", 'spgfel') . "</span></button>"; break; } $form_id = (int) $form['id']; if (isset(SpGfListEdit::$lead_ids[$form_id])) { $lead_id = SpGfListEdit::$lead_ids[$form_id]; $button_input .= "<input type=\"hidden\" class=\"gform_hidden\" name=\"gform_lead_id\" value=\"{$lead_id}\" />"; $button_input .= "<input type=\"hidden\" class=\"gform_hidden\" name=\"gform_edit_mode\" value=\"{$_REQUEST['gform_edit_mode']}\" />"; /** * Check if we have post fields */ if (GFCOmmon::has_post_field($form['fields'])) { $lead = RGFormsModel::get_lead($lead_id); $post = get_post(intval($lead['post_id'])); if ($post) { $button_input .= "<input type=\"hidden\" class=\"gform_hidden\" name=\"gform_post_id\" value=\"{$post->ID}\" />"; $button_input .= "<input type=\"hidden\" class=\"gform_hidden\" name=\"gform_post_status\" value=\"{$post->post_status}\" />"; } } } } return $button_input; }