mypage_messaging.module File Reference

Provides the messaging subsystem for private messages. More...


Enumerations

enum  MYPAGE_MSTATUS_DRAFT
enum  MYPAGE_MSTATUS_NEW
enum  MYPAGE_MSTATUS_READ
enum  MYPAGE_MTYPE_MESSAGE
enum  MYPAGE_MTYPE_BULLETIN

Functions

 mypage_messaging_init ()
 Implements the init hook. Performs startup tasks.
 mypage_messaging_mypage ($type, &$data, $uid)
 Implements MyPage hook defined in mypage_module_invoke($type, $page, $uid).
 mypage_messaging_send_message ($message)
 Provides public interface for adding a message.
 mypage_messaging_get_message ($mid)
 Provides public interface for retrieving a message.
 mypage_messaging_get_message_stack ()
 Returns the queued message stack for the user.
 mypage_messaging_get_new_count ()
 Returns the new message count.
 mypage_messaging_delete_message ($mid, $uid)
 Provides public interface for deleting a message.
 mypage_messaging_message_access ($mid, $uid)
 Determines access to a message.


Detailed Description

Provides the messaging subsystem for private messages.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/06
This module provides all functionality and framework for the site's internal messaging including private messages and bulletins.

Enumeration Type Documentation

enum MYPAGE_MSTATUS_DRAFT

Defines the message status of draft (1).

enum MYPAGE_MSTATUS_NEW

Defines the message status of new (2).

enum MYPAGE_MSTATUS_READ

Defines the message status of read (3).

enum MYPAGE_MTYPE_BULLETIN

Defines the message type bulletin (2).

enum MYPAGE_MTYPE_MESSAGE

Defines the message type message (1).


Function Documentation

bool mypage_messaging_delete_message ( mid,
uid 
)

Provides public interface for deleting a message.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/06
Parameters:
$mid The message id to delete.
$uid The user id requesting the action.
Returns:
This function always returns true.

array mypage_messaging_get_message ( mid  ) 

Provides public interface for retrieving a message.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/06
Parameters:
$mid The id of the message being requested.
Returns:
This function, if successful, returns an array containing the message which consists of the following keyed data:
'to' => The user id of the user the message is going to.
'from' => The user id of the user the message is coming from.
'subject' => The subject of the message.
'message' => The message.
'type' => The message type (text readable).

array mypage_messaging_get_message_stack (  ) 

Returns the queued message stack for the user.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/13

integer mypage_messaging_get_new_count (  ) 

Returns the new message count.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/13

null mypage_messaging_init (  ) 

Implements the init hook. Performs startup tasks.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/12
This function pulls all of the messages owned by the currently logged in user and places them in an array for use by components. The goal of this was to cut down on database hits and limit the database exposure.

bool mypage_messaging_message_access ( mid,
uid 
)

Determines access to a message.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/06
Parameters:
$mid The message id of the message we're checking.
$uid The user id of the user requesting access.

null mypage_messaging_mypage ( type,
&$  data,
uid 
)

Implements MyPage hook defined in mypage_module_invoke($type, $page, $uid).

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/08
Parameters:
$type The type of operation being performed.
&$data The page being constructed. Passed by reference.
$uid The user id of the user being operated on.
Returns:
Function returns nothing.
Function is called by other components or the core to perform certain, predefined actions, indicated by $type.

bool mypage_messaging_send_message ( message  ) 

Provides public interface for adding a message.

Author:
Jacob Steelsmith 'jacob@steelsmith.org'
Date:
2008/04/06
Parameters:
$message - keyed array containing the message data. The array passed must contain:
'to' => user id of the user the message is is going to.
'from' => user id of the user sending the message is coming from.
'subject' => The subject of the message. 255 characters max.
'message' => The message text. The DB uses a text data type for the message column which holds 65k+ characters. We're limiting the messages to 5000 characters.
'type' => A supported type (currently message or bulletin. Can be text or integer id.
Returns:
Returns true for success or false for failure.


Generated on Sun Apr 13 23:02:21 2008 for mypage by  doxygen 1.5.3