|
@@ -713,7 +713,7 @@ discard block |
|
|
block discarded – undo |
|
713
|
713
|
* @param string $type |
|
714
|
714
|
* @return bool |
|
715
|
715
|
*/ |
|
716
|
|
- public static function update_message_status($user_id, $message_id,$type) |
|
|
716
|
+ public static function update_message_status($user_id, $message_id, $type) |
|
717
|
717
|
{ |
|
718
|
718
|
$type = intval($type); |
|
719
|
719
|
if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) { |
|
@@ -1048,7 +1048,7 @@ discard block |
|
|
block discarded – undo |
|
1048
|
1048
|
|
|
1049
|
1049
|
$receiverUserInfo = api_get_user_info($row['user_receiver_id']); |
|
1050
|
1050
|
|
|
1051
|
|
- $message_content .='<tr>'; |
|
|
1051
|
+ $message_content .= '<tr>'; |
|
1052
|
1052
|
if (api_get_setting('allow_social_tool') == 'true') { |
|
1053
|
1053
|
if ($source == 'outbox') { |
|
1054
|
1054
|
$message_content .= get_lang('From').': <a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_sender_id.'">'.$name.'</a> '. |
|
@@ -1064,7 +1064,7 @@ discard block |
|
|
block discarded – undo |
|
1064
|
1064
|
$message_content .= get_lang('From').': '.$name.'</b> '.api_strtolower(get_lang('To')).' <b>'.get_lang('Me').'</b>'; |
|
1065
|
1065
|
} |
|
1066
|
1066
|
} |
|
1067
|
|
- $message_content .=' '.get_lang('Date').': '.api_get_local_time($row['send_date']).' |
|
|
1067
|
+ $message_content .= ' '.get_lang('Date').': '.api_get_local_time($row['send_date']).' |
|
1068
|
1068
|
<br /> |
|
1069
|
1069
|
<hr style="color:#ddd" /> |
|
1070
|
1070
|
<table height="209px" width="100%"> |
|
@@ -1090,7 +1090,7 @@ discard block |
|
|
block discarded – undo |
|
1090
|
1090
|
$message_content .= '<a href="inbox.php?action=deleteone&id='.$message_id.'&'.$social_link.'" >'. |
|
1091
|
1091
|
Display::return_icon('delete.png', get_lang('DeleteMessage')).'</a> '; |
|
1092
|
1092
|
|
|
1093
|
|
- $message_content .='</div></td> |
|
|
1093
|
+ $message_content .= '</div></td> |
|
1094
|
1094
|
<td width=10></td> |
|
1095
|
1095
|
</tr> |
|
1096
|
1096
|
</table>'; |
|
@@ -1167,7 +1167,7 @@ discard block |
|
|
block discarded – undo |
|
1167
|
1167
|
|
|
1168
|
1168
|
$items = $topic['count']; |
|
1169
|
1169
|
$reply_label = ($items == 1) ? get_lang('GroupReply') : get_lang('GroupReplies'); |
|
1170
|
|
- $label = Display::label($items.' '.$reply_label); |
|
|
1170
|
+ $label = Display::label($items.' '.$reply_label); |
|
1171
|
1171
|
$topic['title'] = trim($topic['title']); |
|
1172
|
1172
|
|
|
1173
|
1173
|
if (empty($topic['title'])) { |
|
@@ -1277,7 +1277,7 @@ discard block |
|
|
block discarded – undo |
|
1277
|
1277
|
$name = $user_sender_info['complete_name']; |
|
1278
|
1278
|
|
|
1279
|
1279
|
$topic_page_nr = isset($_GET['topics_page_nr']) ? intval($_GET['topics_page_nr']) : null; |
|
1280
|
|
- $links.= '<div id="message-reply-link">'; |
|
|
1280
|
+ $links .= '<div id="message-reply-link">'; |
|
1281
|
1281
|
if (($my_group_role == GROUP_USER_PERMISSION_ADMIN || |
|
1282
|
1282
|
$my_group_role == GROUP_USER_PERMISSION_MODERATOR) || |
|
1283
|
1283
|
$main_message['user_sender_id'] == $current_user_id |
|
@@ -1289,7 +1289,7 @@ discard block |
|
|
block discarded – undo |
|
1289
|
1289
|
'group_id' => $group_id, |
|
1290
|
1290
|
'message_id' => $main_message['id'], |
|
1291
|
1291
|
'action' => 'edit_message_group', |
|
1292
|
|
- 'anchor_topic' => 'topic_' . $main_message['id'], |
|
|
1292
|
+ 'anchor_topic' => 'topic_'.$main_message['id'], |
|
1293
|
1293
|
'topics_page_nr' => $topic_page_nr, |
|
1294
|
1294
|
'items_page_nr' => $items_page_nr, |
|
1295
|
1295
|
'topic_id' => $main_message['id'] |
|
@@ -1319,7 +1319,7 @@ discard block |
|
|
block discarded – undo |
|
1319
|
1319
|
'group_id' => $group_id, |
|
1320
|
1320
|
'message_id' => $main_message['id'], |
|
1321
|
1321
|
'action' => 'reply_message_group', |
|
1322
|
|
- 'anchor_topic' => 'topic_' . $main_message['id'], |
|
|
1322
|
+ 'anchor_topic' => 'topic_'.$main_message['id'], |
|
1323
|
1323
|
'topics_page_nr' => $topic_page_nr, |
|
1324
|
1324
|
'topic_id' => $main_message['id'] |
|
1325
|
1325
|
]); |
|
@@ -1335,10 +1335,10 @@ discard block |
|
|
block discarded – undo |
|
1335
|
1335
|
] |
|
1336
|
1336
|
); |
|
1337
|
1337
|
|
|
1338
|
|
- $links.= '</div>'; |
|
|
1338
|
+ $links .= '</div>'; |
|
1339
|
1339
|
|
|
1340
|
1340
|
$userPicture = $user_sender_info['avatar']; |
|
1341
|
|
- $main_content.= '<div class="message-group-author"> |
|
|
1341
|
+ $main_content .= '<div class="message-group-author"> |
|
1342
|
1342
|
<img src="'.$userPicture.'" alt="'.$name.'" width="32" height="32" title="'.$name.'" /></div>'; |
|
1343
|
1343
|
$user_link = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$main_message['user_sender_id'].'">'.$name.' </a>'; |
|
1344
|
1344
|
|
|
@@ -1351,7 +1351,7 @@ discard block |
|
|
block discarded – undo |
|
1351
|
1351
|
$date = '<div class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($main_message['send_date']).'</div>'; |
|
1352
|
1352
|
} |
|
1353
|
1353
|
$attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>'; |
|
1354
|
|
- $main_content.= '<div class="message-group-content">'.$links.$user_link.' '.$date.$main_message['content'].$attachment.'</div>'; |
|
|
1354
|
+ $main_content .= '<div class="message-group-content">'.$links.$user_link.' '.$date.$main_message['content'].$attachment.'</div>'; |
|
1355
|
1355
|
$main_content = Security::remove_XSS($main_content, STUDENT, true); |
|
1356
|
1356
|
|
|
1357
|
1357
|
$html .= Display::div(Display::div(Display::div($main_content, array('class' => 'group_social_sub_item', 'style' => 'background-color:#fff;')), array('class' => 'group_social_item')), array('class' => 'group_social_grid')); |
|
@@ -1372,18 +1372,18 @@ discard block |
|
|
block discarded – undo |
|
1372
|
1372
|
$files_attachments = self::get_links_message_attachment_files($topic['id']); |
|
1373
|
1373
|
$name = $user_sender_info['complete_name']; |
|
1374
|
1374
|
|
|
1375
|
|
- $links.= '<div id="message-reply-link">'; |
|
|
1375
|
+ $links .= '<div id="message-reply-link">'; |
|
1376
|
1376
|
if (($my_group_role == GROUP_USER_PERMISSION_ADMIN || $my_group_role == GROUP_USER_PERMISSION_MODERATOR) || $topic['user_sender_id'] == $current_user_id) { |
|
1377
|
|
- $links.= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'. |
|
|
1377
|
+ $links .= '<a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.$current_user_id.'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=edit_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Edit').'" title="'.get_lang('Edit').'">'. |
|
1378
|
1378
|
Display :: return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
1379
|
1379
|
} |
|
1380
|
|
- $links.= ' <a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">'; |
|
1381
|
|
- $links.= Display :: return_icon('talk.png', get_lang('Reply')).'</a>'; |
|
1382
|
|
- $links.= '</div>'; |
|
|
1380
|
+ $links .= ' <a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?height=400&width=800&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&message_id='.$topic['id'].'&action=reply_message_group&anchor_topic=topic_'.$topic_id.'&topics_page_nr='.$topic_page_nr.'&items_page_nr='.$items_page_nr.'&topic_id='.$topic_id.'" class="ajax btn" data-size="lg" data-title="'.get_lang('Reply').'" title="'.get_lang('Reply').'">'; |
|
|
1381
|
+ $links .= Display :: return_icon('talk.png', get_lang('Reply')).'</a>'; |
|
|
1382
|
+ $links .= '</div>'; |
|
1383
|
1383
|
|
|
1384
|
1384
|
$userPicture = $user_sender_info['avatar']; |
|
1385
|
1385
|
|
|
1386
|
|
- $html_items.= '<div class="message-group-author"><img src="'.$userPicture.'" alt="'.$name.'" width="32" height="32" title="'.$name.'" /></div>'; |
|
|
1386
|
+ $html_items .= '<div class="message-group-author"><img src="'.$userPicture.'" alt="'.$name.'" width="32" height="32" title="'.$name.'" /></div>'; |
|
1387
|
1387
|
$user_link = '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$topic['user_sender_id'].'">'.$name.' </a>'; |
|
1388
|
1388
|
|
|
1389
|
1389
|
$date = ''; |
|
@@ -1395,7 +1395,7 @@ discard block |
|
|
block discarded – undo |
|
1395
|
1395
|
$date = '<div class="message-group-date"> '.get_lang('Created').' '.date_to_str_ago($topic['send_date']).'</div>'; |
|
1396
|
1396
|
} |
|
1397
|
1397
|
$attachment = '<div class="message-attach">'.(!empty($files_attachments) ? implode('<br />', $files_attachments) : '').'</div>'; |
|
1398
|
|
- $html_items.= '<div class="message-group-content">'.$links.$user_link.' '.$date.Security::remove_XSS($topic['content'], STUDENT, true).$attachment.'</div>'; |
|
|
1398
|
+ $html_items .= '<div class="message-group-content">'.$links.$user_link.' '.$date.Security::remove_XSS($topic['content'], STUDENT, true).$attachment.'</div>'; |
|
1399
|
1399
|
|
|
1400
|
1400
|
$base_padding = 20; |
|
1401
|
1401
|
|
|
@@ -1679,7 +1679,7 @@ discard block |
|
|
block discarded – undo |
|
1679
|
1679
|
break; |
|
1680
|
1680
|
case 'deleteone' : |
|
1681
|
1681
|
MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']); |
|
1682
|
|
- $html .=Display::return_message(api_xml_http_response_encode($success), 'normal', false); |
|
|
1682
|
+ $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false); |
|
1683
|
1683
|
$html .= '<br/>'; |
|
1684
|
1684
|
break; |
|
1685
|
1685
|
} |
|
@@ -1773,7 +1773,7 @@ discard block |
|
|
block discarded – undo |
|
1773
|
1773
|
ON m.user_sender_id = u.user_id |
|
1774
|
1774
|
WHERE |
|
1775
|
1775
|
m.user_receiver_id = $userId AND |
|
1776
|
|
- m.msg_status = " . MESSAGE_STATUS_UNREAD . " |
|
|
1776
|
+ m.msg_status = ".MESSAGE_STATUS_UNREAD." |
|
1777
|
1777
|
AND m.id > $lastId |
|
1778
|
1778
|
ORDER BY m.send_date DESC"; |
|
1779
|
1779
|
|
|
@@ -1844,11 +1844,11 @@ discard block |
|
|
block discarded – undo |
|
1844
|
1844
|
$tplMailBody = new Template(null, false, false, false, false, false, false); |
|
1845
|
1845
|
$tplMailBody->assign('user', $user); |
|
1846
|
1846
|
$tplMailBody->assign('is_western_name_order', api_is_western_name_order()); |
|
1847
|
|
- $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH) . 'admin/user_edit.php?user_id=' . $user->getId()); |
|
|
1847
|
+ $tplMailBody->assign('manageUrl', api_get_path(WEB_CODE_PATH).'admin/user_edit.php?user_id='.$user->getId()); |
|
1848
|
1848
|
|
|
1849
|
1849
|
$layoutContent = $tplMailBody->get_template('mail/new_user_mail_to_admin.tpl'); |
|
1850
|
1850
|
|
|
1851
|
|
- $emailsubject = '[' . get_lang('UserRegistered') . '] ' . $user->getUsername(); |
|
|
1851
|
+ $emailsubject = '['.get_lang('UserRegistered').'] '.$user->getUsername(); |
|
1852
|
1852
|
$emailbody = $tplMailBody->fetch($layoutContent); |
|
1853
|
1853
|
|
|
1854
|
1854
|
$admins = UserManager::get_all_administrators(); |