/**
  * Private Messages - Menu
  */
 public function pm_menu()
 {
     if (ee()->session->userdata('can_send_private_messages') != 'y' && ee()->session->userdata('group_id') != '1' or ee()->session->userdata('accept_messages') != 'y') {
         return;
     }
     if (!class_exists('EE_Messages')) {
         require APPPATH . 'libraries/Messages.php';
     }
     $MESS = new EE_Messages();
     $MESS->base_url = $this->_member_path('messages');
     $MESS->allegiance = 'user';
     $MESS->theme_path = $this->theme_path;
     $MESS->MS =& $this;
     $MESS->create_menu();
     return $MESS->menu;
 }
 /** -----------------------------------
 	/**	 Private Messages Manager
 	/** -----------------------------------*/
 function messages()
 {
     $id = !$this->input->get_post('id') ? $this->session->userdata['member_id'] : $this->input->get_post('id');
     if ($id != $this->session->userdata['member_id']) {
         return false;
     }
     if (!class_exists('EE_Messages')) {
         require APPPATH . 'libraries/Messages.php';
     }
     $MESS = new EE_Messages();
     $MESS->manager();
     // If both the title and the crumb variables are empty, then we have something that
     // does not need to be put in the member wrapper, like a popup.  So, we just return
     // the return_date variable and be done with it.
     if ($MESS->title != '' && $MESS->crumb != '') {
         return $this->account_wrapper($MESS->title, $MESS->crumb, $MESS->return_data);
     }
     return $MESS->return_data;
 }
Example #3
0
 /**
  * Private Messages - Menu
  */
 public function pm_menu()
 {
     if (!class_exists('EE_Messages')) {
         require APPPATH . 'libraries/Messages.php';
     }
     if (!EE_Messages::can_send_pm()) {
         return;
     }
     $MESS = new EE_Messages();
     $MESS->base_url = $this->_member_path('messages');
     $MESS->allegiance = 'user';
     $MESS->theme_path = $this->theme_path;
     $MESS->MS =& $this;
     $MESS->create_menu();
     return $MESS->menu;
 }
Example #4
0
	/** ----------------------------------------
	/**  Private Messages - Menu
	/** ----------------------------------------*/
	function pm_menu()
	{
		if (($this->EE->session->userdata['can_send_private_messages'] != 'y' && $this->EE->session->userdata['group_id'] != '1') OR $this->EE->session->userdata['accept_messages'] != 'y')
		{
			return;
		}

		if ( ! class_exists('EE_Messages'))
		{
			require APPPATH.'libraries/Messages'.EXT;
		}

		$MESS = new EE_Messages;
		$MESS->base_url = $this->_member_path('messages');
		$MESS->allegiance  = 'user';
		$MESS->theme_path = $this->theme_path;
		$MESS->MS =& $this;
		
		$MESS->create_menu();
		return $MESS->menu;
	}
 /**
  * This just ensures that when an addon registers a message type that on initial activation/reactivation the defaults the addon sets are taken care of.
  */
 public static function set_defaults()
 {
     //only set defaults if we're not in EE_Maintenance mode
     EE_Registry::instance()->load_helper('Activation');
     EEH_Activation::generate_default_message_templates();
     //for any message types with force activation, let's ensure they are activated
     foreach (self::$_ee_message_type_registry as $mtname => $settings) {
         if ($settings['force_activation']) {
             $MSG = new EE_Messages();
             foreach ($settings['messengers_to_activate_with'] as $messenger) {
                 $MSG->ensure_message_type_is_active($mtname, $messenger);
             }
         }
     }
 }