ci_pm  0.9
CodeIgniter Private Messaging Plugin
 All Data Structures Functions
Public Member Functions | Data Fields
Pm Class Reference

Pm Controller. More...

Inheritance diagram for Pm:

Public Member Functions

 __construct ()
 PM constructor. More...
 
 initialize ($dateformat="Y.m.d - H:i:s")
 initialize More...
 
 index ()
 CI index function. More...
 
 message ($msg_id)
 Show a specific message. More...
 
 messages ($type=MSG_NONDELETED)
 Show messages. More...
 
 send ($recipients=NULL, $subject=NULL, $body=NULL)
 Send message. More...
 
 delete ($msg_id, $type=MSG_NONDELETED, $redirect=TRUE)
 Delete message. More...
 
 restore ($msg_id, $redirect=TRUE)
 Restore message. More...
 
 render ($message_body)
 Render message text. More...
 

Data Fields

 $base_uri = '/pm/'
 

Detailed Description

Pm Controller.

Some methods in this controller will set a flashdata status message to be used by the views they load. (e.g. messages) Most methods also pass variables to the views they load. All output passed on to the views is documented in each controller method description. This controller does not care what user the actions are performed for: that is entirely determined in the model class.

Copyright (c) 2015 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Balint Morvai
Version
0.9

Constructor & Destructor Documentation

__construct ( )

PM constructor.

Returns
void

Member Function Documentation

delete (   $msg_id,
  $type = MSG_NONDELETED,
  $redirect = TRUE 
)

Delete message.

Delete a message from inbox or sent-folder (move to trash). If 3rd parameter "redirect" is TRUE, redirect to the view specified by 2nd parameter "type". Usually this will be the same view the user deleted the message from. Views loaded: - (no view loaded since redirect). Flashdata for view redirected to: 'status'.

Parameters
msg_idinteger: message to delete by msg id.
typeinteger: messages view type to redirect to, e.g. MSG_SENT messages.
redirectbool: indicating whether to redirect to a view after msg deleted.
Returns
void
index ( )

CI index function.

CI index function called if no other is specified

Returns
void
initialize (   $dateformat = "Y.m.d - H:i:s")

initialize

Initializes values for this class.

Parameters
dateformatstring: format to display dates in
Returns
void
message (   $msg_id)

Show a specific message.

Show a specific message by message id. Views loaded: menu, details. Data for 'details' view: $message.

Parameters
msg_idinteger: id of the message to get
Returns
void
messages (   $type = MSG_NONDELETED)

Show messages.

Show messages. Views loaded: menu, list. Data for 'list' view: $messages (associative array|array|string).

Parameters
typeinteger: message type to get. Use one of the following: MSG_NONDELETED: received by user, not deleted; MSG_DELETED: received by user, deleted; MSG_UNREAD: received by user, not deleted, not read; MSG_SENT: sent by user (no trashbin, i.e. no deleted state); $type < 0: get ALL messages, deleted or not, sent to or by this user;
Returns
void
render (   $message_body)

Render message text.

Render the message body text.

Parameters
message_bodystring: text of the message body to be rendered
Returns
string
restore (   $msg_id,
  $redirect = TRUE 
)

Restore message.

Restore a message from trash: move to inbox or sent-folder, depending on where it was deleted from. The method determines which is correct. If 2nd parameter "redirect" is TRUE, redirect to trash view. Views loaded: - (no view loaded since redirect). Flashdata for view redirected to: 'status'.

Parameters
msg_idinteger: message to restore by msg id.
redirectbool: indicating whether to redirect to a view after msg deleted.
Returns
void
send (   $recipients = NULL,
  $subject = NULL,
  $body = NULL 
)

Send message.

Send a new message to the users given by username, with the given subject and given text body. Views loaded: menu, compose. Data for 'compose' view: $found_recipients (bool), $suggestions (array|string), $status (string), $message (associative array|string). Flashdata for 'compose' view: 'status'.

Parameters
recipientsarray|string: array with usernames
subjectstring: message subject
bodystring: message text
Returns
void

The documentation for this class was generated from the following file: