Completed
Push — 1.10.x ( 3658ba...81c9ff )
by
unknown
91:59 queued 46:43
created
main/inc/ajax/model.ajax.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $action = $_GET['a'];
12 12
 $page = intval($_REQUEST['page']); //page
13 13
 $limit = intval($_REQUEST['rows']); //quantity of rows
14
-$sidx = $_REQUEST['sidx'];         //index (field) to filter
15
-$sord = $_REQUEST['sord'];         //asc or desc
14
+$sidx = $_REQUEST['sidx']; //index (field) to filter
15
+$sord = $_REQUEST['sord']; //asc or desc
16 16
 
17 17
 if (strpos(strtolower($sidx), 'asc') !== false) {
18 18
     $sidx = str_replace(array('asc', ','), '', $sidx);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $sord = 'desc';
25 25
 }
26 26
 
27
-if (!in_array($sord, array('asc','desc'))) {
27
+if (!in_array($sord, array('asc', 'desc'))) {
28 28
     $sord = 'desc';
29 29
 }
30 30
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 function getWhereClause($col, $oper, $val)
65 65
 {
66 66
     $ops = array(
67
-        'eq' => '=',        //equal
68
-        'ne' => '<>',       //not equal
69
-        'lt' => '<',        //less than
70
-        'le' => '<=',       //less than or equal
71
-        'gt' => '>',        //greater than
72
-        'ge' => '>=',       //greater than or equal
73
-        'bw' => 'LIKE',     //begins with
67
+        'eq' => '=', //equal
68
+        'ne' => '<>', //not equal
69
+        'lt' => '<', //less than
70
+        'le' => '<=', //less than or equal
71
+        'gt' => '>', //greater than
72
+        'ge' => '>=', //greater than or equal
73
+        'bw' => 'LIKE', //begins with
74 74
         'bn' => 'NOT LIKE', //doesn't begin with
75
-        'in' => 'LIKE',     //is in
75
+        'in' => 'LIKE', //is in
76 76
         'ni' => 'NOT LIKE', //is not in
77
-        'ew' => 'LIKE',     //ends with
77
+        'ew' => 'LIKE', //ends with
78 78
         'en' => 'NOT LIKE', //doesn't end with
79
-        'cn' => 'LIKE',     //contains
79
+        'cn' => 'LIKE', //contains
80 80
         'nc' => 'NOT LIKE'  //doesn't contain
81 81
     );
82 82
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 // If there is no search request sent by jqgrid, $where should be empty
102 102
 $whereCondition = null;
103
-$operation = isset($_REQUEST['oper'])  ? $_REQUEST['oper']  : false;
104
-$exportFormat = isset($_REQUEST['export_format'])  ? $_REQUEST['export_format']  : 'csv';
105
-$searchField = isset($_REQUEST['searchField'])  ? $_REQUEST['searchField']  : false;
106
-$searchOperator = isset($_REQUEST['searchOper'])   ? $_REQUEST['searchOper']   : false;
103
+$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false;
104
+$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv';
105
+$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false;
106
+$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false;
107 107
 $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false;
108 108
 $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
109 109
 $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             foreach ($filters->rules as $key => $rule) {
168 168
                 $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data);
169 169
 
170
-                if ($counter < count($filters->rules) -1) {
170
+                if ($counter < count($filters->rules) - 1) {
171 171
                     $whereCondition .= $filters->groupOp;
172 172
                 }
173 173
                 $counter++;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
203 203
         $courseCodeList = array();
204
-        $userIdList  = array();
204
+        $userIdList = array();
205 205
         $sessionIdList = [];
206 206
         $searchByGroups = false;
207 207
         if (api_is_drh()) {
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 $total_pages = 0;
555 555
 if ($count > 0) {
556 556
     if (!empty($limit)) {
557
-        $total_pages = ceil((float)$count/(float)$limit);
557
+        $total_pages = ceil((float) $count / (float) $limit);
558 558
     }
559 559
 }
560 560
 if ($page > $total_pages) {
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
         $result = getWorkListStudent($start, $limit, $sidx, $sord, $whereCondition);
794 794
         break;
795 795
     case 'get_work_user_list_all':
796
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
796
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
797 797
             $columns = array(
798 798
                 //'type',
799 799
                 'firstname',
@@ -820,18 +820,18 @@  discard block
 block discarded – undo
820 820
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
821 821
         break;
822 822
     case 'get_work_user_list_others':
823
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
823
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
824 824
             $columns = array(
825
-                'type', 'firstname', 'lastname',  'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
825
+                'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
826 826
             );
827 827
         } else {
828
-            $columns = array('type', 'firstname', 'lastname',  'title', 'sent_date', 'actions');
828
+            $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
829 829
         }
830 830
         $whereCondition .= " AND u.user_id <> ".api_get_user_id();
831 831
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
832 832
         break;
833 833
     case 'get_work_user_list':
834
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
834
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
835 835
             $columns = array(
836 836
                 'type', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
837 837
             );
@@ -859,10 +859,10 @@  discard block
 block discarded – undo
859 859
     case 'get_exercise_results':
860 860
         $course = api_get_course_info();
861 861
         // Used inside ExerciseLib::get_exam_results_data()
862
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
862
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
863 863
         if ($is_allowedToEdit || api_is_student_boss()) {
864 864
             $columns = array(
865
-                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score',  'user_ip', 'status', 'lp', 'actions'
865
+                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions'
866 866
             );
867 867
             $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
868 868
             if ($officialCodeInList === 'true') {
@@ -873,11 +873,11 @@  discard block
 block discarded – undo
873 873
         break;
874 874
     case 'get_hotpotatoes_exercise_results':
875 875
         $course = api_get_course_info();
876
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
876
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
877 877
         if (api_is_allowed_to_edit()) {
878
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
878
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
879 879
         } else {
880
-            $columns = array('exe_date',  'score', 'actions');
880
+            $columns = array('exe_date', 'score', 'actions');
881 881
         }
882 882
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
883 883
         break;
@@ -903,12 +903,12 @@  discard block
 block discarded – undo
903 903
         break;
904 904
     case 'get_hotpotatoes_exercise_results':
905 905
         $course = api_get_course_info();
906
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
906
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
907 907
 
908 908
         if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
909
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
909
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
910 910
         } else {
911
-            $columns = array('exe_date',  'score', 'actions');
911
+            $columns = array('exe_date', 'score', 'actions');
912 912
         }
913 913
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
914 914
         break;
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             );
938 938
         }
939 939
 
940
-        $columns =  array(
940
+        $columns = array(
941 941
             'name',
942 942
             'date',
943 943
             'course_per_session',
@@ -1283,7 +1283,7 @@  discard block
 block discarded – undo
1283 1283
         $result = $new_result;
1284 1284
         break;
1285 1285
     case 'get_gradebooks':
1286
-        $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');
1286
+        $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
1287 1287
         if (!in_array($sidx, $columns)) {
1288 1288
             $sidx = 'name';
1289 1289
         }
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                     if (!empty($exercises[$cnt - 4]['title'])) {
1454 1454
                         $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title'])));
1455 1455
                     }
1456
-                    $columns[] = 'exer' . $i;
1456
+                    $columns[] = 'exer'.$i;
1457 1457
                     $column_names[] = $title;
1458 1458
                     $i++;
1459 1459
                     break;
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
             $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
1487 1487
             $result[$i]['session'] = $sessionInfo['name'];
1488 1488
             $result[$i]['username'] = $user['username'];
1489
-            $result[$i]['name'] = $user['lastname'] . " " . $user['firstname'];
1489
+            $result[$i]['name'] = $user['lastname']." ".$user['firstname'];
1490 1490
             $j = 1;
1491 1491
             $finalScore = 0;
1492 1492
             foreach ($quizIds as $quizID) {
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
                 if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) {
1495 1495
                     $finalScore += $grade = $arrGrade [$user['user_id']][$quizID];
1496 1496
                 }
1497
-                $result[$i]['exer' . $j] = $grade;
1497
+                $result[$i]['exer'.$j] = $grade;
1498 1498
                 $j++;
1499 1499
             }
1500 1500
 
@@ -1666,9 +1666,9 @@  discard block
 block discarded – undo
1666 1666
         foreach ($result as $row) {
1667 1667
             // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
1668 1668
             if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
1669
-                $response->rows[$i]['id']= $i;
1669
+                $response->rows[$i]['id'] = $i;
1670 1670
             } else {
1671
-                $response->rows[$i]['id']= $row['id'];
1671
+                $response->rows[$i]['id'] = $row['id'];
1672 1672
             }
1673 1673
             $array = array();
1674 1674
             foreach ($columns as $col) {
@@ -1678,7 +1678,7 @@  discard block
 block discarded – undo
1678 1678
                     $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : '';
1679 1679
                 }
1680 1680
             }
1681
-            $response->rows[$i]['cell']=$array;
1681
+            $response->rows[$i]['cell'] = $array;
1682 1682
             $i++;
1683 1683
         }
1684 1684
     }
Please login to merge, or discard this patch.
main/social/group_view.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 api_block_anonymous_users();
13 13
 
14
-if (api_get_setting('allow_social_tool') !='true') {
14
+if (api_get_setting('allow_social_tool') != 'true') {
15 15
     api_not_allowed();
16 16
 }
17 17
 
@@ -87,31 +87,31 @@  discard block
 block discarded – undo
87 87
 
88 88
 </script>';
89 89
 
90
-$allowed_views = array('mygroups','newest','pop');
90
+$allowed_views = array('mygroups', 'newest', 'pop');
91 91
 $content = null;
92 92
 
93
-if (isset($_GET['view']) && in_array($_GET['view'],$allowed_views)) {
93
+if (isset($_GET['view']) && in_array($_GET['view'], $allowed_views)) {
94 94
     if ($_GET['view'] == 'mygroups') {
95
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
96
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('MyGroups'));
97
-    } else if ( $_GET['view'] == 'newest') {
98
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
99
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Newest'));
100
-    } else  {
101
-        $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
102
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Popular'));
95
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
96
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('MyGroups'));
97
+    } else if ($_GET['view'] == 'newest') {
98
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
99
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Newest'));
100
+    } else {
101
+        $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
102
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Popular'));
103 103
     }
104 104
 } else {
105
-    $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));
105
+    $interbreadcrumb[] = array('url' =>'groups.php', 'name' => get_lang('Groups'));
106 106
     if (!isset($_GET['id'])) {
107
-        $interbreadcrumb[]= array ('url' =>'#','name' => get_lang('GroupList'));
107
+        $interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('GroupList'));
108 108
     } else {
109 109
         //$interbreadcrumb[]= array ('url' =>'#','name' => get_lang('Group'));
110 110
     }
111 111
 }
112 112
 
113 113
 // getting group information
114
-$group_id	= isset($_GET['id']) ? intval($_GET['id']) : null;
114
+$group_id = isset($_GET['id']) ? intval($_GET['id']) : null;
115 115
 $relation_group_title = '';
116 116
 $role = 0;
117 117
 
@@ -120,9 +120,9 @@  discard block
 block discarded – undo
120 120
 if ($group_id != 0) {
121 121
     $group_info = $usergroup->get($group_id);
122 122
 
123
-    $interbreadcrumb[]= array ('url' =>'#','name' => $group_info['name']);
123
+    $interbreadcrumb[] = array('url' =>'#', 'name' => $group_info['name']);
124 124
 
125
-    if (isset($_GET['action']) && $_GET['action']=='leave') {
125
+    if (isset($_GET['action']) && $_GET['action'] == 'leave') {
126 126
         $user_leaved = intval($_GET['u']);
127 127
         //I can "leave me myself"
128 128
         if (api_get_user_id() == $user_leaved) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         }
134 134
     }
135 135
     // add a user to a group if its open
136
-    if (isset($_GET['action']) && $_GET['action']=='join') {
136
+    if (isset($_GET['action']) && $_GET['action'] == 'join') {
137 137
         // we add a user only if is a open group
138 138
         $user_join = intval($_GET['u']);
139 139
         if (api_get_user_id() == $user_join && !empty($group_id)) {
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 $group_info = $usergroup->get($group_id);
162 162
 
163 163
 //Loading group information
164
-if (isset($_GET['status']) && $_GET['status']=='sent') {
164
+if (isset($_GET['status']) && $_GET['status'] == 'sent') {
165 165
     $social_right_content .= Display::return_message(get_lang('MessageHasBeenSent'), 'confirmation', false);
166 166
 }
167 167
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 if (!$is_group_member && $group_info['visibility'] == GROUP_PERMISSION_CLOSED) {
172 172
     if ($role == GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER) {
173
-        $social_right_content .=  Display::return_message(get_lang('YouAlreadySentAnInvitation'));
173
+        $social_right_content .= Display::return_message(get_lang('YouAlreadySentAnInvitation'));
174 174
     }
175 175
 }
176 176
 
@@ -179,13 +179,13 @@  discard block
 block discarded – undo
179 179
         if (!in_array($role,
180 180
             array(GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER, GROUP_USER_PERMISSION_PENDING_INVITATION))
181 181
         ) {
182
-            $social_right_content .=  '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.
182
+            $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.
183 183
                 get_lang('JoinGroup').'</a>';
184 184
         } elseif ($role == GROUP_USER_PERMISSION_PENDING_INVITATION) {
185
-            $social_right_content .=  '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.
185
+            $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.
186 186
                 get_lang('YouHaveBeenInvitedJoinNow').'</a>';
187 187
         }
188
-        $social_right_content .=  '<br /><br />';
188
+        $social_right_content .= '<br /><br />';
189 189
     }
190 190
     $content = MessageManager::display_messages_for_group($group_id);
191 191
     if ($is_group_member) {
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
         foreach ($members as $member) {
245 245
             // if is a member
246 246
             if (in_array($member['relation_type'],
247
-                array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER,GROUP_USER_PERMISSION_MODERATOR))
247
+                array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_READER, GROUP_USER_PERMISSION_MODERATOR))
248 248
             ) {
249 249
                 //add icons
250 250
                 if ($member['relation_type'] == GROUP_USER_PERMISSION_ADMIN) {
251
-                    $icon= Display::return_icon('social_group_admin.png', get_lang('Admin'));
251
+                    $icon = Display::return_icon('social_group_admin.png', get_lang('Admin'));
252 252
                 } elseif ($member['relation_type'] == GROUP_USER_PERMISSION_MODERATOR) {
253
-                    $icon= Display::return_icon('social_group_moderator.png', get_lang('Moderator'));
253
+                    $icon = Display::return_icon('social_group_moderator.png', get_lang('Moderator'));
254 254
                 } else {
255
-                    $icon= '';
255
+                    $icon = '';
256 256
                 }
257 257
 
258 258
                 $userPicture = UserManager::getUserPicture($member['id']);
259 259
 
260 260
                 $member_content .= '<div class="">';
261
-                $member_name = Display::url(api_get_person_name(cut($member['firstname'],15),cut($member['lastname'],15)).'&nbsp;'.$icon, $member['user_info']['profile_url']);
261
+                $member_name = Display::url(api_get_person_name(cut($member['firstname'], 15), cut($member['lastname'], 15)).'&nbsp;'.$icon, $member['user_info']['profile_url']);
262 262
                 $member_content .= Display::div('<img class="social-groups-image img-circle" src="'.$userPicture.'"/>&nbsp'.$member_name);
263 263
                 $member_content .= '</div>';
264 264
             }
@@ -266,10 +266,10 @@  discard block
 block discarded – undo
266 266
     }
267 267
 
268 268
     if (!empty($create_thread_link)) {
269
-        $create_thread_link =  Display::div($create_thread_link, array('class'=>'pull-right'));
269
+        $create_thread_link = Display::div($create_thread_link, array('class'=>'pull-right'));
270 270
     }
271 271
     $headers = array(get_lang('Discussions'), get_lang('Members'));
272
-    $social_right_content .= Display::tabs($headers, array($content, $member_content),'tabs');
272
+    $social_right_content .= Display::tabs($headers, array($content, $member_content), 'tabs');
273 273
 } else {
274 274
     // if I already sent an invitation message
275 275
     if (!in_array(
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
         )
281 281
     )
282 282
     ) {
283
-        $social_right_content .=  '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
283
+        $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('JoinGroup').'</a>';
284 284
     } elseif ($role == GROUP_USER_PERMISSION_PENDING_INVITATION) {
285
-        $social_right_content .=  '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
285
+        $social_right_content .= '<a class="btn" href="group_view.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.get_lang('YouHaveBeenInvitedJoinNow').'</a>';
286 286
     }
287 287
 }
288 288
 
Please login to merge, or discard this patch.
main/calendar/agenda.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
274 274
             }
275 275
             break;
276 276
         case "delete":
277
-            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId) )) {
277
+            if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $eventId))) {
278 278
                 // a coach can only delete an element belonging to his session
279 279
                 $content = $agenda->deleteEvent($eventId);
280 280
             }
Please login to merge, or discard this patch.
main/attendance/attendance_sheet.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $form = new FormValidator(
25 25
             'filter',
26 26
             'post',
27
-            'index.php?action=attendance_sheet_list&' . api_get_cidreq().'&attendance_id=' . $attendance_id,
27
+            'index.php?action=attendance_sheet_list&'.api_get_cidreq().'&attendance_id='.$attendance_id,
28 28
             null,
29 29
             array(),
30 30
             'inline'
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
                             <th width="100px"><?php echo get_lang('AttendancesFaults')?></th>
218 218
                         </tr>
219 219
                         <tr class="tableFloatingHeaderOriginal" >
220
-                            <th width="10px"><?php echo '#';?></th>
220
+                            <th width="10px"><?php echo '#'; ?></th>
221 221
                             <th width="10px"><?php echo get_lang('Photo')?></th>
222 222
                             <th width="150px"><?php echo get_lang('LastName')?></th>
223 223
                             <th width="140px"><?php echo get_lang('FirstName')?></th>
@@ -231,9 +231,9 @@  discard block
 block discarded – undo
231 231
                         foreach ($users_in_course as $data) {
232 232
                             $faults = 0;
233 233
                             if ($i % 2 == 0) {
234
-                                $class='row_odd';
234
+                                $class = 'row_odd';
235 235
                             } else {
236
-                                $class='row_even';
236
+                                $class = 'row_even';
237 237
                             }
238 238
                             $username = api_htmlentities(sprintf(get_lang('LoginX'), $data['username']), ENT_QUOTES);
239 239
                             ?>
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
                                 <td><span title="<?php echo $username ?>"><?php echo $data['lastname'] ?></span></td>
244 244
                                 <td><?php echo $data['firstname'] ?></td>
245 245
                                 <td>
246
-                                    <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar'])?$data['result_color_bar']:'none') ?>">
246
+                                    <div class="attendance-faults-bar" style="background-color:<?php echo (!empty($data['result_color_bar']) ? $data['result_color_bar'] : 'none') ?>">
247 247
                                         <?php echo $data['attendance_result'] ?>
248 248
                                     </div>
249 249
                                 </td>
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                     foreach ($attendant_calendar as $calendar) {
266 266
                         $date = $calendar['date'];
267 267
                         $time = $calendar['time'];
268
-                        $datetime = '<div class="grey">'. $date . ' - ' . $time . '</div>';
268
+                        $datetime = '<div class="grey">'.$date.' - '.$time.'</div>';
269 269
 
270 270
                         $img_lock = Display::return_icon(
271 271
                             'lock-closed.png',
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
                         );
275 275
 
276 276
                         if (!empty($calendar['done_attendance'])) {
277
-                            $datetime = '<div class="blue">' . $date . ' - ' . $time . '</div>';
277
+                            $datetime = '<div class="blue">'.$date.' - '.$time.'</div>';
278 278
                         }
279 279
                         $disabled_check = 'disabled = "true"';
280 280
                         $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="" disabled />';
281 281
                         if ($next_attendance_calendar_id == $calendar['id']) {
282 282
                             $input_hidden = '<input type="hidden" id="hidden_input_'.$calendar['id'].'" name="hidden_input[]" value="'.$calendar['id'].'" />';
283 283
                             $disabled_check = '';
284
-                            $img_lock = Display::return_icon('lock-closed.png',get_lang('DateLock'),array('class'=>'img_unlock','id'=>'datetime_column_'.$calendar['id']));
284
+                            $img_lock = Display::return_icon('lock-closed.png', get_lang('DateLock'), array('class'=>'img_unlock', 'id'=>'datetime_column_'.$calendar['id']));
285 285
                         }
286 286
 
287 287
                         $result .= '<th>';
288 288
                         $result .= '<div class="date-attendance">'.$datetime.'&nbsp;';
289 289
 
290 290
                         if (api_is_allowed_to_edit(null, true)) {
291
-                            $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>';
291
+                            $result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin() ? $img_lock : '').'</span>';
292 292
                         }
293 293
 
294 294
                         if ($is_locked_attendance == false) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                     }
300 300
                 } else {
301 301
                     $result  = '<th width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">';
302
-                    $result .= Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
302
+                    $result .= Display::return_icon('attendance_calendar.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
303 303
                 }
304 304
 
305 305
                 echo '<tr class="tableFloatingHeader row_odd" style="position: absolute; top: 0px; left: 0px; visibility: hidden; margin:0px;padding:0px">';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
                 $i = 0;
314 314
                 foreach ($users_in_course as $user) {
315 315
                     $class = '';
316
-                    if ($i%2 == 0) {
316
+                    if ($i % 2 == 0) {
317 317
                         $class = 'row_even';
318 318
                     } else {
319 319
                         $class = 'row_odd';
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                                     echo '<input type="checkbox" name="check_presence['.$calendar['id'].'][]" value="'.$user['user_id'].'" '.$disabled.' '.$checked.' />';
361 361
                                     echo '<span class="anchor_'.$calendar['id'].'"></span>';
362 362
                                 } else {
363
-                                    echo $presence ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence'));
363
+                                    echo $presence ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence'));
364 364
                                 }
365 365
                             } else {
366 366
                                 switch ($presence) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
                         </td>';
392 392
                     }
393 393
                     echo '</tr>';
394
-                    $i++ ;
394
+                    $i++;
395 395
                 }
396 396
                 echo '</tbody></table>';
397 397
                 echo '</div></div>';
@@ -419,13 +419,13 @@  discard block
 block discarded – undo
419 419
     echo Display::page_header(get_lang('AttendanceSheetReport'));
420 420
     // View for students
421 421
     ?>
422
-    <?php if(!empty($users_presence)) { ?>
422
+    <?php if (!empty($users_presence)) { ?>
423 423
         <div>
424 424
             <table width="250px;">
425 425
                 <tr>
426 426
                     <td><?php echo get_lang('ToAttend').': ' ?></td>
427 427
                     <td>
428
-                        <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar'])?$faults['color_bar']:'none') ?>">
428
+                        <center><div class="attendance-faults-bar" style="background-color:<?php echo (!empty($faults['color_bar']) ? $faults['color_bar'] : 'none') ?>">
429 429
                         <?php echo $faults['faults'].'/'.$faults['total'].' ('.$faults['faults_porcent'].'%)' ?></div></center>
430 430
                     </td>
431 431
                 </tr>
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
             $i = 0;
443 443
             foreach ($users_presence[$user_id] as $presence) {
444 444
                 $class = '';
445
-                if ($i%2==0) {
445
+                if ($i % 2 == 0) {
446 446
                     $class = 'row_even';
447 447
                 } else {
448 448
                     $class = 'row_odd';
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                 ?>
451 451
                 <tr class="<?php echo $class ?>">
452 452
                     <td>
453
-                        <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif',get_lang('Presence')) : Display::return_icon('checkbox_off.gif',get_lang('Presence')) ?>
453
+                        <?php echo $presence['presence'] ? Display::return_icon('checkbox_on.gif', get_lang('Presence')) : Display::return_icon('checkbox_off.gif', get_lang('Presence')) ?>
454 454
                         <?php echo "&nbsp; ".$presence['date_time'] ?>
455 455
                     </td>
456 456
                 </tr>
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/FormValidator.class.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         $renderer->setHeaderTemplate('<legend>{header}</legend>');
100 100
 
101 101
         //Set required field template
102
-        $this->setRequiredNote('<span class="form_required">*</span> <small>' . get_lang('ThisFieldIsRequired') . '</small>');
102
+        $this->setRequiredNote('<span class="form_required">*</span> <small>'.get_lang('ThisFieldIsRequired').'</small>');
103 103
         $noteTemplate = <<<EOT
104 104
 	<div class="form-group">
105 105
 		<div class="col-sm-offset-2 col-sm-10">{requiredNote}</div>
@@ -851,9 +851,9 @@  discard block
 block discarded – undo
851 851
             $label = get_lang('PleaseStandBy');
852 852
         }
853 853
         $this->with_progress_bar = true;
854
-        $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','".Display::returnIconPath('progress_bar.gif')."','" . $label . "','" . $this->getAttribute('id') . "')\"");
855
-        $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
856
-        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>');
854
+        $this->updateAttributes("onsubmit=\"javascript: myUpload.start('dynamic_div','".Display::returnIconPath('progress_bar.gif')."','".$label."','".$this->getAttribute('id')."')\"");
855
+        $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
856
+        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>');
857 857
     }
858 858
 
859 859
     /**
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
             return;
871 871
         }
872 872
 
873
-        $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH) . 'upload.xajax.php');
873
+        $xajax_upload = new xajax(api_get_path(WEB_LIBRARY_PATH).'upload.xajax.php');
874 874
 
875 875
         $xajax_upload->registerFunction('updateProgress');
876 876
         // IMPORTANT : must be the first element of the form
877
-        $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="' . $upload_id . '" />'), $element_after);
877
+        $el = $this->insertElementBefore(FormValidator::createElement('html', '<input type="hidden" name="UPLOAD_IDENTIFIER" value="'.$upload_id.'" />'), $element_after);
878 878
 
879 879
         $this->addElement('html', '<br />');
880 880
 
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
         $this->addElement(
883 883
             'html',
884 884
             '<div id="dynamic_div_container" style="display:none">
885
-                <div id="dynamic_div_label">' . get_lang('UploadFile') . '</div>
885
+                <div id="dynamic_div_label">' . get_lang('UploadFile').'</div>
886 886
                 <div id="dynamic_div_frame" style="width:214px; height:12px; border:1px solid grey; background-image:url(' . Display::returnIconPath('real_upload_frame.gif').');">
887 887
                     <div id="dynamic_div_filled" style="width:0%;height:100%;background-image:url(' . Display::returnIconPath('real_upload_step.gif').');background-repeat:repeat-x;background-position:center;"></div>
888 888
                 </div>
@@ -893,7 +893,7 @@  discard block
 block discarded – undo
893 893
             $this->addElement('html', '
894 894
 			<div id="dynamic_div_waiter_container" style="display:none">
895 895
 				<div id="dynamic_div_waiter_label">
896
-					' . get_lang('SlideshowConversion') . '
896
+					' . get_lang('SlideshowConversion').'
897 897
 				</div>
898 898
 				<div id="dynamic_div_waiter_frame">
899 899
 					'.Display::return_icon('real_upload_frame.gif').'
@@ -903,18 +903,18 @@  discard block
 block discarded – undo
903 903
         }
904 904
 
905 905
         // Get the xajax code
906
-        $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH) . 'xajax'));
906
+        $this->addElement('html', $xajax_upload->getJavascript(api_get_path(WEB_LIBRARY_PATH).'xajax'));
907 907
 
908 908
         // Get the upload code
909
-        $this->addElement('html', '<script language="javascript" src="' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/upload.js" type="text/javascript"></script>');
910
-        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload(' . (abs(intval($delay)) * 1000) . ');</script>');
909
+        $this->addElement('html', '<script language="javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/upload.js" type="text/javascript"></script>');
910
+        $this->addElement('html', '<script type="text/javascript">var myUpload = new upload('.(abs(intval($delay)) * 1000).');</script>');
911 911
 
912 912
         if (!$wait_after_upload) {
913 913
             $wait_after_upload = 0;
914 914
         }
915 915
 
916 916
         // Add the upload event
917
-        $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','" . $upload_id . "','" . $this->getAttribute('id') . "'," . $wait_after_upload . ")\"");
917
+        $this->updateAttributes("onsubmit=\"javascript: myUpload.startRealUpload('dynamic_div','".$upload_id."','".$this->getAttribute('id')."',".$wait_after_upload.")\"");
918 918
     }
919 919
 
920 920
     /**
Please login to merge, or discard this patch.
main/document/create_paint.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -129,27 +129,27 @@
 block discarded – undo
129 129
 
130 130
 // pixlr
131 131
 // max size 1 Mb ??
132
-$title = urlencode(utf8_encode(get_lang('NewImage')));//TODO:check
132
+$title = urlencode(utf8_encode(get_lang('NewImage'))); //TODO:check
133 133
 //
134 134
 $image = Display::returnIconPath('canvas1024x768.png');
135 135
 //
136 136
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
137
-$langpixlr  = api_get_language_isocode();
137
+$langpixlr = api_get_language_isocode();
138 138
 $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
139
-$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
140
-
141
-$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
142
-$_SESSION['exit_pixlr']=$document_data['path'];
143
-$referrer="Chamilo";
144
-$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
-$target=$target_path;
146
-$locktarget="true";
147
-$locktitle="false";
148
-
149
-if ($_SERVER['HTTP_HOST']=="localhost") {
150
-	$path_and_file= api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
139
+$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
140
+
141
+$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
142
+$_SESSION['exit_pixlr'] = $document_data['path'];
143
+$referrer = "Chamilo";
144
+$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
+$target = $target_path;
146
+$locktarget = "true";
147
+$locktitle = "false";
148
+
149
+if ($_SERVER['HTTP_HOST'] == "localhost") {
150
+	$path_and_file = api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
151 151
 	if (!file_exists($path_and_file)) {
152
-		$crossdomain='<?xml version="1.0"?>
152
+		$crossdomain = '<?xml version="1.0"?>
153 153
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
154 154
 			<cross-domain-policy>
155 155
 				<allow-access-from domain="cdn.pixlr.com" />
Please login to merge, or discard this patch.
main/document/edit_paint.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -33,26 +33,26 @@  discard block
 block discarded – undo
33 33
     $my_cur_dir_path = isset($_GET['curdirpath']) ? Security::remove_XSS($_GET['curdirpath']) : null;
34 34
 }
35 35
 
36
-$dir= str_replace('\\', '/', $dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
36
+$dir = str_replace('\\', '/', $dir); //and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
37 37
 
38 38
 /* Constants & Variables */
39
-$current_session_id=api_get_session_id();
39
+$current_session_id = api_get_session_id();
40 40
 //path for pixlr save
41
-$_SESSION['paint_dir']=Security::remove_XSS($dir);
42
-if($_SESSION['paint_dir']=='/'){
43
-    $_SESSION['paint_dir']='';
41
+$_SESSION['paint_dir'] = Security::remove_XSS($dir);
42
+if ($_SESSION['paint_dir'] == '/') {
43
+    $_SESSION['paint_dir'] = '';
44 44
 }
45
-$_SESSION['paint_file']=basename(Security::remove_XSS($file_path));
45
+$_SESSION['paint_file'] = basename(Security::remove_XSS($file_path));
46 46
 
47 47
 $get_file = Security::remove_XSS($file_path);
48 48
 
49 49
 $file = basename($get_file);
50 50
 
51
-$temp_file = explode(".",$file);
52
-$filename=$temp_file[0];
53
-$nameTools = get_lang('EditDocument') . ': '.$filename;
51
+$temp_file = explode(".", $file);
52
+$filename = $temp_file[0];
53
+$nameTools = get_lang('EditDocument').': '.$filename;
54 54
 
55
-$courseDir   = $_course['path'].'/document';
55
+$courseDir = $_course['path'].'/document';
56 56
 
57 57
 $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
58 58
 
@@ -96,15 +96,15 @@  discard block
 block discarded – undo
96 96
 $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
97 97
 
98 98
 if (!$is_certificate_mode)
99
-	$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
99
+	$interbreadcrumb[] = array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(), "name"=> get_lang('Documents'));
100 100
 else
101
-	$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
101
+	$interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
102 102
 
103 103
 // Interbreadcrumb for the current directory root path
104 104
 if (empty($document_data['parents'])) {
105 105
     $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
106 106
 } else {
107
-    foreach($document_data['parents'] as $document_sub_data) {
107
+    foreach ($document_data['parents'] as $document_sub_data) {
108 108
         if ($document_data['title'] == $document_sub_data['title']) {
109 109
             continue;
110 110
         }
@@ -124,33 +124,33 @@  discard block
 block discarded – undo
124 124
 Display :: display_header($nameTools, 'Doc');
125 125
 echo '<div class="actions">';
126 126
 echo '<a href="document.php?id='.$parent_id.'&'.api_get_cidreq().'">'.
127
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
127
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
128 128
 echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&'.api_get_cidreq().'&origin=editpaint">'.
129
-    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'),'',ICON_SIZE_MEDIUM).'</a>';
129
+    Display::return_icon('edit.png', get_lang('Rename').'/'.get_lang('Comment'), '', ICON_SIZE_MEDIUM).'</a>';
130 130
 echo '</div>';
131 131
 
132 132
 ///pixlr
133
-$title=$file;//disk name. No sql name because pixlr return this when save
133
+$title = $file; //disk name. No sql name because pixlr return this when save
134 134
 $pixlr_code_translation_table = array('' => 'en', 'pt' => 'pt-Pt', 'sr' => 'sr_latn');
135
-$langpixlr  = api_get_language_isocode();
135
+$langpixlr = api_get_language_isocode();
136 136
 $langpixlr = isset($pixlr_code_translation_table[$langpixlr]) ? $pixlredit_code_translation_table[$langpixlr] : $langpixlr;
137
-$loc=$langpixlr;// deprecated ?? TODO:check pixlr read user browser
137
+$loc = $langpixlr; // deprecated ?? TODO:check pixlr read user browser
138 138
 
139
-$exit_path=api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
-$_SESSION['exit_pixlr']= Security::remove_XSS($parent_id);
139
+$exit_path = api_get_path(WEB_CODE_PATH).'document/exit_pixlr.php';
140
+$_SESSION['exit_pixlr'] = Security::remove_XSS($parent_id);
141 141
 
142
-$referrer="Chamilo";
142
+$referrer = "Chamilo";
143 143
 
144
-$target_path=api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
-$target=$target_path;
144
+$target_path = api_get_path(WEB_CODE_PATH).'document/save_pixlr.php';
145
+$target = $target_path;
146 146
 
147
-$locktarget="true";
148
-$locktitle="false";
147
+$locktarget = "true";
148
+$locktitle = "false";
149 149
 
150
-if ($_SERVER['HTTP_HOST']=="localhost") {
151
-	$path_and_file= api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
150
+if ($_SERVER['HTTP_HOST'] == "localhost") {
151
+	$path_and_file = api_get_path(SYS_SERVER_ROOT_PATH).'/crossdomain.xml';
152 152
 	if (!file_exists($path_and_file)) {
153
-		$crossdomain='<?xml version="1.0"?>
153
+		$crossdomain = '<?xml version="1.0"?>
154 154
 			<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
155 155
 			<cross-domain-policy>
156 156
 				<allow-access-from domain="cdn.pixlr.com" />
@@ -159,23 +159,23 @@  discard block
 block discarded – undo
159 159
 			</cross-domain-policy>';//more open domain="*"
160 160
 		@file_put_contents($path_and_file, $crossdomain);
161 161
 	}
162
-	$credentials="true";
162
+	$credentials = "true";
163 163
 }
164 164
 else {
165
-	$credentials="false";
165
+	$credentials = "false";
166 166
 }
167 167
 
168 168
 //make temp images
169
-$temp_folder=api_get_path(SYS_ARCHIVE_PATH).'temp/images';
169
+$temp_folder = api_get_path(SYS_ARCHIVE_PATH).'temp/images';
170 170
 if (!file_exists($temp_folder)) {
171
-    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true);//TODO:check $permissions value, now empty;
171
+    @mkdir($temp_folder, api_get_permissions_for_new_directories(), true); //TODO:check $permissions value, now empty;
172 172
 }
173 173
 
174 174
 //make htaccess with allow from all, and file index.html into temp/images
175
-$htaccess=api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
175
+$htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess';
176 176
 if (!file_exists($htaccess)) {
177 177
 
178
-	$htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
178
+	$htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
179 179
 
180 180
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/.htaccess', 'w');
181 181
 	if ($fp) {
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
 	}
185 185
 }
186 186
 
187
-$html_index=api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
187
+$html_index = api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html';
188 188
 if (!file_exists($html_index)) {
189
-	$html_index_content="<html><head></head><body></body></html>";
189
+	$html_index_content = "<html><head></head><body></body></html>";
190 190
 	$fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/images/index.html', 'w');
191 191
 	if ($fp) {
192 192
 		fwrite($fp, $html_index_content);
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
 }
196 196
 
197 197
 //encript temp name file
198
-$name_crip=sha1(uniqid());//encript
199
-$findext= explode(".", $file);
200
-$extension= $findext[count($findext)-1];
201
-$file_crip=$name_crip.'.'.$extension;
198
+$name_crip = sha1(uniqid()); //encript
199
+$findext = explode(".", $file);
200
+$extension = $findext[count($findext) - 1];
201
+$file_crip = $name_crip.'.'.$extension;
202 202
 
203 203
 //copy file to temp/images directory
204
-$from=$filepath.$file;
205
-$to=api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
204
+$from = $filepath.$file;
205
+$to = api_get_path(SYS_ARCHIVE_PATH).'temp/images/'.$file_crip;
206 206
 copy($from, $to);
207
-$_SESSION['temp_realpath_image']=$to;
207
+$_SESSION['temp_realpath_image'] = $to;
208 208
 
209 209
 //load image to url
210
-$to_url=api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
-$image=urlencode($to_url);
210
+$to_url = api_get_path(WEB_ARCHIVE_PATH).'temp/images/'.$file_crip;
211
+$image = urlencode($to_url);
212 212
 $pixlr_url = api_get_protocol().'://pixlr.com/editor/?title='.$title.'&image='.$image.'&loc='.$loc.'&referrer='.$referrer.'&target='.$target.'&exit='.$exit_path.'&locktarget='.$locktarget.'&locktitle='.$locktitle.'&credentials='.$credentials;
213 213
 
214 214
 //make frame an send image
Please login to merge, or discard this patch.
main/forum/newthread.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,12 +54,12 @@  discard block
 block discarded – undo
54 54
 
55 55
 /* Breadcrumbs */
56 56
 
57
-if (isset($_SESSION['gradebook'])){
57
+if (isset($_SESSION['gradebook'])) {
58 58
     $gradebook = Security::remove_XSS($_SESSION['gradebook']);
59 59
 }
60 60
 
61 61
 if (!empty($gradebook) && $gradebook == 'view') {
62
-    $interbreadcrumb[] = array (
62
+    $interbreadcrumb[] = array(
63 63
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
64 64
         'name' => get_lang('ToolGradebook')
65 65
     );
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
118 118
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
119 119
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']);
120
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic'));
120
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic'));
121 121
 } else {
122 122
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
123 123
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']);
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
 
128 128
 /* Resource Linker */
129 129
 if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Resources')) {
130
-    $_SESSION['formelements']	= $_POST;
131
-    $_SESSION['origin']			= $_SERVER['REQUEST_URI'];
132
-    $_SESSION['breadcrumbs']	= $interbreadcrumb;
130
+    $_SESSION['formelements'] = $_POST;
131
+    $_SESSION['origin'] = $_SERVER['REQUEST_URI'];
132
+    $_SESSION['breadcrumbs'] = $interbreadcrumb;
133 133
     header('Location: ../resourcelinker/resourcelinker.php');
134 134
     exit;
135 135
 }
Please login to merge, or discard this patch.
main/forum/editthread.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 if (!empty($gradebook) && $gradebook == 'view') {
48
-    $interbreadcrumb[] = array (
48
+    $interbreadcrumb[] = array(
49 49
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
50 50
         'name' => get_lang('ToolGradebook')
51 51
     );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups'));
108 108
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']);
109 109
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $currentForum['forum_title']);
110
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('EditThread'));
110
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('EditThread'));
111 111
 } else {
112 112
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools);
113 113
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$currentForumCategory['cat_id'], 'name' => $currentForumCategory['cat_title']);
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 echo '<div class="actions">';
157 157
 echo '<span style="float:right;">'.search_link().'</span>';
158 158
 echo '<a href="viewforum.php?forum='.intval($_GET['forum']).'&'.$cidreq.'">'.
159
-    Display::return_icon('back.png',get_lang('BackToForum'),'',ICON_SIZE_MEDIUM).'</a>';
159
+    Display::return_icon('back.png', get_lang('BackToForum'), '', ICON_SIZE_MEDIUM).'</a>';
160 160
 echo '</div>';
161 161
 
162 162
 $threadData = getThreadInfo($threadId, $cId);
Please login to merge, or discard this patch.