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/' | |
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.
__construct | ( | ) |
PM constructor.
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'.
msg_id | integer: message to delete by msg id. |
type | integer: messages view type to redirect to, e.g. MSG_SENT messages. |
redirect | bool: indicating whether to redirect to a view after msg deleted. |
index | ( | ) |
CI index function.
CI index function called if no other is specified
initialize | ( | $dateformat = "Y.m.d - H:i:s" | ) |
initialize
Initializes values for this class.
dateformat | string: format to display dates in |
message | ( | $msg_id | ) |
Show a specific message.
Show a specific message by message id. Views loaded: menu, details. Data for 'details' view: $message.
msg_id | integer: id of the message to get |
messages | ( | $type = MSG_NONDELETED | ) |
Show messages.
Show messages. Views loaded: menu, list. Data for 'list' view: $messages (associative array|array|string).
type | integer: 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; |
render | ( | $message_body | ) |
Render message text.
Render the message body text.
message_body | string: text of the message body to be rendered |
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'.
msg_id | integer: message to restore by msg id. |
redirect | bool: indicating whether to redirect to a view after msg deleted. |
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'.
recipients | array|string: array with usernames |
subject | string: message subject |
body | string: message text |