本文整理汇总了PHP中MessageManager::update_message_status方法的典型用法代码示例。如果您正苦于以下问题:PHP MessageManager::update_message_status方法的具体用法?PHP MessageManager::update_message_status怎么用?PHP MessageManager::update_message_status使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageManager
的用法示例。
在下文中一共展示了MessageManager::update_message_status方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: inbox_display
public static function inbox_display()
{
$success = get_lang('SelectedMessagesDeleted');
$success_read = get_lang('SelectedMessagesRead');
$success_unread = get_lang('SelectedMessagesUnRead');
$html = '';
if (isset($_REQUEST['action'])) {
switch ($_REQUEST['action']) {
case 'mark_as_unread':
$number_of_selected_messages = count($_POST['id']);
if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $index => $message_id) {
MessageManager::update_message_status(api_get_user_id(), $message_id, MESSAGE_STATUS_UNREAD);
}
}
$html .= Display::return_message(api_xml_http_response_encode($success_unread), 'normal', false);
break;
case 'mark_as_read':
$number_of_selected_messages = count($_POST['id']);
if (is_array($_POST['id'])) {
foreach ($_POST['id'] as $index => $message_id) {
MessageManager::update_message_status(api_get_user_id(), $message_id, MESSAGE_STATUS_NEW);
}
}
$html .= Display::return_message(api_xml_http_response_encode($success_read), 'normal', false);
break;
case 'delete':
$number_of_selected_messages = count($_POST['id']);
foreach ($_POST['id'] as $index => $message_id) {
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $message_id);
}
$html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false);
break;
case 'deleteone':
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']);
$html .= Display::return_message(api_xml_http_response_encode($success), 'confirmation', false);
break;
}
}
// display sortable table with messages of the current user
$table = new SortableTable('message_inbox', array('MessageManager', 'get_number_of_messages'), array('MessageManager', 'get_message_data'), 3, 20, 'DESC');
$table->set_header(0, '', false, array('style' => 'width:15px;'));
$table->set_header(1, get_lang('Messages'), false);
$table->set_header(2, get_lang('Date'), true, array('style' => 'width:180px;'));
$table->set_header(3, get_lang('Modify'), false, array('style' => 'width:70px;'));
if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
$parameters['f'] = 'social';
$table->set_additional_parameters($parameters);
}
$table->set_form_actions(array('delete' => get_lang('DeleteSelectedMessages'), 'mark_as_unread' => get_lang('MailMarkSelectedAsUnread'), 'mark_as_read' => get_lang('MailMarkSelectedAsRead')));
$html .= $table->return_table();
return $html;
}