Commit be25ec69 authored by Angel Matilla's avatar Angel Matilla
Browse files

added selector for forms

parent 66018d26
......@@ -2,7 +2,7 @@
/**
* Plugin Name: GEN EU Registration Dashboard
* Description: This is a plugin to display information about the registration process of conferences and events.
* Version: 1.0.1
* Version: 1.0.2
* Author: Rodrigo Espirito Santo Braga
*
* @package GEN_EU_Registration_Tracker
......
......@@ -88,4 +88,16 @@ abstract class GEN_EU_Form_Parameters {
* Delegate Organisation
*/
const ORGANISATION = 'please_enter_the_name_of_the_community__national_network_you_are_a_delegate_for';
/**
* Form picker
*/
const FORM_PICKER = array(
'CF5c1a2c5ed240f' => [
'label' => '2019',
],
'CF5dc98223176e6' => [
'label' => '2020',
],
);
}
......@@ -44,6 +44,14 @@ class GEN_EU_Registration_Dashboard {
* @var string $version The current version of the plugin.
*/
protected $version;
/**
* The ID of the form to display.
*
* @since 1.0.2
* @access protected
* @var string $form_id The ID of the form to display.
*/
protected $form_id;
/**
* List of errors occurred.
*
......@@ -166,8 +174,17 @@ class GEN_EU_Registration_Dashboard {
echo '<h1>GEN EU Registration Dashboard</h1>';
echo '<hr><select id="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>';
//$this->form_id = $( '#form-id option:selected' ).text();
$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;
$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