Completed
Push — 1.11.x ( eb820d...635292 )
by José
41:13
created
main/upload/upload.php 1 patch
Switch Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -26,14 +26,14 @@
 block discarded – undo
26 26
  * Redirect to the correct script to handle this type of upload
27 27
  */
28 28
 switch ($_SESSION['my_tool']) {
29
-    case TOOL_LEARNPATH:
30
-        require 'upload.scorm.php';
31
-        break;
32
-    //the following cases need to be distinguished later on
33
-    case TOOL_DROPBOX:
34
-    case TOOL_STUDENTPUBLICATION:
35
-    case TOOL_DOCUMENT:
36
-    default:
37
-        require 'upload.document.php';
38
-        break;
29
+        case TOOL_LEARNPATH:
30
+            require 'upload.scorm.php';
31
+            break;
32
+        //the following cases need to be distinguished later on
33
+        case TOOL_DROPBOX:
34
+        case TOOL_STUDENTPUBLICATION:
35
+        case TOOL_DOCUMENT:
36
+        default:
37
+            require 'upload.document.php';
38
+            break;
39 39
 }
Please login to merge, or discard this patch.
main/group/settings.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@
 block discarded – undo
3 3
 
4 4
 /**
5 5
  *	This script displays an area where teachers can edit the group properties and member list.
6
-  *
6
+ *
7 7
  *	@author various contributors
8 8
  *	@author Roan Embrechts (VUB), partial code cleanup, initial virtual course support
9 9
  *	@package chamilo.group
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 require_once '../inc/global.inc.php';
14 14
 $this_section = SECTION_COURSES;
15
-$current_course_tool  = TOOL_GROUP;
15
+$current_course_tool = TOOL_GROUP;
16 16
 
17 17
 // Notice for unauthorized people.
18 18
 api_protect_course_script(true);
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 $form->addGroup(
82 82
     $group,
83 83
     '',
84
-    Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . '<span>' . get_lang('GroupSelfRegistration') . '</span>',
84
+    Display::return_icon('user.png', get_lang('GroupSelfRegistration')).'<span>'.get_lang('GroupSelfRegistration').'</span>',
85 85
     null,
86 86
     false
87 87
 );
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $form->addGroup(
96 96
     $group,
97 97
     '',
98
-    Display::return_icon('folder.png', get_lang('GroupDocument')) . '<span>' . get_lang('GroupDocument') . '</span>',
98
+    Display::return_icon('folder.png', get_lang('GroupDocument')).'<span>'.get_lang('GroupDocument').'</span>',
99 99
     null,
100 100
     false
101 101
 );
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 $form->addGroup(
110 110
     $group,
111 111
     '',
112
-    Display::return_icon('works.png', get_lang('GroupWork')) . '<span>' . get_lang('GroupWork') . '</span>',
112
+    Display::return_icon('works.png', get_lang('GroupWork')).'<span>'.get_lang('GroupWork').'</span>',
113 113
     null,
114 114
     false
115 115
 );
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 $form->addGroup(
124 124
     $group,
125 125
     '',
126
-    Display::return_icon('agenda.png', get_lang('GroupCalendar')) . '<span>' . get_lang('GroupCalendar') . '</span>',
126
+    Display::return_icon('agenda.png', get_lang('GroupCalendar')).'<span>'.get_lang('GroupCalendar').'</span>',
127 127
     null,
128 128
     false
129 129
 );
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 $form->addGroup(
141 141
     $group,
142 142
     '',
143
-    Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . '<span>' . get_lang('GroupAnnouncements') . '</span>',
143
+    Display::return_icon('announce.png', get_lang('GroupAnnouncements')).'<span>'.get_lang('GroupAnnouncements').'</span>',
144 144
     null,
145 145
     false
146 146
 );
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 $form->addGroup(
155 155
     $group,
156 156
     '',
157
-    Display::return_icon('forum.png', get_lang('GroupForum')) . '<span>' . get_lang('GroupForum') . '</span>',
157
+    Display::return_icon('forum.png', get_lang('GroupForum')).'<span>'.get_lang('GroupForum').'</span>',
158 158
     null,
159 159
     false
160 160
 );
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 $form->addGroup(
182 182
     $group,
183 183
     '',
184
-    Display::return_icon('chat.png', get_lang('Chat')) . '<span>' . get_lang('Chat') . '</span>',
184
+    Display::return_icon('chat.png', get_lang('Chat')).'<span>'.get_lang('Chat').'</span>',
185 185
     null,
186 186
     false
187 187
 );
Please login to merge, or discard this patch.
main/group/group_edit.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -161,9 +161,9 @@
 block discarded – undo
161 161
 // possible : number_groups_left > 0 and is group member
162 162
 $possible_users = array();
163 163
 foreach ($complete_user_list as $index => $user) {
164
-     if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) {
164
+        if ($user['number_groups_left'] > 0 || in_array($user['user_id'], $selected_users)) {
165 165
         $possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
166
-     }
166
+        }
167 167
 }
168 168
 
169 169
 $group_members_element = $form->addElement('advmultiselect', 'group_members', get_lang('GroupMembers'), $possible_users, 'style="width: 280px;"');
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 require_once '../inc/global.inc.php';
15 15
 $this_section = SECTION_COURSES;
16
-$current_course_tool  = TOOL_GROUP;
16
+$current_course_tool = TOOL_GROUP;
17 17
 
18 18
 // Notice for unauthorized people.
19 19
 api_protect_course_script(true);
@@ -22,8 +22,8 @@  discard block
 block discarded – undo
22 22
 $current_group = GroupManager :: get_group_properties($group_id);
23 23
 
24 24
 $nameTools = get_lang('EditGroup');
25
-$interbreadcrumb[] = array ('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
26
-$interbreadcrumb[] = array ('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
25
+$interbreadcrumb[] = array('url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
26
+$interbreadcrumb[] = array('url' => 'group_space.php?'.api_get_cidreq(), 'name' => $current_group['name']);
27 27
 
28 28
 $is_group_member = GroupManager :: is_tutor_of_group(api_get_user_id(), $group_id);
29 29
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         return true;
105 105
     }
106 106
     if (isset($value['max_member']) && isset($value['group_members']) && $value['max_member'] < count($value['group_members'])) {
107
-        return array ('group_members' => get_lang('GroupTooMuchMembers'));
107
+        return array('group_members' => get_lang('GroupTooMuchMembers'));
108 108
     }
109 109
     return true;
110 110
 }
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 $form->addText('name', get_lang('GroupName'));
131 131
 
132 132
 // Description
133
-$form->addElement('textarea', 'description', get_lang('Description'), array ('rows' => 6));
133
+$form->addElement('textarea', 'description', get_lang('Description'), array('rows' => 6));
134 134
 
135 135
 $complete_user_list = GroupManager :: fill_groups_list($current_group['id']);
136 136
 usort($complete_user_list, 'sort_users');
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 // Group members
160 160
 $group_member_list = GroupManager :: get_subscribed_users($current_group['id']);
161 161
 
162
-$selected_users = array ();
162
+$selected_users = array();
163 163
 foreach ($group_member_list as $index => $user) {
164 164
     $selected_users[] = $user['user_id'];
165 165
 }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 $form->addGroup(
199 199
     $group,
200 200
     '',
201
-    Display::return_icon('user.png', get_lang('GroupSelfRegistration')) . ' ' . get_lang('GroupSelfRegistration'),
201
+    Display::return_icon('user.png', get_lang('GroupSelfRegistration')).' '.get_lang('GroupSelfRegistration'),
202 202
     null,
203 203
     false
204 204
 );
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 $form->addGroup(
225 225
     $group,
226 226
     '',
227
-    Display::return_icon('work.png', get_lang('GroupWork')) . ' ' . get_lang('GroupWork'),
227
+    Display::return_icon('work.png', get_lang('GroupWork')).' '.get_lang('GroupWork'),
228 228
     null,
229 229
     false
230 230
 );
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 $form->addGroup(
238 238
     $group,
239 239
     '',
240
-    Display::return_icon('agenda.png', get_lang('GroupCalendar')) . ' ' . get_lang('GroupCalendar'),
240
+    Display::return_icon('agenda.png', get_lang('GroupCalendar')).' '.get_lang('GroupCalendar'),
241 241
     null,
242 242
     false
243 243
 );
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 $form->addGroup(
251 251
     $group,
252 252
     '',
253
-    Display::return_icon('announce.png', get_lang('GroupAnnouncements')) . ' ' . get_lang('GroupAnnouncements'),
253
+    Display::return_icon('announce.png', get_lang('GroupAnnouncements')).' '.get_lang('GroupAnnouncements'),
254 254
     null,
255 255
     false
256 256
 );
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 $form->addGroup(
264 264
     $group,
265 265
     '',
266
-    Display::return_icon('forum.png', get_lang('GroupForum')) . ' ' . get_lang('GroupForum'),
266
+    Display::return_icon('forum.png', get_lang('GroupForum')).' '.get_lang('GroupForum'),
267 267
     null,
268 268
     false
269 269
 );
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 $form->addGroup(
278 278
     $group,
279 279
     '',
280
-    Display::return_icon('wiki.png', get_lang('GroupWiki')) . ' ' . get_lang('GroupWiki'),
280
+    Display::return_icon('wiki.png', get_lang('GroupWiki')).' '.get_lang('GroupWiki'),
281 281
     null,
282 282
     false
283 283
 );
Please login to merge, or discard this patch.
main/group/member_settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 require_once '../inc/global.inc.php';
15 15
 $this_section = SECTION_COURSES;
16
-$current_course_tool  = TOOL_GROUP;
16
+$current_course_tool = TOOL_GROUP;
17 17
 
18 18
 // Notice for unauthorized people.
19 19
 api_protect_course_script(true);
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 // Group members
163 163
 $group_member_list = GroupManager::get_subscribed_users($current_group['id']);
164 164
 
165
-$selected_users = array ();
165
+$selected_users = array();
166 166
 if (!empty($group_member_list)) {
167 167
     foreach ($group_member_list as $index => $user) {
168 168
         $selected_users[] = $user['user_id'];
Please login to merge, or discard this patch.
main/dropbox/dropbox_download.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
             'error'
90 90
         )
91 91
     );
92
-	exit;
92
+    exit;
93 93
 } else {
94 94
     /*      DOWNLOAD THE FILE */
95 95
     // the user is allowed to download the file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 ON (post.file_id = file.id AND post.c_id = $course_id AND file.c_id = $course_id)
51 51
                 WHERE
52 52
                     post.cat_id = ".intval($_GET['cat_id'])." AND
53
-                    post.dest_user_id = $user_id" ;
53
+                    post.dest_user_id = $user_id";
54 54
     }
55 55
     $files_to_download = array();
56 56
     $result = Database::query($sql);
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX][] = intval($_GET['id']);
97 97
 
98 98
     $work = new Dropbox_Work($_GET['id']);
99
-    $path = dropbox_cnf('sysPath') . '/' . $work -> filename; //path to file as stored on server
99
+    $path = dropbox_cnf('sysPath').'/'.$work -> filename; //path to file as stored on server
100 100
 
101 101
     if (!Security::check_abs_path($path, dropbox_cnf('sysPath').'/')) {
102 102
         exit;
Please login to merge, or discard this patch.
main/dropbox/dropbox_config.inc.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
  */
19 19
 $dropbox_cnf['courseId'] = $_cid;
20 20
 //path to dropbox subdir in course containing the uploaded files
21
-$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH) . $_course['path'] . '/dropbox';
22
-$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH) . $_course['path'] . '/dropbox';
21
+$dropbox_cnf['sysPath'] = api_get_path(SYS_COURSE_PATH).$_course['path'].'/dropbox';
22
+$dropbox_cnf['webPath'] = api_get_path(WEB_COURSE_PATH).$_course['path'].'/dropbox';
23 23
 
24 24
 //file size limit as imposed by the platform admin (see Chamilo Config Settings on the platform administration section)
25 25
 $dropbox_cnf['maxFilesize'] = api_get_setting('dropbox_max_filesize');
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
  */
34 34
 // false = no mailing functionality
35 35
 $dropbox_cnf['allowMailing'] = api_string_2_boolean(api_get_setting('dropbox_allow_mailing'));
36
-$dropbox_cnf['mailingIdBase'] = 10000000;  // bigger than any user_id,
36
+$dropbox_cnf['mailingIdBase'] = 10000000; // bigger than any user_id,
37 37
 // allowing enough space for pseudo_ids as uploader_id, dest_user_id, user_id:
38 38
 // mailing pseudo_id = dropbox_cnf('mailingIdBase') + mailing id
39 39
 $dropbox_cnf['mailingZipRegexp'] = '/^(.*)(STUDENTID|USERID|LOGINNAME)(.*)\.ZIP$/i';
Please login to merge, or discard this patch.
main/dropbox/dropbox_functions.inc.php 3 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,11 +83,11 @@
 block discarded – undo
83 83
     if (strstr($_POST['action'], 'move_')) {
84 84
         // check move_received_n or move_sent_n command
85 85
         if (strstr($_POST['action'], 'received')) {
86
-              $part = 'received';
87
-              $to_cat_id = str_replace('move_received_', '', $_POST['action']);
86
+                $part = 'received';
87
+                $to_cat_id = str_replace('move_received_', '', $_POST['action']);
88 88
         } else {
89
-              $part = 'sent';
90
-              $to_cat_id = str_replace('move_sent_', '', $_POST['action']);
89
+                $part = 'sent';
90
+                $to_cat_id = str_replace('move_sent_', '', $_POST['action']);
91 91
         }
92 92
 
93 93
         foreach ($checked_file_ids as $value) {
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
     // STEP 2: at least one file has to be selected. If not we return an error message
44 44
     $ids = isset($_GET['id']) ? $_GET['id'] : array();
45
-    if (count($ids)>0) {
45
+    if (count($ids) > 0) {
46 46
         $checked_file_ids = $_POST['id'];
47 47
     } else {
48 48
         foreach ($_POST as $key => $value) {
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
     }
135 135
 
136 136
     $cat = get_dropbox_category($id);
137
-    if (count($cat)==0) {
137
+    if (count($cat) == 0) {
138 138
         return false;
139 139
     }
140 140
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 
606 606
                 $full_name = $userInfo['complete_name'].$groupNameListToString;
607 607
                 $current_user_id = $current_user['user_id'];
608
-                $options['user_' . $current_user_id] = $full_name;
608
+                $options['user_'.$current_user_id] = $full_name;
609 609
             }
610 610
         }
611 611
     }
@@ -702,8 +702,8 @@  discard block
 block discarded – undo
702 702
 
703 703
     // select all files that aren't referenced anymore
704 704
     $sql = "SELECT DISTINCT f.id, f.filename
705
-            FROM " . dropbox_cnf('tbl_file') . " f
706
-            LEFT JOIN " . dropbox_cnf('tbl_person') . " p
705
+            FROM " . dropbox_cnf('tbl_file')." f
706
+            LEFT JOIN " . dropbox_cnf('tbl_person')." p
707 707
             ON (f.id = p.file_id)
708 708
             WHERE p.user_id IS NULL AND
709 709
                   f.c_id = $course_id
@@ -711,14 +711,14 @@  discard block
 block discarded – undo
711 711
     $result = Database::query($sql);
712 712
     while ($res = Database::fetch_array($result)) {
713 713
         //delete the selected files from the post and file tables
714
-        $sql = "DELETE FROM " . dropbox_cnf('tbl_post') . "
715
-                WHERE c_id = $course_id AND file_id = '" . $res['id'] . "'";
714
+        $sql = "DELETE FROM ".dropbox_cnf('tbl_post')."
715
+                WHERE c_id = $course_id AND file_id = '".$res['id']."'";
716 716
         Database::query($sql);
717
-        $sql = "DELETE FROM " . dropbox_cnf('tbl_file') . "
718
-                WHERE c_id = $course_id AND id ='" . $res['id'] . "'";
717
+        $sql = "DELETE FROM ".dropbox_cnf('tbl_file')."
718
+                WHERE c_id = $course_id AND id ='".$res['id']."'";
719 719
         Database::query($sql);
720 720
         //delete file from server
721
-        @unlink( dropbox_cnf('sysPath') . '/' . $res['filename']);
721
+        @unlink(dropbox_cnf('sysPath').'/'.$res['filename']);
722 722
     }
723 723
 }
724 724
 
@@ -741,11 +741,11 @@  discard block
 block discarded – undo
741 741
 
742 742
     $mailingPseudoId = intval($mailingPseudoId);
743 743
     $sql = "SELECT f.uploader_id
744
-            FROM " . $dropbox_cnf['tbl_file'] . " f
745
-            LEFT JOIN " . $dropbox_cnf['tbl_post'] . " p
744
+            FROM " . $dropbox_cnf['tbl_file']." f
745
+            LEFT JOIN " . $dropbox_cnf['tbl_post']." p
746 746
             ON (f.id = p.file_id AND f.c_id = $course_id AND p.c_id = $course_id)
747 747
             WHERE
748
-                p.dest_user_id = '" . $mailingPseudoId . "' AND
748
+                p.dest_user_id = '".$mailingPseudoId."' AND
749 749
                 p.c_id = $course_id
750 750
             ";
751 751
     $result = Database::query($sql);
@@ -772,20 +772,20 @@  discard block
 block discarded – undo
772 772
     //    for all content files, replace mailingPseudoId by owner as uploader
773 773
     $file_id = intval($file_id);
774 774
     $sql = "SELECT p.dest_user_id
775
-            FROM " . $dropbox_cnf['tbl_post'] . " p
776
-            WHERE c_id = $course_id AND p.file_id = '" . $file_id . "'";
775
+            FROM " . $dropbox_cnf['tbl_post']." p
776
+            WHERE c_id = $course_id AND p.file_id = '".$file_id."'";
777 777
     $result = Database::query($sql);
778 778
 
779 779
     if ($res = Database::fetch_array($result)) {
780 780
         $mailingPseudoId = $res['dest_user_id'];
781 781
         if ($mailingPseudoId > dropbox_cnf('mailingIdBase')) {
782
-            $sql = "DELETE FROM " . dropbox_cnf('tbl_person') . "
783
-                    WHERE c_id = $course_id AND user_id='" . $mailingPseudoId . "'";
782
+            $sql = "DELETE FROM ".dropbox_cnf('tbl_person')."
783
+                    WHERE c_id = $course_id AND user_id='".$mailingPseudoId."'";
784 784
             Database::query($sql);
785 785
 
786
-            $sql = "UPDATE " . dropbox_cnf('tbl_file') ."
787
-                    SET uploader_id='" . api_get_user_id() . "'
788
-                    WHERE c_id = $course_id AND uploader_id='" . $mailingPseudoId . "'";
786
+            $sql = "UPDATE ".dropbox_cnf('tbl_file')."
787
+                    SET uploader_id='" . api_get_user_id()."'
788
+                    WHERE c_id = $course_id AND uploader_id='".$mailingPseudoId."'";
789 789
             Database::query($sql);
790 790
         }
791 791
     }
@@ -937,7 +937,7 @@  discard block
 block discarded – undo
937 937
             }
938 938
         }
939 939
     } else {  // rename file to login_filename_uniqueId format
940
-        $dropbox_filename = $_user['username'] . "_" . $dropbox_filename . "_".uniqid('');
940
+        $dropbox_filename = $_user['username']."_".$dropbox_filename."_".uniqid('');
941 941
     }
942 942
 
943 943
     // creating the array that contains all the users who will receive the file
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
         }
956 956
     }
957 957
 
958
-    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath') . '/' . $dropbox_filename);
958
+    @move_uploaded_file($dropbox_filetmpname, dropbox_cnf('sysPath').'/'.$dropbox_filename);
959 959
 
960 960
     $b_send_mail = api_get_course_setting('email_alert_on_new_doc_dropbox');
961 961
 
@@ -976,14 +976,14 @@  discard block
 block discarded – undo
976 976
                 ),
977 977
                 $recipent_temp['email'],
978 978
                 get_lang('NewDropboxFileUploaded'),
979
-                get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?' . api_get_cidreq() . '">'.get_lang('SeeFile').'</a>'.
979
+                get_lang('NewDropboxFileUploadedContent').' <a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq().'">'.get_lang('SeeFile').'</a>'.
980 980
                 "\n\n".
981 981
                 api_get_person_name(
982 982
                     $_user['firstName'],
983 983
                     $_user['lastName'],
984 984
                     null,
985 985
                     PERSON_NAME_EMAIL_ADDRESS
986
-                )."\n".  get_lang('Email') ." : ".$_user['mail'],
986
+                )."\n".get_lang('Email')." : ".$_user['mail'],
987 987
                 api_get_person_name(
988 988
                     $_user['firstName'],
989 989
                     $_user['lastName'],
@@ -1263,7 +1263,7 @@  discard block
 block discarded – undo
1263 1263
         // Adding the content.
1264 1264
         $return .= "\n<tr>";
1265 1265
         foreach ($column as $column_key => $column_value) {
1266
-            if (!in_array($column_value,$dont_show_columns)) {
1266
+            if (!in_array($column_value, $dont_show_columns)) {
1267 1267
                 $return .= "\n\t<td>";
1268 1268
                 if (in_array($column_value, $make_link)) {
1269 1269
                     $return .= '<a href="'.$value[$column_value].'">'.$value[$column_value].'</a>';
@@ -1296,7 +1296,7 @@  discard block
 block discarded – undo
1296 1296
             WHERE c_id = $course_id GROUP BY file_id";
1297 1297
     $result = Database::query($sql);
1298 1298
     $return = array();
1299
-    while ($row=Database::fetch_array($result)) {
1299
+    while ($row = Database::fetch_array($result)) {
1300 1300
         $return[$row['file_id']] = $row['total'];
1301 1301
     }
1302 1302
     return $return;
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -750,10 +750,15 @@
 block discarded – undo
750 750
             ";
751 751
     $result = Database::query($sql);
752 752
 
753
-    if (!($res = Database::fetch_array($result)))
754
-        die(get_lang('GeneralError').' (code 901)');
755
-    if ($owner == 0) return $res['uploader_id'];
756
-    if ($res['uploader_id'] == $owner) return true;
753
+    if (!($res = Database::fetch_array($result))) {
754
+            die(get_lang('GeneralError').' (code 901)');
755
+    }
756
+    if ($owner == 0) {
757
+        return $res['uploader_id'];
758
+    }
759
+    if ($res['uploader_id'] == $owner) {
760
+        return true;
761
+    }
757 762
     die(get_lang('GeneralError').' (code '.$or_die.')');
758 763
 }
759 764
 
Please login to merge, or discard this patch.
main/course_progress/thematic_controller.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -201,20 +201,20 @@  discard block
 block discarded – undo
201 201
                         $plan_html = null;
202 202
                         if (!empty($data)) {
203 203
                             foreach ($data as $plan) {
204
-                                $plan_html .= '<strong>' . $plan['title'] . '</strong><br /> ' . $plan['description'] . '<br />';
204
+                                $plan_html .= '<strong>'.$plan['title'].'</strong><br /> '.$plan['description'].'<br />';
205 205
                             }
206 206
                         }
207 207
                         $data = $thematic->get_thematic_advance_by_thematic_id($theme['id']);
208 208
                         $advance_html = null;
209 209
                         if (!empty($data)) {
210 210
                             foreach ($data as $advance) {
211
-                                $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG) . ' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />';
211
+                                $advance_html .= api_convert_and_format_date($advance['start_date'], DATE_FORMAT_LONG).' ('.$advance['duration'].' '.get_lang('HourShort').')<br />'.$advance['content'].'<br />';
212 212
                             }
213 213
                         }
214 214
                         $table[] = array($theme['title'], $plan_html, $advance_html);
215 215
                     }
216 216
                     $params = array(
217
-                        'filename' => get_lang('Thematic') . '-' . api_get_local_time(),
217
+                        'filename' => get_lang('Thematic').'-'.api_get_local_time(),
218 218
                         'pdf_title' => get_lang('Thematic'),
219 219
                         'add_signatures' => true,
220 220
                         'format' => 'A4-L',
@@ -311,9 +311,9 @@  discard block
 block discarded – undo
311 311
                             unset($_SESSION['thematic_plan_token']);
312 312
                             $data['message'] = 'ok';
313 313
 
314
-                            $saveRedirect = api_get_path(WEB_PATH) . 'main/course_progress/index.php?';
315
-                            $saveRedirect.= api_get_cidreq() . '&';
316
-                            $saveRedirect.= 'thematic_plan_save_message=ok';
314
+                            $saveRedirect = api_get_path(WEB_PATH).'main/course_progress/index.php?';
315
+                            $saveRedirect .= api_get_cidreq().'&';
316
+                            $saveRedirect .= 'thematic_plan_save_message=ok';
317 317
 
318 318
                             header("Location: $saveRedirect");
319 319
                             exit;
Please login to merge, or discard this patch.
main/course_progress/thematic.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
23 23
         case 'thematic_add' :
24 24
         case 'thematic_import_select' :
25 25
             echo '<a href="index.php?'.api_get_cidreq().'">'.
26
-                Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ThematicDetails'),'',ICON_SIZE_MEDIUM).'</a>';
26
+                Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ThematicDetails'), '', ICON_SIZE_MEDIUM).'</a>';
27 27
             break;
28 28
         case 'thematic_list' :
29 29
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
30
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
30
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
31 31
             break;
32 32
         case 'thematic_details' :
33 33
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
34
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
34
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
35 35
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_import_select'.$url_token.'">'.
36
-                Display::return_icon('import_csv.png',get_lang('ImportThematic'),'',ICON_SIZE_MEDIUM).'</a>';
36
+                Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
37 37
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export'.$url_token.'">'.
38
-                Display::return_icon('export_csv.png',get_lang('ExportThematic'),'', ICON_SIZE_MEDIUM).'</a>';
38
+                Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM).'</a>';
39 39
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_export_pdf'.$url_token.'">'.
40
-                Display::return_icon('pdf.png',get_lang('ExportToPDF'),'', ICON_SIZE_MEDIUM).'</a>';
40
+                Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM).'</a>';
41 41
             break;
42 42
         default :
43 43
             echo '<a href="index.php?'.api_get_cidreq().'&action=thematic_add'.$url_token.'">'.
44
-                Display::return_icon('new_course_progress.png',get_lang('NewThematicSection'),'',ICON_SIZE_MEDIUM).'</a>';
44
+                Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM).'</a>';
45 45
     }
46 46
     echo '</div>';
47 47
 }
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
     $parameters['action'] = $action;
58 58
     $table->set_additional_parameters($parameters);
59 59
     $table->set_header(0, '', false, array('style'=>'width:20px;'));
60
-    $table->set_header(1, get_lang('Title'), false );
60
+    $table->set_header(1, get_lang('Title'), false);
61 61
     if (api_is_allowed_to_edit(null, true)) {
62
-        $table->set_header(2, get_lang('Actions'), false,array('style'=>'text-align:center;width:40%;'));
63
-        $table->set_form_actions(array ('thematic_delete_select' => get_lang('DeleteAllThematics')));
62
+        $table->set_header(2, get_lang('Actions'), false, array('style'=>'text-align:center;width:40%;'));
63
+        $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics')));
64 64
     }
65 65
     $table->display();
66 66
 
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
 
73 73
     if (isset($last_id) && $last_id) {
74 74
         $link_to_thematic_plan = '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$last_id.'">'.
75
-            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
75
+            Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
76 76
         $link_to_thematic_advance = '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$last_id.'">'.
77
-            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'),ICON_SIZE_SMALL).'</a>';
77
+            Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), array('style'=>'vertical-align:middle;float:none;'), ICON_SIZE_SMALL).'</a>';
78 78
         Display::display_confirmation_message(
79
-            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'),$link_to_thematic_plan, $link_to_thematic_advance),
79
+            get_lang('ThematicSectionHasBeenCreatedSuccessfull').'<br />'.sprintf(get_lang('NowYouShouldAddThematicPlanXAndThematicAdvanceX'), $link_to_thematic_plan, $link_to_thematic_advance),
80 80
             false
81 81
         );
82 82
     }
@@ -113,27 +113,27 @@  discard block
 block discarded – undo
113 113
             $actions_first_col = '';
114 114
             if (api_is_allowed_to_edit(null, true)) {
115 115
                 // Thematic title
116
-                $actions_first_col  = Display::url(
116
+                $actions_first_col = Display::url(
117 117
                     Display::return_icon('cd.gif', get_lang('Copy')),
118 118
                     'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$my_thematic_id.$params.$url_token
119 119
                 );
120
-                if (api_get_session_id() == 0 ) {
120
+                if (api_get_session_id() == 0) {
121 121
 
122 122
                     if ($thematic['display_order'] > 1) {
123
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>';
123
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>';
124 124
                     } else {
125
-                        $actions_first_col .= ' '.Display::return_icon('up_na.png','&nbsp;','',ICON_SIZE_SMALL);
125
+                        $actions_first_col .= ' '.Display::return_icon('up_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
126 126
                     }
127 127
                     if (isset($thematic['max_thematic_item']) && $thematic['display_order'] < $thematic['max_thematic_item']) {
128
-                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>';
128
+                        $actions_first_col .= ' <a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>';
129 129
                     } else {
130
-                        $actions_first_col .= ' '.Display::return_icon('down_na.png','&nbsp;','',ICON_SIZE_SMALL);
130
+                        $actions_first_col .= ' '.Display::return_icon('down_na.png', '&nbsp;', '', ICON_SIZE_SMALL);
131 131
                     }
132 132
 
133 133
                 }
134 134
                 if (api_get_session_id() == $thematic['session_id']) {
135
-                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>';
136
-                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
135
+                    $actions_first_col .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>';
136
+                    $actions_first_col .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$my_thematic_id.$params.$url_token.'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
137 137
                 }
138 138
 
139 139
                 $actions_first_col = Display::div($actions_first_col, array('id'=>'thematic_id_content_'.$thematic['id'], 'class'=>'thematic_tools'));
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
150 150
             if (api_is_allowed_to_edit(null, true)) {
151 151
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&origin=thematic_details&action=thematic_plan_list&thematic_id='.$thematic['id'].'&width=700&height=500">'.
152
-                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'),ICON_SIZE_MEDIUM).'</a></div><br />';
152
+                    Display::return_icon('edit.png', get_lang('EditThematicPlan'), array('style'=>'vertical-align:middle'), ICON_SIZE_MEDIUM).'</a></div><br />';
153 153
             }
154 154
 
155 155
             if (empty($thematic_plan_div[$thematic['id']])) {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
166 166
             if (api_is_allowed_to_edit(null, true)) {
167 167
                 echo '<div style="text-align:right"><a href="index.php?'.api_get_cidreq().'&action=thematic_advance_add&thematic_id='.$thematic['id'].'">'.
168
-                    Display::return_icon('add.png',get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a></div>';
168
+                    Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a></div>';
169 169
             }
170 170
 
171 171
             //if (api_is_allowed_to_edit(null, true) &&  api_get_session_id() == $thematic['session_id']) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                                 [],
188 188
                                 ICON_SIZE_SMALL
189 189
                             ),
190
-                            'index.php?' . api_get_cidreq() . '&' . http_build_query([
190
+                            'index.php?'.api_get_cidreq().'&'.http_build_query([
191 191
                                 'action' => 'thematic_advance_edit',
192 192
                                 'thematic_id' => $thematic['id'],
193 193
                                 'thematic_advance_id' => $thematic_advance['id'],
@@ -198,17 +198,17 @@  discard block
 block discarded – undo
198 198
                                 'data-title' => get_lang('EditThematicAdvance')
199 199
                             ]
200 200
                         );
201
-                        $edit_link  .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';
201
+                        $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
202
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a></center>';
203 203
 
204 204
                         //Links
205 205
                         $edit_link = Display::div(
206
-                            Display::div($edit_link , array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
206
+                            Display::div($edit_link, array('id'=>'thematic_advance_tools_'.$thematic_advance['id'], 'class'=>'thematic_advance_actions')),
207 207
                             array('style'=>'height:20px;')
208 208
                         );
209 209
                     }
210 210
 
211
-                    $thematic_advance_item =  isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
211
+                    $thematic_advance_item = isset($thematic_advance_div[$thematic['id']][$thematic_advance['id']]) ? $thematic_advance_div[$thematic['id']][$thematic_advance['id']] : null;
212 212
                     echo Display::div($thematic_advance_item, array('id'=>'thematic_advance_'.$thematic_advance['id']));
213 213
                     echo $edit_link;
214 214
                     echo '</td>';
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 } elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
254 254
 
255 255
     // Display form
256
-    $form = new FormValidator('thematic_add','POST','index.php?action=thematic_add&'.api_get_cidreq());
256
+    $form = new FormValidator('thematic_add', 'POST', 'index.php?action=thematic_add&'.api_get_cidreq());
257 257
 
258 258
     if ($action == 'thematic_edit') {
259 259
         $form->addElement('header', '', get_lang('EditThematicSection'));
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     $form->addElement('hidden', 'action', $action);
264 264
 
265 265
     if (!empty($thematic_id)) {
266
-        $form->addElement('hidden', 'thematic_id',$thematic_id);
266
+        $form->addElement('hidden', 'thematic_id', $thematic_id);
267 267
     }
268 268
 
269 269
     $form->addText('title', get_lang('Title'), true, array('size'=>'50'));
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
     if (!empty($thematic_data)) {
276 276
         if (api_get_session_id()) {
277 277
             if ($thematic_data['session_id'] != api_get_session_id()) {
278
-                $show_form  = false;
279
-                Display::display_error_message(get_lang('NotAllowedClickBack'),false);
278
+                $show_form = false;
279
+                Display::display_error_message(get_lang('NotAllowedClickBack'), false);
280 280
             }
281 281
         }
282 282
         // set default values
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
 
288 288
     // error messages
289 289
     if (isset($error)) {
290
-        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
290
+        Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
291 291
     }
292 292
     if ($show_form) {
293 293
         $form->display();
294 294
     }
295 295
 } elseif ($action == 'thematic_import_select') {
296 296
     // Create form to upload csv file.
297
-    $form = new FormValidator('thematic_import','POST','index.php?action=thematic_import&'.api_get_cidreq().$url_token);
297
+    $form = new FormValidator('thematic_import', 'POST', 'index.php?action=thematic_import&'.api_get_cidreq().$url_token);
298 298
     $form->addElement('header', get_lang('ImportThematic'));
299 299
     $form->addElement('file', 'file');
300 300
     $form->addElement('checkbox', 'replace', null, get_lang('DeleteAllThematic'));
Please login to merge, or discard this patch.