Passed
Push — 1.10.x ( 42afde...b1a5c9 )
by
unknown
155:46 queued 107:18
created
main/inc/lib/message.lib.php 1 patch
Doc Comments   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -639,6 +639,8 @@  discard block
 block discarded – undo
639 639
      * @param  int	message id
640 640
      * @param  int	message user id (receiver user id or sender user id)
641 641
      * @param  int	group id (optional)
642
+     * @param integer $message_id
643
+     * @param integer $message_uid
642 644
      * @return void
643 645
      */
644 646
     public static function delete_message_attachment_file($message_id, $message_uid, $group_id = 0)
@@ -683,7 +685,7 @@  discard block
 block discarded – undo
683 685
      * update messages by user id and message id
684 686
      * @param  int		$user_id
685 687
      * @param  int		$message_id
686
-     * @return resource
688
+     * @return false|null
687 689
      */
688 690
     public static function update_message($user_id, $message_id)
689 691
     {
@@ -703,7 +705,7 @@  discard block
 block discarded – undo
703 705
      * @param int $user_id
704 706
      * @param int $message_id
705 707
      * @param string $type
706
-     * @return bool
708
+     * @return false|null
707 709
      */
708 710
     public static function update_message_status($user_id, $message_id,$type)
709 711
     {
@@ -740,6 +742,7 @@  discard block
 block discarded – undo
740 742
     /**
741 743
      * get messages by group id
742 744
      * @param  int		group id
745
+     * @param integer $group_id
743 746
      * @return array
744 747
      */
745 748
     public static function get_messages_by_group($group_id)
@@ -1477,7 +1480,7 @@  discard block
 block discarded – undo
1477 1480
      * Sort date by desc from a multi-dimensional array
1478 1481
      * @param array $array1  first array to compare
1479 1482
      * @param array $array2  second array to compare
1480
-     * @return bool
1483
+     * @return integer
1481 1484
      */
1482 1485
     public function order_desc_date($array1, $array2)
1483 1486
     {
@@ -1555,7 +1558,6 @@  discard block
 block discarded – undo
1555 1558
     /**
1556 1559
      * @param $id
1557 1560
      * @param array $params
1558
-     * @param string $display
1559 1561
      * @return string
1560 1562
      */
1561 1563
     public static function generate_invitation_form($id, $params = array())
@@ -1644,7 +1646,7 @@  discard block
 block discarded – undo
1644 1646
 
1645 1647
     /**
1646 1648
      * @param string $keyword
1647
-     * @return null|string
1649
+     * @return string
1648 1650
      */
1649 1651
     public static function outbox_display($keyword = '')
1650 1652
     {
Please login to merge, or discard this patch.
main/messages/outbox.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,11 +9,11 @@  discard block
 block discarded – undo
9 9
 api_block_anonymous_users();
10 10
 
11 11
 if (isset($_GET['messages_page_nr'])) {
12
-	if (api_get_setting('allow_social_tool')=='true' &&
13
-        api_get_setting('allow_message_tool')=='true'
12
+	if (api_get_setting('allow_social_tool') == 'true' &&
13
+        api_get_setting('allow_message_tool') == 'true'
14 14
     ) {
15 15
 		$social_link = '';
16
-		if ($_REQUEST['f']=='social') {
16
+		if ($_REQUEST['f'] == 'social') {
17 17
 			$social_link = '&f=social';
18 18
 		}
19 19
 		header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
21 21
 	}
22 22
 }
23 23
 
24
-if (api_get_setting('allow_message_tool')!='true'){
24
+if (api_get_setting('allow_message_tool') != 'true') {
25 25
 	api_not_allowed();
26 26
 }
27 27
 //jquery thickbox already called from main/inc/header.inc.php
28 28
 
29
-$htmlHeadXtra[]='<script language="javascript">
29
+$htmlHeadXtra[] = '<script language="javascript">
30 30
 function enviar(miforma) {
31 31
 	if(confirm("'.get_lang('SureYouWantToDeleteSelectedMessages', '').'"))
32 32
 		miforma.submit();
@@ -53,44 +53,44 @@  discard block
 block discarded – undo
53 53
 /*
54 54
 		MAIN CODE
55 55
 */
56
-if (isset($_GET['f']) && $_GET['f']=='social') {
56
+if (isset($_GET['f']) && $_GET['f'] == 'social') {
57 57
 	$this_section = SECTION_SOCIAL;
58
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
59
-	$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
58
+	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/social/home.php', 'name' => get_lang('Social'));
59
+	$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
60 60
 } else {
61 61
 	$this_section = SECTION_MYPROFILE;
62
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
63
-	$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
62
+	$interbreadcrumb[] = array('url' => api_get_path(WEB_PATH).'main/auth/profile.php', 'name' => get_lang('Profile'));
63
+	$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Outbox'));
64 64
 }
65 65
 
66 66
 $actions = '';
67 67
 if (api_get_setting('extended_profile') == 'true') {
68 68
     if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
69
-        $actions .=  '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
69
+        $actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
70 70
     }
71 71
     if (api_get_setting('allow_message_tool') == 'true') {
72 72
         //echo '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png').' '.get_lang('Messages').'</a>';
73
-        $actions .=  '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
74
-        $actions .=  '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
75
-        $actions .=  '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
73
+        $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>';
74
+        $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.Display::return_icon('inbox.png', get_lang('Inbox')).'</a>';
75
+        $actions .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.Display::return_icon('outbox.png', get_lang('Outbox')).'</a>';
76 76
     }
77 77
 }
78 78
 
79 79
 
80
-$info_delete_outbox =array();
81
-$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',',$_GET['form_delete_outbox']) : '';
80
+$info_delete_outbox = array();
81
+$info_delete_outbox = isset($_GET['form_delete_outbox']) ? explode(',', $_GET['form_delete_outbox']) : '';
82 82
 $count_delete_outbox = count($info_delete_outbox) - 1;
83 83
 
84
-if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') {
84
+if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0]) == 'delete') {
85 85
     for ($i = 1; $i <= $count_delete_outbox; $i++) {
86
-		MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
86
+		MessageManager::delete_message_by_user_sender(api_get_user_id(), $info_delete_outbox[$i]);
87 87
 	}
88
-    $message_box=get_lang('SelectedMessagesDeleted').
88
+    $message_box = get_lang('SelectedMessagesDeleted').
89 89
         '&nbsp
90 90
         <br><a href="../social/index.php?#remote-tab-3">'.
91 91
         get_lang('BackToOutbox').
92 92
         '</a>';
93
-    Display::display_normal_message(api_xml_http_response_encode($message_box),false);
93
+    Display::display_normal_message(api_xml_http_response_encode($message_box), false);
94 94
     exit;
95 95
 }
96 96
 
@@ -117,23 +117,23 @@  discard block
 block discarded – undo
117 117
 }
118 118
 //MAIN CONTENT
119 119
 if ($action == 'delete') {
120
-    $delete_list_id=array();
120
+    $delete_list_id = array();
121 121
     if (isset($_POST['out'])) {
122
-        $delete_list_id=$_POST['out'];
122
+        $delete_list_id = $_POST['out'];
123 123
     }
124 124
     if (isset($_POST['id'])) {
125
-        $delete_list_id=$_POST['id'];
125
+        $delete_list_id = $_POST['id'];
126 126
     }
127 127
     for ($i = 0; $i < count($delete_list_id); $i++) {
128 128
         MessageManager::delete_message_by_user_sender(api_get_user_id(), $delete_list_id[$i]);
129 129
     }
130
-    $delete_list_id=array();
130
+    $delete_list_id = array();
131 131
     $social_right_content .= MessageManager::outbox_display($keyword);
132 132
 } elseif ($action == 'deleteone') {
133 133
     $delete_list_id = array();
134 134
     $id = Security::remove_XSS($_GET['id']);
135 135
     MessageManager::delete_message_by_user_sender(api_get_user_id(), $id);
136
-    $delete_list_id=array();
136
+    $delete_list_id = array();
137 137
     $social_right_content .= MessageManager::outbox_display($keyword);
138 138
 } else {
139 139
     $social_right_content .= MessageManager::outbox_display($keyword);
Please login to merge, or discard this patch.