'.__('Message from').': '.print_username ($config["id_user"], true).'
'.__('Message to').': '; $users_full = get_group_users(array_keys(get_user_groups())); $users = array(); foreach ($users_full as $user_id => $user_info) { $users[$user_info['id_user']] = $user_info['fullname']; } $groups = get_user_groups ($config["id_user"], "AR"); //Get a list of all groups print_select ($users, "dest_user", $dest_user, '', __('-Select user-'), false, false, false, '', false); echo ' - '.__('OR').' - '; print_select_groups($config["id_user"], "AR", true, "dest_group", $dest_group, '', __('-Select group-'), false, false, false, '', false); echo '
'.__('Subject').':'; print_input_text ("subject", $subject, '', 50, 70, false); echo '
'.__('Message').':'; print_textarea ("mensaje", 15, 70, $message, '', false); echo '
'; print_submit_button (__('Send message'), 'send_mes', false, 'class="sub wand"', false); echo '
'; } elseif (isset ($_GET["read_message"])) { // print_page_header (__('Messages'). " » ".__('Read message'), "images/email.png", false, "", false, "" ); $message_id = (int) get_parameter ("read_message"); $message = get_message ($message_id); if ($message == false) { echo '
'.__('This message does not exist in the system').'
'; return; //Move out of this page and go processing other pages } process_message_read ($message_id); echo '
'; // Subject echo ''; // text $order = array("\r\n", "\n", "\r"); $replace = '
'; $parsed_message = str_replace($order, $replace, $message["message"]); echo '
'.__('Message from').': '.print_username ($message["sender"], true).' '.__('at').' '.print_timestamp ($message["timestamp"], true, array ("prominent" => "timestamp")).'
'.__('Subject').': '.$message["subject"].'
'.__('Message').': '.$parsed_message.'
'; //Prevent RE: RE: RE: if (strstr ($message["subject"], "RE:")) { $new_subj = $message["subject"]; } else { $new_subj = "RE: ".$message["subject"]; } //Start the message much like an e-mail reply $new_msg = "\n\n\nOn ".date ($config["date_format"], $message["timestamp"]).' '.get_user_fullname ($message["sender"]).' '.__('wrote').":\n\n".$message["message"]; print_input_hidden ("dest_user", $message["sender"]); print_input_hidden ("subject", urlencode ($new_subj)); print_input_hidden ("message", urlencode ($new_msg)); echo '
'; print_submit_button (__('Reply'), "reply_btn", false, 'class="sub next"'); echo '
'; return; } if (isset ($_GET["read_message"]) || !isset ($_GET["new_msg"])) { // if (empty ($config["pure"]) && !is_ajax ()) { // print_page_header (__('Messages'). " » ".__('Message overview'), "images/email.png", false, "", false, "" ); // } //Get number of messages $num_messages = get_message_count ($config["id_user"]); $order = get_parameter ("msg_overview_order", "status"); $order_dir = get_parameter ("msg_overview_orddir", "ASC"); $messages = get_message_overview ($order, $order_dir); if ($num_messages > 0 && empty ($config["pure"]) && !is_ajax ()) { echo '

'.__('You have').' '.$num_messages.' '.print_image ("images/email.png", true).' '.__('unread message(s)').'.

'; } if (empty ($messages)) { echo '
'.__('There are no messages').'
'; } else { $table->width = "85%"; $table->class = "databox"; $table->cellpadding = 4; $table->cellspacing = 4; $table->head = array (); $table->data = array (); $table->align = array (); $table->size = array (); $table->head[0] = __('Status'); $table->head[1] = __('Sender'); $table->head[2] = __('Subject'); $table->head[3] = __('Timestamp'); $table->head[4] = __('Delete'); $table->align[0] = "center"; $table->align[1] = "center"; $table->align[2] = "center"; $table->align[3] = "center"; $table->align[4] = "center"; $table->size[0] = "20px"; $table->size[1] = "120px"; $table->size[3] = "80px"; $table->size[4] = "20px"; foreach ($messages as $message_id => $message) { $data = array (); $data[0] = ''; if ($message["status"] == 1) { $data[0] .= ''; $data[0] .= print_image ("images/email_open.png", true, array ("border" => 0, "title" => __('Mark as unread'))); $data[0] .= ''; } else { $data[0] .= ''; $data[0] .= print_image ("images/email.png", true, array ("border" => 0, "title" => __('Message unread - click to read'))); $data[0] .= ''; } $data[1] = print_username ($message["sender"], true); $data[2] = ''; if ($message["subject"] == "") { $data[2] .= __('No Subject'); } else { $data[2] .= $message["subject"]; } $data[2] .= ''; $data[3] = print_timestamp ($message["timestamp"], true, array ("prominent" => "timestamp")); $data[4] = print_input_image ("delete_message", "images/cross.png", $message_id, 'border:0px;', true); array_push ($table->data, $data); } echo '
'; print_table ($table); echo '
'; } echo '
'; echo '
'; print_submit_button (__('New message'), "send_mes", false, 'class="sub next"'); echo '
'; } ?>