Commit 2af1558e authored by Angel Matilla's avatar Angel Matilla
Browse files

added selector for forms 2

parent be25ec69
......@@ -174,17 +174,19 @@ class GEN_EU_Registration_Dashboard {
echo '<h1>GEN EU Registration Dashboard</h1>';
echo '<hr><select id="form-id">';
echo '<form action="#" method="post">';
echo '<hr><select name="form-id">';
foreach ( Gen_EU_Form_Parameters::FORM_PICKER as $slug => $form ) {
echo '<option value="' . esc_attr( $slug ) . '">' . esc_html( $form['label'] ) . '</option>';
}
echo '</select>';
echo '</select></form><hr>';
//$this->form_id = $( '#form-id option:selected' ).text();
$this->form_id = $_POST['form-id'];
echo '<h2>' . $this->form_id . "</h2>";
$this->error_list = new WP_Error();
$data_source = GEN_EU_Caldera_Forms_Data_Collector::get_instance( GEN_EU_Form_Parameters::ID );
//$data_source = $this->form_id;
//$data_source = GEN_EU_Caldera_Forms_Data_Collector::get_instance( GEN_EU_Form_Parameters::ID );
$data_source = $this->form_id;
$dashboard = GEN_EU_Dashboard_Loader::get_instance( $data_source ); // get instance of a singleton.
GEN_EU_Dashboard_Viewer::display_dashboard( $dashboard );
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment