示例#1
0
 /**
  * Constructor.
  *
  * @since  1.0.0
  *
  * @param array $data The data what has to be associated with this render.
  */
 public function __construct($data = array())
 {
     static $Simulate = null;
     $this->data = $data;
     /**
      * Actions to execute when constructing the parent View.
      *
      * @since  1.0.0
      * @param object $this The MS_View object.
      */
     do_action('ms_view_construct', $this);
     if (null === $Simulate && MS_Model_Simulate::can_simulate()) {
         $Simulate = MS_Factory::load('MS_Model_Simulate');
         self::$is_simulating = $Simulate->is_simulating();
     }
 }
 /**
  * Customize the Admin Toolbar.
  *
  * Related Action Hooks:
  * - wp_before_admin_bar_render
  *
  * @since  1.0.0
  */
 public function customize_toolbar()
 {
     if (MS_Model_Member::is_admin_user() && MS_Plugin::is_enabled() && !is_network_admin() && MS_Model_Simulate::can_simulate()) {
         if ($this->simulate->is_simulating()) {
             $this->add_detail_nodes();
         } else {
             $this->add_test_membership_node();
         }
     } else {
         if (!MS_Plugin::is_enabled()) {
             $this->add_unprotected_node();
         }
     }
 }