static function getInstance($xml_path)
 {
     if (self::$instance === null) {
         self::$instance = new RM_XML_Loader($xml_path);
     }
     return self::$instance;
 }
 /**
  * Define the core functionality of the plugin.
  *
  * Set the plugin name and the plugin version that can be used throughout the plugin.
  * Load the dependencies, define the locale, and set the hooks for the admin area and
  * the public-facing side of the site.
  *
  */
 public function __construct()
 {
     $this->plugin_name = 'RegistrationMagic';
     $this->version = RM_PLUGIN_VERSION;
     $this->loader = new RM_Loader();
     $this->set_locale();
     $this->define_global_hooks();
     $this->xml_loader = RM_XML_Loader::getInstance(plugin_dir_path(__FILE__) . 'rm_config.xml');
     $request = new RM_Request($this->xml_loader);
     $params = array('request' => $request, 'xml_loader' => $this->xml_loader);
     $this->controller = new RM_Main_Controller($params);
     $this->define_public_hooks();
     $this->define_admin_hooks();
     $this->add_ob_start($request->req['rm_slug']);
 }
 function execute_login()
 {
     $xml_loader = RM_XML_Loader::getInstance(plugin_dir_path(__FILE__) . 'rm_config.xml');
     $request = new RM_Request($xml_loader);
     $request->setReqSlug('rm_login_form', true);
     $params = array('request' => $request, 'xml_loader' => $xml_loader);
     $this->controller = new RM_Main_Controller($params);
     return $this->controller->run();
 }
 function add_field_autoresponder()
 {
     if (is_admin()) {
         $screen = get_current_screen();
         if ($screen->base == 'admin_page_rm_form_sett_autoresponder') {
             if (self::$editor_counter == 1) {
                 $xml_loader = RM_XML_Loader::getInstance(RM_INCLUDES_DIR . 'rm_config.xml');
                 $request = new RM_Request($xml_loader);
                 $request->setReqSlug('rm_editor_actions_add_email', true);
                 $params = array('request' => $request, 'xml_loader' => $xml_loader);
                 $this->controller = new RM_Main_Controller($params);
                 $this->controller->run();
             }
             self::$editor_counter = self::$editor_counter + 1;
         } elseif ($screen->base == 'registrationmagic_page_rm_invitations_manage') {
             $xml_loader = RM_XML_Loader::getInstance(RM_INCLUDES_DIR . 'rm_config.xml');
             $request = new RM_Request($xml_loader);
             $request->setReqSlug('rm_editor_actions_add_fields_dropdown_invites', true);
             $params = array('request' => $request, 'xml_loader' => $xml_loader);
             $this->controller = new RM_Main_Controller($params);
             $this->controller->run();
         }
     }
 }