示例#1
0
 /**
  * Main CPM Instance
  *
  * @since 1.2
  * @static
  * @see cpm()
  * @return CPMRP - Main instance
  */
 public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
 /**
  * Instantiate all the required classes
  *
  * @since 0.1
  */
 function instantiate()
 {
     $this->project = CPM_Project::getInstance();
     $this->message = CPM_Message::getInstance();
     $this->task = CPM_Task::getInstance();
     $this->milestone = CPM_Milestone::getInstance();
     $this->activity = CPM_Activity::getInstance();
     $this->ajax = CPM_Ajax::getInstance();
     $this->notification = CPM_Notification::getInstance();
     if (function_exists('json_api_init')) {
         $this->api = CPM_API::instance();
     }
     // instantiate admin settings only on admin page
     if (is_admin()) {
         $this->admin = new CPM_Admin();
         $this->upgrade = new CPM_Upgrade();
     }
     do_action('cpm_instantiate', $this);
 }