/** * Returns the singleton instance of the class. * * @since 2.0.0 * * @return object The Optin_Monster_Views_Overview object. */ public static function get_instance() { if (!isset(self::$instance) && !self::$instance instanceof Optin_Monster_Views_Overview) { self::$instance = new Optin_Monster_Views_Overview(); } return self::$instance; }
/** * Outputs the main UI for handling and managing optins. * * @since 2.0.0 */ public function menu_ui() { // Build out the necessary HTML structure. echo '<div id="optin-monster-ui" class="wrap">'; // Serve the UI based on the page being visited. if ($this->load_view()) { switch ($this->view) { case 'overview': require plugin_dir_path($this->base->file) . 'includes/admin/views/overview.php'; Optin_Monster_Views_Overview::get_instance()->view(); break; case 'new': require plugin_dir_path($this->base->file) . 'includes/admin/views/new.php'; Optin_Monster_Views_New::get_instance()->view(); break; case 'edit': require plugin_dir_path($this->base->file) . 'includes/admin/views/edit.php'; Optin_Monster_Views_Edit::get_instance()->view(); break; case 'split': require plugin_dir_path($this->base->file) . 'includes/admin/views/split.php'; Optin_Monster_Views_Split::get_instance()->view(); break; case 'preview': if ($this->is_admin_preview()) { require plugin_dir_path($this->base->file) . 'includes/admin/views/preview.php'; Optin_Monster_Views_Preview::get_instance()->view(); } else { require plugin_dir_path($this->base->file) . 'includes/admin/views/overview.php'; Optin_Monster_Views_Overview::get_instance()->view(); } break; default: do_action('optin_monster_admin_view', $this->view); break; } } // Wrap up the main UI. echo '</div>'; }