コード例 #1
0
ファイル: preview.php プロジェクト: venturepact/blog
 /**
  * Returns the singleton instance of the class.
  *
  * @since 2.0.2.1
  *
  * @return object The Optin_Monster_Views_Preview object.
  */
 public static function get_instance()
 {
     if (!isset(self::$instance) && !self::$instance instanceof Optin_Monster_Views_Preview) {
         self::$instance = new Optin_Monster_Views_Preview();
     }
     return self::$instance;
 }
コード例 #2
0
ファイル: menu.php プロジェクト: venturepact/blog
 /**
  * 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>';
 }