Completed
Push — 1.10.x ( 320abc...039d05 )
by José
151:51 queued 109:10
created
main/inc/lib/pear/PEAR.php 1 patch
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
     // {{{ getStaticProperty()
206 206
 
207 207
     /**
208
-    * If you have a class that's mostly/entirely static, and you need static
209
-    * properties, you can use this method to simulate them. Eg. in your method(s)
210
-    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
211
-    * You MUST use a reference, or they will not persist!
212
-    *
213
-    * @access public
214
-    * @param  string $class  The calling classname, to prevent clashes
215
-    * @param  string $var    The variable to retrieve.
216
-    * @return mixed   A reference to the variable. If not set it will be
217
-    *                 auto initialised to NULL.
218
-    */
208
+     * If you have a class that's mostly/entirely static, and you need static
209
+     * properties, you can use this method to simulate them. Eg. in your method(s)
210
+     * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
211
+     * You MUST use a reference, or they will not persist!
212
+     *
213
+     * @access public
214
+     * @param  string $class  The calling classname, to prevent clashes
215
+     * @param  string $var    The variable to retrieve.
216
+     * @return mixed   A reference to the variable. If not set it will be
217
+     *                 auto initialised to NULL.
218
+     */
219 219
     function &getStaticProperty($class, $var)
220 220
     {
221 221
         static $properties;
@@ -234,14 +234,14 @@  discard block
 block discarded – undo
234 234
     // {{{ registerShutdownFunc()
235 235
 
236 236
     /**
237
-    * Use this function to register a shutdown method for static
238
-    * classes.
239
-    *
240
-    * @access public
241
-    * @param  mixed $func  The function name (or array of class/method) to call
242
-    * @param  mixed $args  The arguments to pass to the function
243
-    * @return void
244
-    */
237
+     * Use this function to register a shutdown method for static
238
+     * classes.
239
+     *
240
+     * @access public
241
+     * @param  mixed $func  The function name (or array of class/method) to call
242
+     * @param  mixed $args  The arguments to pass to the function
243
+     * @return void
244
+     */
245 245
     function registerShutdownFunc($func, $args = array())
246 246
     {
247 247
         // if we are called statically, there is a potential
@@ -513,12 +513,12 @@  discard block
 block discarded – undo
513 513
      * @since PHP 4.0.5
514 514
      */
515 515
     function &raiseError($message = null,
516
-                         $code = null,
517
-                         $mode = null,
518
-                         $options = null,
519
-                         $userinfo = null,
520
-                         $error_class = null,
521
-                         $skipmsg = false)
516
+                            $code = null,
517
+                            $mode = null,
518
+                            $options = null,
519
+                            $userinfo = null,
520
+                            $error_class = null,
521
+                            $skipmsg = false)
522 522
     {
523 523
         // The error is yet a PEAR error object
524 524
         if (is_object($message)) {
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
      *
585 585
      */
586 586
     function &throwError($message = null,
587
-                         $code = null,
588
-                         $userinfo = null)
587
+                            $code = null,
588
+                            $userinfo = null)
589 589
     {
590 590
         if (isset($this) && is_a($this, 'PEAR')) {
591 591
             $a = &$this->raiseError($message, $code, null, null, $userinfo);
@@ -707,12 +707,12 @@  discard block
 block discarded – undo
707 707
     // {{{ popErrorHandling()
708 708
 
709 709
     /**
710
-    * Pop the last error handler used
711
-    *
712
-    * @return bool Always true
713
-    *
714
-    * @see PEAR::pushErrorHandling
715
-    */
710
+     * Pop the last error handler used
711
+     *
712
+     * @return bool Always true
713
+     *
714
+     * @see PEAR::pushErrorHandling
715
+     */
716 716
     function popErrorHandling()
717 717
     {
718 718
         $stack = &$GLOBALS['_PEAR_error_handler_stack'];
@@ -731,12 +731,12 @@  discard block
 block discarded – undo
731 731
     // {{{ loadExtension()
732 732
 
733 733
     /**
734
-    * OS independant PHP extension load. Remember to take care
735
-    * on the correct extension name for case sensitive OSes.
736
-    *
737
-    * @param string $ext The extension name
738
-    * @return bool Success or not on the dl() call
739
-    */
734
+     * OS independant PHP extension load. Remember to take care
735
+     * on the correct extension name for case sensitive OSes.
736
+     *
737
+     * @param string $ext The extension name
738
+     * @return bool Success or not on the dl() call
739
+     */
740 740
     function loadExtension($ext)
741 741
     {
742 742
         if (!extension_loaded($ext)) {
@@ -999,10 +999,10 @@  discard block
 block discarded – undo
999 999
      * @return int error code
1000 1000
      * @access public
1001 1001
      */
1002
-     function getCode()
1003
-     {
1002
+        function getCode()
1003
+        {
1004 1004
         return $this->code;
1005
-     }
1005
+        }
1006 1006
 
1007 1007
     // }}}
1008 1008
     // {{{ getType()
@@ -1110,10 +1110,10 @@  discard block
 block discarded – undo
1110 1110
                 $callback = $this->callback;
1111 1111
             }
1112 1112
             return sprintf('[%s: message="%s" code=%d mode=callback '.
1113
-                           'callback=%s prefix="%s" info="%s"]',
1114
-                           strtolower(get_class($this)), $this->message, $this->code,
1115
-                           $callback, $this->error_message_prefix,
1116
-                           $this->userinfo);
1113
+                            'callback=%s prefix="%s" info="%s"]',
1114
+                            strtolower(get_class($this)), $this->message, $this->code,
1115
+                            $callback, $this->error_message_prefix,
1116
+                            $this->userinfo);
1117 1117
         }
1118 1118
         if ($this->mode & PEAR_ERROR_PRINT) {
1119 1119
             $modes[] = 'print';
@@ -1128,11 +1128,11 @@  discard block
 block discarded – undo
1128 1128
             $modes[] = 'return';
1129 1129
         }
1130 1130
         return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
1131
-                       'prefix="%s" info="%s"]',
1132
-                       strtolower(get_class($this)), $this->message, $this->code,
1133
-                       implode("|", $modes), $levels[$this->level],
1134
-                       $this->error_message_prefix,
1135
-                       $this->userinfo);
1131
+                        'prefix="%s" info="%s"]',
1132
+                        strtolower(get_class($this)), $this->message, $this->code,
1133
+                        implode("|", $modes), $levels[$this->level],
1134
+                        $this->error_message_prefix,
1135
+                        $this->userinfo);
1136 1136
     }
1137 1137
 
1138 1138
     // }}}
Please login to merge, or discard this patch.
main/dropbox/dropbox_init.inc.php 1 patch
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
     //sentArray keeps list of all files still available in the sent files list
222 222
     //of the user.
223 223
     //This is used to show or hide the overwrite file-radio button of the upload form
224
-	$javascript .= "
224
+    $javascript .= "
225 225
 		var sentArray = new Array(";
226 226
     if (isset($dropbox_person)) {
227 227
         for ($i = 0; $i < count($dropbox_person->sentWork); $i++) {
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
             $javascript .= "'".$dropbox_person->sentWork[$i]->title."'";
232 232
         }
233 233
     }
234
-	$javascript .= ");
234
+    $javascript .= ");
235 235
 
236 236
 		function checkfile(str)
237 237
 		{
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
 
297 297
 $checked_files = false;
298 298
 if (!$view || $view == 'received') {
299
-	$part = 'received';
299
+    $part = 'received';
300 300
 } elseif ($view = 'sent') {
301
-	$part = 'sent';
301
+    $part = 'sent';
302 302
 } else {
303
-	header('location: index.php?view='.$view.'&error=Error');
304
-	exit;
303
+    header('location: index.php?view='.$view.'&error=Error');
304
+    exit;
305 305
 }
306 306
 
307 307
 if (($postAction == 'download_received' || $postAction == 'download_sent') and !$_POST['store_feedback']) {
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
     } else {
326 326
         api_not_allowed();
327 327
     }
328
-	exit();
328
+    exit();
329 329
 }
330 330
 
331 331
 /*	BREADCRUMBS */
@@ -335,45 +335,45 @@  discard block
 block discarded – undo
335 335
         'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(),
336 336
         'name' => get_lang('Dropbox', ''),
337 337
     );
338
-	$nameTools = get_lang('ReceivedFiles');
338
+    $nameTools = get_lang('ReceivedFiles');
339 339
 
340
-	if ($action == 'addreceivedcategory') {
340
+    if ($action == 'addreceivedcategory') {
341 341
         $interbreadcrumb[] = array(
342 342
             'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=received&'.api_get_cidreq(),
343 343
             'name' => get_lang('ReceivedFiles'),
344 344
         );
345
-		$nameTools = get_lang('AddNewCategory');
346
-	}
345
+        $nameTools = get_lang('AddNewCategory');
346
+    }
347 347
 }
348 348
 
349 349
 if ($view == 'sent' || empty($view)) {
350 350
     $interbreadcrumb[] = array(
351 351
         'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?'.api_get_cidreq(),
352
-		'name' => get_lang('Dropbox')
352
+        'name' => get_lang('Dropbox')
353 353
     );
354
-	$nameTools = get_lang('SentFiles');
355
-
356
-	if ($action == 'addsentcategory') {
357
-		$interbreadcrumb[] = array(
358
-			'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(),
359
-			'name' => get_lang('SentFiles'),
360
-		);
361
-		$nameTools = get_lang('AddNewCategory');
362
-	}
363
-	if ($action == 'add') {
364
-		$interbreadcrumb[] = array(
365
-			'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(),
366
-			'name' => get_lang('SentFiles'),
367
-		);
368
-		$nameTools = get_lang('UploadNewFile');
369
-	}
354
+    $nameTools = get_lang('SentFiles');
355
+
356
+    if ($action == 'addsentcategory') {
357
+        $interbreadcrumb[] = array(
358
+            'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(),
359
+            'name' => get_lang('SentFiles'),
360
+        );
361
+        $nameTools = get_lang('AddNewCategory');
362
+    }
363
+    if ($action == 'add') {
364
+        $interbreadcrumb[] = array(
365
+            'url' => api_get_path(WEB_CODE_PATH).'dropbox/index.php?view=sent&'.api_get_cidreq(),
366
+            'name' => get_lang('SentFiles'),
367
+        );
368
+        $nameTools = get_lang('UploadNewFile');
369
+    }
370 370
 }
371 371
 
372 372
 /*	HEADER & TITLE */
373 373
 
374 374
 if (isset($origin) && $origin == 'learnpath') {
375 375
     $htmlHeadXtra[] = $javascript;
376
-	Display::display_reduced_header($nameTools, 'Dropbox');
376
+    Display::display_reduced_header($nameTools, 'Dropbox');
377 377
 } else {
378 378
     Display::display_header($nameTools, 'Dropbox');
379 379
 }
Please login to merge, or discard this patch.
main/dropbox/index.php 1 patch
Indentation   +427 added lines, -427 removed lines patch added patch discarded remove patch
@@ -7,12 +7,12 @@  discard block
 block discarded – undo
7 7
 $last_access = '';
8 8
 // get the last time the user accessed the tool
9 9
 if (isset($_SESSION[$_course['id']]) && $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') {
10
-	$last_access = get_last_tool_access(TOOL_DROPBOX);
11
-	$_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access;
10
+    $last_access = get_last_tool_access(TOOL_DROPBOX);
11
+    $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access;
12 12
 } else {
13
-	if (isset($_SESSION[$_course['id']])) {
14
-		$last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX];
15
-	}
13
+    if (isset($_SESSION[$_course['id']])) {
14
+        $last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX];
15
+    }
16 16
 }
17 17
 
18 18
 $postAction = isset($_POST['action']) ? $_POST['action'] : null;
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
 
50 50
 // Display the form for adding a new dropbox item.
51 51
 if ($action == 'add') {
52
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
53
-		api_not_allowed();
54
-	}
52
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
53
+        api_not_allowed();
54
+    }
55 55
     display_add_form(
56 56
         $dropbox_unid,
57 57
         $viewReceivedCategory,
@@ -61,59 +61,59 @@  discard block
 block discarded – undo
61 61
 }
62 62
 
63 63
 if (isset($_POST['submitWork'])) {
64
-	$check = Security::check_token();
65
-	if ($check) {
64
+    $check = Security::check_token();
65
+    if ($check) {
66 66
         $message = store_add_dropbox();
67 67
         if (!empty($message)) {
68 68
             Display :: display_confirmation_message($message);
69 69
         }
70
-	}
70
+    }
71 71
 }
72 72
 
73 73
 // Display the form for adding a category
74 74
 if ($action == 'addreceivedcategory' || $action == 'addsentcategory') {
75
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
76
-		api_not_allowed();
77
-	}
78
-	$categoryName = isset($_POST['category_name']) ? $_POST['category_name'] : '';
79
-	display_addcategory_form($categoryName, '', $_GET['action']);
75
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
76
+        api_not_allowed();
77
+    }
78
+    $categoryName = isset($_POST['category_name']) ? $_POST['category_name'] : '';
79
+    display_addcategory_form($categoryName, '', $_GET['action']);
80 80
 }
81 81
 
82 82
 // Editing a category: displaying the form
83 83
 if ($action == 'editcategory' && isset($_GET['id'])) {
84
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
85
-		api_not_allowed();
86
-	}
87
-	if (!$_POST) {
88
-		if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
89
-			api_not_allowed();
90
-		}
91
-		display_addcategory_form('', $_GET['id'], 'editcategory');
92
-	}
84
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
85
+        api_not_allowed();
86
+    }
87
+    if (!$_POST) {
88
+        if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
89
+            api_not_allowed();
90
+        }
91
+        display_addcategory_form('', $_GET['id'], 'editcategory');
92
+    }
93 93
 }
94 94
 
95 95
 // Storing a new or edited category
96 96
 if (isset($_POST['StoreCategory'])) {
97
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
98
-		api_not_allowed();
99
-	}
100
-	$return_information = store_addcategory();
101
-	if ($return_information['type'] == 'confirmation') {
102
-		Display :: display_confirmation_message($return_information['message']);
103
-	}
104
-	if ($return_information['type'] == 'error') {
105
-		Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete').'<br />'.$return_information['message']);
106
-		display_addcategory_form($_POST['category_name'], $_POST['edit_id'], $postAction);
107
-	}
97
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
98
+        api_not_allowed();
99
+    }
100
+    $return_information = store_addcategory();
101
+    if ($return_information['type'] == 'confirmation') {
102
+        Display :: display_confirmation_message($return_information['message']);
103
+    }
104
+    if ($return_information['type'] == 'error') {
105
+        Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete').'<br />'.$return_information['message']);
106
+        display_addcategory_form($_POST['category_name'], $_POST['edit_id'], $postAction);
107
+    }
108 108
 }
109 109
 
110 110
 
111 111
 // Move a File
112 112
 if (($action == 'movesent' || $action == 'movereceived') AND isset($_GET['move_id'])) {
113
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
114
-		api_not_allowed();
115
-	}
116
-	display_move_form(
113
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
114
+        api_not_allowed();
115
+    }
116
+    display_move_form(
117 117
         str_replace('move', '', $action),
118 118
         $_GET['move_id'],
119 119
         get_dropbox_categories(str_replace('move', '', $action)),
@@ -124,33 +124,33 @@  discard block
 block discarded – undo
124 124
     );
125 125
 }
126 126
 if (isset($_POST['do_move'])) {
127
-	Display :: display_confirmation_message(store_move($_POST['id'], $_POST['move_target'], $_POST['part']));
127
+    Display :: display_confirmation_message(store_move($_POST['id'], $_POST['move_target'], $_POST['part']));
128 128
 }
129 129
 
130 130
 // Delete a file
131 131
 if (($action == 'deletereceivedfile' || $action == 'deletesentfile') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
132
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
133
-		api_not_allowed();
134
-	}
135
-	$dropboxfile = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
136
-	if ($action == 'deletereceivedfile') {
137
-		$dropboxfile->deleteReceivedWork($_GET['id']);
138
-		$message = get_lang('ReceivedFileDeleted');
139
-	}
140
-	if ($action == 'deletesentfile') {
141
-		$dropboxfile->deleteSentWork($_GET['id']);
142
-		$message = get_lang('SentFileDeleted');
143
-	}
144
-	Display :: display_confirmation_message($message);
132
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
133
+        api_not_allowed();
134
+    }
135
+    $dropboxfile = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
136
+    if ($action == 'deletereceivedfile') {
137
+        $dropboxfile->deleteReceivedWork($_GET['id']);
138
+        $message = get_lang('ReceivedFileDeleted');
139
+    }
140
+    if ($action == 'deletesentfile') {
141
+        $dropboxfile->deleteSentWork($_GET['id']);
142
+        $message = get_lang('SentFileDeleted');
143
+    }
144
+    Display :: display_confirmation_message($message);
145 145
 }
146 146
 
147 147
 // Delete a category
148 148
 if (($action == 'deletereceivedcategory' || $action == 'deletesentcategory') AND isset($_GET['id']) AND is_numeric($_GET['id'])) {
149
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
150
-		api_not_allowed();
151
-	}
152
-	$message = delete_category($action, $_GET['id']);
153
-	Display :: display_confirmation_message($message);
149
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
150
+        api_not_allowed();
151
+    }
152
+    $message = delete_category($action, $_GET['id']);
153
+    Display :: display_confirmation_message($message);
154 154
 }
155 155
 
156 156
 // Do an action on multiple files
@@ -165,27 +165,27 @@  discard block
 block discarded – undo
165 165
     $postAction == 'delete_sent' ||
166 166
     $postAction == 'download_sent')
167 167
 ) {
168
-	$display_message = handle_multiple_actions();
169
-	Display :: display_normal_message($display_message);
168
+    $display_message = handle_multiple_actions();
169
+    Display :: display_normal_message($display_message);
170 170
 }
171 171
 
172 172
 // Store Feedback
173 173
 
174 174
 if (isset($_POST['feedback'])) {
175
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
176
-		api_not_allowed();
177
-	}
178
-	$check = Security::check_token();
179
-	if ($check) {
180
-		$display_message = store_feedback();
181
-		Display :: display_normal_message($display_message);
182
-		Security::check_token();
183
-	}
175
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
176
+        api_not_allowed();
177
+    }
178
+    $check = Security::check_token();
179
+    if ($check) {
180
+        $display_message = store_feedback();
181
+        Display :: display_normal_message($display_message);
182
+        Security::check_token();
183
+    }
184 184
 }
185 185
 
186 186
 // Error Message
187 187
 if (isset($_GET['error']) AND !empty($_GET['error'])) {
188
-	Display :: display_normal_message(get_lang($_GET['error']));
188
+    Display :: display_normal_message(get_lang($_GET['error']));
189 189
 }
190 190
 
191 191
 $dropbox_data_sent = array();
@@ -193,96 +193,96 @@  discard block
 block discarded – undo
193 193
 $dropbox_data_recieved = array();
194 194
 
195 195
 if ($action != 'add') {
196
-	// Getting all the categories in the dropbox for the given user
197
-	$dropbox_categories = get_dropbox_categories();
198
-	// Greating the arrays with the categories for the received files and for the sent files
199
-	foreach ($dropbox_categories as $category) {
200
-		if ($category['received'] == '1') {
201
-			$dropbox_received_category[] = $category;
202
-		}
203
-		if ($category['sent'] == '1') {
204
-			$dropbox_sent_category[] = $category;
205
-		}
206
-	}
207
-
208
-	// ACTIONS
209
-	if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
210
-		//echo '<h3>'.get_lang('ReceivedFiles').'</h3>';
211
-
212
-		// This is for the categories
213
-		if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') {
214
-			$view_dropbox_category_received = $viewReceivedCategory;
215
-		} else {
216
-			$view_dropbox_category_received = 0;
217
-		}
218
-
219
-		/* Menu Received */
220
-
221
-		if (api_get_session_id() == 0) {
222
-			echo '<div class="actions">';
223
-			if ($view_dropbox_category_received != 0  && api_is_allowed_to_session_edit(false, true)) {
224
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
225
-				echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
226
-				$movelist[0] = 'Root'; // move_received selectbox content
227
-			} else {
228
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
229
-			}
230
-			echo '</div>';
231
-		} else {
232
-			if (api_is_allowed_to_session_edit(false, true)) {
233
-				echo '<div class="actions">';
234
-				if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
235
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
236
-					echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
237
-					$movelist[0] = 'Root'; // move_received selectbox content
238
-				} else {
239
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
240
-				}
241
-				echo '</div>';
242
-			}
243
-		}
244
-	}
245
-
246
-	if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
247
-		// This is for the categories
248
-		if (isset($viewSentCategory) AND $viewSentCategory != '') {
249
-			$view_dropbox_category_sent = $viewSentCategory;
250
-		} else {
251
-			$view_dropbox_category_sent = 0;
252
-		}
253
-
254
-		/* Menu Sent */
255
-
256
-		if (api_get_session_id() == 0) {
257
-			echo '<div class="actions">';
258
-			if ($view_dropbox_category_sent != 0) {
259
-				echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
260
-				echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
261
-			} else {
262
-				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
263
-			}
264
-			if (empty($viewSentCategory)) {
265
-				echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
266
-			}
267
-			echo '</div>';
268
-		} else {
269
-			if (api_is_allowed_to_session_edit(false, true)) {
270
-				echo '<div class="actions">';
271
-				if ($view_dropbox_category_sent != 0) {
272
-					echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
273
-					echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
274
-				} else {
275
-					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
276
-				}
277
-				if (empty($viewSentCategory)) {
278
-					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
279
-				}
280
-				echo '</div>';
281
-			}
282
-		}
283
-	}
284
-	/*	THE MENU TABS */
285
-	if ($dropbox_cnf['sent_received_tabs']) {
196
+    // Getting all the categories in the dropbox for the given user
197
+    $dropbox_categories = get_dropbox_categories();
198
+    // Greating the arrays with the categories for the received files and for the sent files
199
+    foreach ($dropbox_categories as $category) {
200
+        if ($category['received'] == '1') {
201
+            $dropbox_received_category[] = $category;
202
+        }
203
+        if ($category['sent'] == '1') {
204
+            $dropbox_sent_category[] = $category;
205
+        }
206
+    }
207
+
208
+    // ACTIONS
209
+    if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
210
+        //echo '<h3>'.get_lang('ReceivedFiles').'</h3>';
211
+
212
+        // This is for the categories
213
+        if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') {
214
+            $view_dropbox_category_received = $viewReceivedCategory;
215
+        } else {
216
+            $view_dropbox_category_received = 0;
217
+        }
218
+
219
+        /* Menu Received */
220
+
221
+        if (api_get_session_id() == 0) {
222
+            echo '<div class="actions">';
223
+            if ($view_dropbox_category_received != 0  && api_is_allowed_to_session_edit(false, true)) {
224
+                echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
225
+                echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
226
+                $movelist[0] = 'Root'; // move_received selectbox content
227
+            } else {
228
+                echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
229
+            }
230
+            echo '</div>';
231
+        } else {
232
+            if (api_is_allowed_to_session_edit(false, true)) {
233
+                echo '<div class="actions">';
234
+                if ($view_dropbox_category_received != 0 && api_is_allowed_to_session_edit(false, true)) {
235
+                    echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category=0&view_sent_category='.$viewSentCategory.'&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
236
+                    echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).'</strong> ';
237
+                    $movelist[0] = 'Root'; // move_received selectbox content
238
+                } else {
239
+                    echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=addreceivedcategory&view='.$view.'">'.Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM).'</a>';
240
+                }
241
+                echo '</div>';
242
+            }
243
+        }
244
+    }
245
+
246
+    if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
247
+        // This is for the categories
248
+        if (isset($viewSentCategory) AND $viewSentCategory != '') {
249
+            $view_dropbox_category_sent = $viewSentCategory;
250
+        } else {
251
+            $view_dropbox_category_sent = 0;
252
+        }
253
+
254
+        /* Menu Sent */
255
+
256
+        if (api_get_session_id() == 0) {
257
+            echo '<div class="actions">';
258
+            if ($view_dropbox_category_sent != 0) {
259
+                echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
260
+                echo get_lang('Category').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
261
+            } else {
262
+                echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
263
+            }
264
+            if (empty($viewSentCategory)) {
265
+                echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
266
+            }
267
+            echo '</div>';
268
+        } else {
269
+            if (api_is_allowed_to_session_edit(false, true)) {
270
+                echo '<div class="actions">';
271
+                if ($view_dropbox_category_sent != 0) {
272
+                    echo get_lang('CurrentlySeeing').': <strong>'.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).'</strong> ';
273
+                    echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category=0&view='.$view.'">'.Display::return_icon('folder_up.png', get_lang('Up').' '.get_lang('Root'),'',ICON_SIZE_MEDIUM)."</a>";
274
+                } else {
275
+                    echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=addsentcategory\">".Display::return_icon('new_folder.png', get_lang('AddNewCategory'),'',ICON_SIZE_MEDIUM)."</a>\n";
276
+                }
277
+                if (empty($viewSentCategory)) {
278
+                    echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&view=".$view."&action=add\">".Display::return_icon('upload_file.png', get_lang('UploadNewFile'),'',ICON_SIZE_MEDIUM)."</a>";
279
+                }
280
+                echo '</div>';
281
+            }
282
+        }
283
+    }
284
+    /*	THE MENU TABS */
285
+    if ($dropbox_cnf['sent_received_tabs']) {
286 286
 ?>
287 287
 <ul class="nav nav-tabs">
288 288
     <li <?php if (!$view || $view == 'sent') { echo 'class="active"'; } ?> >
@@ -296,150 +296,150 @@  discard block
 block discarded – undo
296 296
     </li>
297 297
 </ul>
298 298
 <?php
299
-	}
299
+    }
300 300
     /*	RECEIVED FILES */
301
-	if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
302
-		// This is for the categories
303
-		if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') {
304
-			$view_dropbox_category_received = $viewReceivedCategory;
305
-		} else {
306
-			$view_dropbox_category_received = 0;
307
-		}
308
-
309
-		// Object initialisation
310
-		$dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
311
-		 // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
312
-
313
-		// Constructing the array that contains the total number of feedback messages per document.
314
-		$number_feedback = get_total_number_feedback();
315
-
316
-		// Sorting and paging options
317
-		$sorting_options = array();
318
-		$paging_options = array();
319
-
320
-		// The headers of the sortable tables
321
-		$column_header = array();
322
-		$column_header[] = array('', false, '');
323
-		$column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
324
-		$column_header[] = array(get_lang('ReceivedTitle'), true, '');
325
-		$column_header[] = array(get_lang('Size'), true, '');
326
-		$column_header[] = array(get_lang('Authors'), true, '');
327
-		$column_header[] = array(get_lang('LastResent'), true);
328
-
329
-		if (api_get_session_id() == 0) {
330
-			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
331
-		} elseif (api_is_allowed_to_session_edit(false,true)) {
332
-			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
333
-		}
334
-
335
-		$column_header[] = array('RealDate', true);
336
-		$column_header[] = array('RealSize', true);
337
-
338
-		// An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide
339
-		$column_show[] = 1;
340
-		$column_show[] = 1;
341
-		$column_show[] = 1;
342
-		$column_show[] = 1;
343
-		$column_show[] = 1;
344
-		$column_show[] = 1;
345
-
346
-		if (api_get_session_id() == 0) {
347
-			$column_show[] = 1;
348
-		} elseif (api_is_allowed_to_session_edit(false, true)) {
349
-			$column_show[] = 1;
350
-		}
351
-		$column_show[] = 0;
352
-
353
-		// Here we change the way how the columns are going to be sort
354
-		// in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate
355
-		// because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
356
-
357
-		$column_order[3] = 8;
358
-		$column_order[5] = 7;
359
-
360
-		// The content of the sortable table = the received files
361
-		foreach ($dropbox_person -> receivedWork as $dropbox_file) {
362
-			$dropbox_file_data = array();
363
-			if ($view_dropbox_category_received == $dropbox_file->category) {
301
+    if ($view == 'received' || !$dropbox_cnf['sent_received_tabs']) {
302
+        // This is for the categories
303
+        if (isset($viewReceivedCategory) AND $viewReceivedCategory != '') {
304
+            $view_dropbox_category_received = $viewReceivedCategory;
305
+        } else {
306
+            $view_dropbox_category_received = 0;
307
+        }
308
+
309
+        // Object initialisation
310
+        $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
311
+            // note: are the $is_courseAdmin and $is_courseTutor parameters needed????
312
+
313
+        // Constructing the array that contains the total number of feedback messages per document.
314
+        $number_feedback = get_total_number_feedback();
315
+
316
+        // Sorting and paging options
317
+        $sorting_options = array();
318
+        $paging_options = array();
319
+
320
+        // The headers of the sortable tables
321
+        $column_header = array();
322
+        $column_header[] = array('', false, '');
323
+        $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
324
+        $column_header[] = array(get_lang('ReceivedTitle'), true, '');
325
+        $column_header[] = array(get_lang('Size'), true, '');
326
+        $column_header[] = array(get_lang('Authors'), true, '');
327
+        $column_header[] = array(get_lang('LastResent'), true);
328
+
329
+        if (api_get_session_id() == 0) {
330
+            $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
331
+        } elseif (api_is_allowed_to_session_edit(false,true)) {
332
+            $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
333
+        }
334
+
335
+        $column_header[] = array('RealDate', true);
336
+        $column_header[] = array('RealSize', true);
337
+
338
+        // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide
339
+        $column_show[] = 1;
340
+        $column_show[] = 1;
341
+        $column_show[] = 1;
342
+        $column_show[] = 1;
343
+        $column_show[] = 1;
344
+        $column_show[] = 1;
345
+
346
+        if (api_get_session_id() == 0) {
347
+            $column_show[] = 1;
348
+        } elseif (api_is_allowed_to_session_edit(false, true)) {
349
+            $column_show[] = 1;
350
+        }
351
+        $column_show[] = 0;
352
+
353
+        // Here we change the way how the columns are going to be sort
354
+        // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate
355
+        // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
356
+
357
+        $column_order[3] = 8;
358
+        $column_order[5] = 7;
359
+
360
+        // The content of the sortable table = the received files
361
+        foreach ($dropbox_person -> receivedWork as $dropbox_file) {
362
+            $dropbox_file_data = array();
363
+            if ($view_dropbox_category_received == $dropbox_file->category) {
364 364
                 // we only display the files that are in the category that we are in.
365
-				$dropbox_file_data[] = $dropbox_file->id;
365
+                $dropbox_file_data[] = $dropbox_file->id;
366 366
 
367
-				if (!is_array($_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) {
368
-					$_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] = array();
369
-				}
367
+                if (!is_array($_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])) {
368
+                    $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX] = array();
369
+                }
370 370
 
371
-				// New icon
372
-				$new_icon = '';
373
-				if ($dropbox_file->last_upload_date > $last_access &&
371
+                // New icon
372
+                $new_icon = '';
373
+                if ($dropbox_file->last_upload_date > $last_access &&
374 374
                     !in_array($dropbox_file->id, $_SESSION['_seen'][$_course['id']][TOOL_DROPBOX])
375 375
                 ) {
376
-					$new_icon = '&nbsp;'.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL);
377
-				}
376
+                    $new_icon = '&nbsp;'.Display::return_icon('new_dropbox_message.png', get_lang('New'),'',ICON_SIZE_SMALL);
377
+                }
378 378
 
379
-				$link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
380
-				$dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
381
-				$dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
379
+                $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
380
+                $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
381
+                $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
382 382
                     Display::return_icon('save.png', get_lang('Download'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a>'.$new_icon.'<br />'.$dropbox_file->description;
383
-				$file_size = $dropbox_file->filesize;
384
-				$dropbox_file_data[] = format_file_size($file_size);
385
-				$dropbox_file_data[] = $dropbox_file->author;
383
+                $file_size = $dropbox_file->filesize;
384
+                $dropbox_file_data[] = format_file_size($file_size);
385
+                $dropbox_file_data[] = $dropbox_file->author;
386 386
 
387
-				$last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
388
-				$dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.
387
+                $last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
388
+                $dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.
389 389
                     api_format_date($last_upload_date).'</span>';
390 390
 
391
-				$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
391
+                $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
392 392
                 <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a>
393 393
                 <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movereceived&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a>
394 394
                 <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.
395 395
                 Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
396 396
 
397
-				// This is a hack to have an additional row in a sortable table
398
-
399
-				if ($action == 'viewfeedback' AND isset($_GET['id']) and is_numeric($_GET['id']) AND $dropbox_file->id == $_GET['id']) {
400
-					$action_icons .= "</td></tr>"; // Ending the normal row of the sortable table
401
-					$action_icons .= '<tr><td colspan="2"><a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?"'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a></td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
402
-				}
403
-				if (api_get_session_id() == 0) {
404
-					$dropbox_file_data[] = $action_icons;
405
-				} elseif (api_is_allowed_to_session_edit(false, true)) {
406
-					$dropbox_file_data[] = $action_icons;
407
-				}
408
-				$action_icons = '';
409
-				$dropbox_file_data[] = $last_upload_date;
410
-				$dropbox_file_data[] = $file_size;
411
-				$dropbox_data_recieved[] = $dropbox_file_data;
412
-			}
413
-		}
414
-
415
-		// The content of the sortable table = the categories (if we are not in the root)
416
-		if ($view_dropbox_category_received == 0) {
417
-			foreach ($dropbox_categories as $category) {
418
-			    /*  Note: This can probably be shortened since the categories
397
+                // This is a hack to have an additional row in a sortable table
398
+
399
+                if ($action == 'viewfeedback' AND isset($_GET['id']) and is_numeric($_GET['id']) AND $dropbox_file->id == $_GET['id']) {
400
+                    $action_icons .= "</td></tr>"; // Ending the normal row of the sortable table
401
+                    $action_icons .= '<tr><td colspan="2"><a href="'.api_get_path(WEB_CODE_PATH).'dropbox/index.php?"'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a></td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
402
+                }
403
+                if (api_get_session_id() == 0) {
404
+                    $dropbox_file_data[] = $action_icons;
405
+                } elseif (api_is_allowed_to_session_edit(false, true)) {
406
+                    $dropbox_file_data[] = $action_icons;
407
+                }
408
+                $action_icons = '';
409
+                $dropbox_file_data[] = $last_upload_date;
410
+                $dropbox_file_data[] = $file_size;
411
+                $dropbox_data_recieved[] = $dropbox_file_data;
412
+            }
413
+        }
414
+
415
+        // The content of the sortable table = the categories (if we are not in the root)
416
+        if ($view_dropbox_category_received == 0) {
417
+            foreach ($dropbox_categories as $category) {
418
+                /*  Note: This can probably be shortened since the categories
419 419
 			    for the received files are already in the
420 420
 			    $dropbox_received_category array;*/
421
-				$dropbox_category_data = array();
422
-				if ($category['received'] == '1') {
423
-					$movelist[$category['cat_id']] = $category['cat_name'];
421
+                $dropbox_category_data = array();
422
+                if ($category['received'] == '1') {
423
+                    $movelist[$category['cat_id']] = $category['cat_name'];
424 424
                     // This is where the checkbox icon for the files appear
425
-					$dropbox_category_data[] = $category['cat_id'];
426
-					// The icon of the category
427
-					$link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">';
428
-					$dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>';
429
-					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>';
430
-					$dropbox_category_data[] = '';
431
-					$dropbox_category_data[] = '';
432
-					$dropbox_category_data[] = '';
433
-					$dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
425
+                    $dropbox_category_data[] = $category['cat_id'];
426
+                    // The icon of the category
427
+                    $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$category['cat_id'].'&view_sent_category='.$viewSentCategory.'&view='.$view.'">';
428
+                    $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).'</a>';
429
+                    $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=received">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$category['cat_name'].'</a>';
430
+                    $dropbox_category_data[] = '';
431
+                    $dropbox_category_data[] = '';
432
+                    $dropbox_category_data[] = '';
433
+                    $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
434 434
 										  <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletereceivedcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
435
-				}
436
-				if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
437
-					$dropbox_data_recieved[] = $dropbox_category_data;
438
-				}
439
-			}
440
-		}
441
-
442
-		// Displaying the table
435
+                }
436
+                if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
437
+                    $dropbox_data_recieved[] = $dropbox_category_data;
438
+                }
439
+            }
440
+        }
441
+
442
+        // Displaying the table
443 443
         $additional_get_parameters = array(
444 444
             'view' => $view,
445 445
             'view_received_category' => $viewReceivedCategory,
@@ -450,15 +450,15 @@  discard block
 block discarded – undo
450 450
             'download_received' => get_lang('Download')
451 451
         );
452 452
 
453
-		if (is_array($movelist)) {
454
-			foreach ($movelist as $catid => $catname){
455
-				$selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname);
456
-			}
457
-		}
453
+        if (is_array($movelist)) {
454
+            foreach ($movelist as $catid => $catname){
455
+                $selectlist['move_received_'.$catid] = get_lang('Move') . '->'. Security::remove_XSS($catname);
456
+            }
457
+        }
458 458
 
459
-		if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
460
-			$selectlist = array();
461
-		}
459
+        if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
460
+            $selectlist = array();
461
+        }
462 462
         echo '<div class="files-table">';
463 463
         Display::display_sortable_config_table(
464 464
             'dropbox',
@@ -472,153 +472,153 @@  discard block
 block discarded – undo
472 472
             $selectlist
473 473
         );
474 474
         echo '</div>';
475
-	}
476
-
477
-	/*	SENT FILES */
478
-
479
-	if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
480
-		// This is for the categories
481
-		if (isset($viewSentCategory) AND $viewSentCategory != '') {
482
-			$view_dropbox_category_sent = $viewSentCategory;
483
-		} else {
484
-			$view_dropbox_category_sent = 0;
485
-		}
486
-
487
-		// Object initialisation
488
-		$dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
489
-
490
-		// Constructing the array that contains the total number of feedback messages per document.
491
-		$number_feedback = get_total_number_feedback();
492
-
493
-		// Sorting and paging options
494
-		$sorting_options = array();
495
-		$paging_options = array();
496
-
497
-		// The headers of the sortable tables
498
-		$column_header = array();
499
-
500
-		$column_header[] = array('', false, '');
501
-		$column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
502
-		$column_header[] = array(get_lang('SentTitle'), true, '');
503
-		$column_header[] = array(get_lang('Size'), true, '');
504
-		$column_header[] = array(get_lang('SentTo'), true, '');
505
-		$column_header[] = array(get_lang('LastResent'), true, '');
506
-
507
-		if (api_get_session_id() == 0) {
508
-			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
509
-		} elseif (api_is_allowed_to_session_edit(false, true)) {
510
-			$column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
511
-		}
512
-
513
-		$column_header[] = array('RealDate', true);
514
-		$column_header[] = array('RealSize', true);
515
-
516
-		$column_show = array();
517
-		$column_order = array();
518
-
519
-		// An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide
520
-		$column_show[] = 1;
521
-		$column_show[] = 1;
522
-		$column_show[] = 1;
523
-		$column_show[] = 1;
524
-		$column_show[] = 1;
525
-		$column_show[] = 1;
526
-		if (api_get_session_id() == 0) {
527
-			$column_show[] = 1;
528
-		} elseif (api_is_allowed_to_session_edit(false, true)) {
529
-			$column_show[] = 1;
530
-		}
531
-		$column_show[] = 0;
532
-
533
-		// Here we change the way how the colums are going to be sort
534
-		// in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate
535
-		// because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
536
-
537
-		$column_order[3] = 8;
538
-		$column_order[5] = 7;
539
-
540
-		// The content of the sortable table = the received files
541
-		foreach ($dropbox_person->sentWork as $dropbox_file) {
542
-			$dropbox_file_data = array();
543
-
544
-			if ($view_dropbox_category_sent == $dropbox_file->category) {
545
-				$dropbox_file_data[] = $dropbox_file->id;
546
-				$link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
547
-				$dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
548
-				$dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
475
+    }
476
+
477
+    /*	SENT FILES */
478
+
479
+    if (!$view || $view == 'sent' || !$dropbox_cnf['sent_received_tabs']) {
480
+        // This is for the categories
481
+        if (isset($viewSentCategory) AND $viewSentCategory != '') {
482
+            $view_dropbox_category_sent = $viewSentCategory;
483
+        } else {
484
+            $view_dropbox_category_sent = 0;
485
+        }
486
+
487
+        // Object initialisation
488
+        $dropbox_person = new Dropbox_Person(api_get_user_id(), $is_courseAdmin, $is_courseTutor);
489
+
490
+        // Constructing the array that contains the total number of feedback messages per document.
491
+        $number_feedback = get_total_number_feedback();
492
+
493
+        // Sorting and paging options
494
+        $sorting_options = array();
495
+        $paging_options = array();
496
+
497
+        // The headers of the sortable tables
498
+        $column_header = array();
499
+
500
+        $column_header[] = array('', false, '');
501
+        $column_header[] = array(get_lang('Type'), true, 'style="width:40px"', 'style="text-align:center"');
502
+        $column_header[] = array(get_lang('SentTitle'), true, '');
503
+        $column_header[] = array(get_lang('Size'), true, '');
504
+        $column_header[] = array(get_lang('SentTo'), true, '');
505
+        $column_header[] = array(get_lang('LastResent'), true, '');
506
+
507
+        if (api_get_session_id() == 0) {
508
+            $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
509
+        } elseif (api_is_allowed_to_session_edit(false, true)) {
510
+            $column_header[] = array(get_lang('Modify'), false, '', 'nowrap style="text-align: right"');
511
+        }
512
+
513
+        $column_header[] = array('RealDate', true);
514
+        $column_header[] = array('RealSize', true);
515
+
516
+        $column_show = array();
517
+        $column_order = array();
518
+
519
+        // An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide
520
+        $column_show[] = 1;
521
+        $column_show[] = 1;
522
+        $column_show[] = 1;
523
+        $column_show[] = 1;
524
+        $column_show[] = 1;
525
+        $column_show[] = 1;
526
+        if (api_get_session_id() == 0) {
527
+            $column_show[] = 1;
528
+        } elseif (api_is_allowed_to_session_edit(false, true)) {
529
+            $column_show[] = 1;
530
+        }
531
+        $column_show[] = 0;
532
+
533
+        // Here we change the way how the colums are going to be sort
534
+        // in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate
535
+        // because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
536
+
537
+        $column_order[3] = 8;
538
+        $column_order[5] = 7;
539
+
540
+        // The content of the sortable table = the received files
541
+        foreach ($dropbox_person->sentWork as $dropbox_file) {
542
+            $dropbox_file_data = array();
543
+
544
+            if ($view_dropbox_category_sent == $dropbox_file->category) {
545
+                $dropbox_file_data[] = $dropbox_file->id;
546
+                $link_open = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'">';
547
+                $dropbox_file_data[] = $link_open.DocumentManager::build_document_icon_tag('file', $dropbox_file->title).'</a>';
548
+                $dropbox_file_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&id='.$dropbox_file->id.'&action=download">'.
549 549
                     Display::return_icon('save.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.$dropbox_file->title.'</a><br />'.$dropbox_file->description;
550
-				$file_size = $dropbox_file->filesize;
551
-				$dropbox_file_data[] = format_file_size($file_size);
550
+                $file_size = $dropbox_file->filesize;
551
+                $dropbox_file_data[] = format_file_size($file_size);
552 552
                 $receivers_celldata = null;
553
-				foreach ($dropbox_file->recipients as $recipient) {
554
-					$userInfo = api_get_user_info($recipient['user_id']);
555
-					$receivers_celldata = UserManager::getUserProfileLink($userInfo).', '.$receivers_celldata;
556
-				}
557
-				$receivers_celldata = trim(trim($receivers_celldata), ','); // Removing the trailing comma.
558
-				$dropbox_file_data[] = $receivers_celldata;
559
-				$last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
560
-				$dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.api_format_date($last_upload_date).'</span>';
561
-
562
-				//$dropbox_file_data[] = $dropbox_file->author;
563
-				$receivers_celldata = '';
564
-
565
-				$action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
553
+                foreach ($dropbox_file->recipients as $recipient) {
554
+                    $userInfo = api_get_user_info($recipient['user_id']);
555
+                    $receivers_celldata = UserManager::getUserProfileLink($userInfo).', '.$receivers_celldata;
556
+                }
557
+                $receivers_celldata = trim(trim($receivers_celldata), ','); // Removing the trailing comma.
558
+                $dropbox_file_data[] = $receivers_celldata;
559
+                $last_upload_date = api_get_local_time($dropbox_file->last_upload_date);
560
+                $dropbox_file_data[] = date_to_str_ago($last_upload_date).'<br /><span class="dropbox_date">'.api_format_date($last_upload_date).'</span>';
561
+
562
+                //$dropbox_file_data[] = $dropbox_file->author;
563
+                $receivers_celldata = '';
564
+
565
+                $action_icons = check_number_feedback($dropbox_file->id, $number_feedback).' '.get_lang('Feedback').'
566 566
                     <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=viewfeedback&id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('discuss.png', get_lang('Comment'),'',ICON_SIZE_SMALL).'</a>
567 567
                     <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=movesent&move_id='.$dropbox_file->id.'&'.$sort_params.'">'.Display::return_icon('move.png', get_lang('Move'),'',ICON_SIZE_SMALL).'</a>
568 568
                     <a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentfile&id='.$dropbox_file->id.'&'.$sort_params.'" onclick="javascript: return confirmation(\''.$dropbox_file->title.'\');">'.Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
569
-				// This is a hack to have an additional row in a sortable table
570
-				if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
571
-					$action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table
572
-					$action_icons .= "<tr><td colspan=\"2\">";
573
-					$action_icons .= "<a href=\"".api_get_path(WEB_CODE_PATH)."dropbox/index.php?".api_get_cidreq()."&view_received_category=".$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a>";
574
-					$action_icons .= "</td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
575
-				}
576
-				$dropbox_file_data[] = $action_icons;
577
-				$dropbox_file_data[] = $last_upload_date;
578
-				$dropbox_file_data[] = $file_size;
579
-				$action_icons = '';
580
-				$dropbox_data_sent[] = $dropbox_file_data;
581
-			}
582
-		}
569
+                // This is a hack to have an additional row in a sortable table
570
+                if ($action == 'viewfeedback' && isset($_GET['id']) && is_numeric($_GET['id']) && $dropbox_file->id == $_GET['id']) {
571
+                    $action_icons .= "</td></tr>\n"; // ending the normal row of the sortable table
572
+                    $action_icons .= "<tr><td colspan=\"2\">";
573
+                    $action_icons .= "<a href=\"".api_get_path(WEB_CODE_PATH)."dropbox/index.php?".api_get_cidreq()."&view_received_category=".$viewReceivedCategory."&view_sent_category=".$viewSentCategory."&view=".$view.'&'.$sort_params."\">".get_lang('CloseFeedback')."</a>";
574
+                    $action_icons .= "</td><td colspan=\"7\">".feedback($dropbox_file->feedback2)."</td></tr>";
575
+                }
576
+                $dropbox_file_data[] = $action_icons;
577
+                $dropbox_file_data[] = $last_upload_date;
578
+                $dropbox_file_data[] = $file_size;
579
+                $action_icons = '';
580
+                $dropbox_data_sent[] = $dropbox_file_data;
581
+            }
582
+        }
583 583
 
584 584
         $moveList = array();
585
-		// The content of the sortable table = the categories (if we are not in the root)
586
-		if ($view_dropbox_category_sent == 0) {
587
-			foreach ($dropbox_categories as $category) {
588
-				$dropbox_category_data = array();
585
+        // The content of the sortable table = the categories (if we are not in the root)
586
+        if ($view_dropbox_category_sent == 0) {
587
+            foreach ($dropbox_categories as $category) {
588
+                $dropbox_category_data = array();
589 589
 
590
-				if ($category['sent'] == '1') {
590
+                if ($category['sent'] == '1') {
591 591
 
592 592
                     $moveList[$category['cat_id']] = $category['cat_name'];
593
-					$dropbox_category_data[] = $category['cat_id'];
594
-					// This is where the checkbox icon for the files appear.
595
-					$link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">';
596
-					$dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>';
597
-					$dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>';
598
-					//$dropbox_category_data[] = '';
599
-					$dropbox_category_data[] = '';
600
-					//$dropbox_category_data[] = '';
601
-					$dropbox_category_data[] = '';
602
-					$dropbox_category_data[] = '';
603
-					$dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.
593
+                    $dropbox_category_data[] = $category['cat_id'];
594
+                    // This is where the checkbox icon for the files appear.
595
+                    $link_open = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$category['cat_id'].'&view='.$view.'">';
596
+                    $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).'</a>';
597
+                    $dropbox_category_data[] = '<a href="'.api_get_path(WEB_CODE_PATH).'dropbox/dropbox_download.php?'.api_get_cidreq().'&cat_id='.$category['cat_id'].'&action=downloadcategory&sent_received=sent">'.Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'),ICON_SIZE_SMALL).'</a>'.$link_open.Security::remove_XSS($category['cat_name']).'</a>';
598
+                    //$dropbox_category_data[] = '';
599
+                    $dropbox_category_data[] = '';
600
+                    //$dropbox_category_data[] = '';
601
+                    $dropbox_category_data[] = '';
602
+                    $dropbox_category_data[] = '';
603
+                    $dropbox_category_data[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=editcategory&id='.$category['cat_id'].'">'.
604 604
                                     Display::return_icon('edit.png', get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>
605 605
 									<a href="'.api_get_self().'?'.api_get_cidreq().'&view_received_category='.$viewReceivedCategory.'&view_sent_category='.$viewSentCategory.'&view='.$view.'&action=deletesentcategory&id='.$category['cat_id'].'" onclick="javascript: return confirmation(\''.Security::remove_XSS($category['cat_name']).'\');">'.
606 606
                                     Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
607
-				}
608
-				if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
609
-					$dropbox_data_sent[] = $dropbox_category_data;
610
-				}
611
-			}
612
-		}
613
-
614
-		// Displaying the table
615
-		$additional_get_parameters = array(
607
+                }
608
+                if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) {
609
+                    $dropbox_data_sent[] = $dropbox_category_data;
610
+                }
611
+            }
612
+        }
613
+
614
+        // Displaying the table
615
+        $additional_get_parameters = array(
616 616
             'view' => $view,
617 617
             'view_received_category' => $viewReceivedCategory,
618 618
             'view_sent_category' => $viewSentCategory
619 619
         );
620 620
 
621
-		$selectlist = array(
621
+        $selectlist = array(
622 622
             'delete_received' => get_lang('Delete'),
623 623
             'download_received' => get_lang('Download')
624 624
         );
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
             }
630 630
         }
631 631
 
632
-		if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
633
-			$selectlist = array('download_received' => get_lang('Download'));
634
-		}
632
+        if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
633
+            $selectlist = array('download_received' => get_lang('Download'));
634
+        }
635 635
 
636 636
         echo '<div class="files-table">';
637
-		Display::display_sortable_config_table(
637
+        Display::display_sortable_config_table(
638 638
             'dropbox',
639 639
             $column_header,
640 640
             $dropbox_data_sent,
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
             $selectlist
647 647
         );
648 648
         echo '</div>';
649
-	}
649
+    }
650 650
 }
651 651
 
652 652
 Display::display_footer();
Please login to merge, or discard this patch.
main/cron/lang/list_undefined_langvars.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     $file = $path.'/'.$entry;
20 20
     if (is_file($file)) {
21 21
         $terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true));
22
-	}
22
+    }
23 23
 }
24 24
 // get only the array keys (the language variables defined in language files)
25 25
 $defined_terms = array_flip(array_keys($terms));
@@ -32,14 +32,14 @@  discard block
 block discarded – undo
32 32
 foreach ($files as $file) {
33 33
     //echo 'Analyzing '.$file."<br />";
34 34
     $shortfile = substr($file,$l);
35
-	$lines = file($file);
35
+    $lines = file($file);
36 36
     foreach ($lines as $line) {
37
-    	$myterms = array();
37
+        $myterms = array();
38 38
         $res = preg_match_all('/get_lang\(\'(\\w*)\'\)/',$line,$myterms);
39 39
         if ($res > 0) {
40 40
             foreach($myterms[1] as $term) {
41 41
                 if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
42
-                	$undefined_terms[$term] = $shortfile;
42
+                    $undefined_terms[$term] = $shortfile;
43 43
                     //echo "Undefined: $term<br />";
44 44
                 }
45 45
             }
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         if ($res > 0) {
50 50
             foreach($myterms[1] as $term) {
51 51
                 if (!isset($defined_terms[$term]) && !isset($defined_terms['lang'.$term])) {
52
-                	$undefined_terms[$term] = $shortfile;
52
+                    $undefined_terms[$term] = $shortfile;
53 53
                     //echo "Undefined: $term<br />";
54 54
                 }
55 55
             }
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
     $list = scandir($base_path);
74 74
     $files = array();
75 75
     foreach ($list as $item) {
76
-    	if (substr($item,0,1)=='.') {continue;}
76
+        if (substr($item,0,1)=='.') {continue;}
77 77
         $special_dirs = array(api_get_path(SYS_TEST_PATH),api_get_path(SYS_COURSE_PATH),api_get_path(SYS_LANG_PATH),api_get_path(SYS_ARCHIVE_PATH));
78 78
         if (in_array($base_path.$item.'/',$special_dirs)) {continue;}
79 79
         if (is_dir($base_path.$item)) {
80
-        	$files = array_merge($files,get_all_php_files($base_path.$item.'/'));
80
+            $files = array_merge($files,get_all_php_files($base_path.$item.'/'));
81 81
         } else {
82 82
             //only analyse php files
83 83
                 $sub = substr($item,-4);
84
-        	if ($sub == '.php' or $sub == '.tpl') {
84
+            if ($sub == '.php' or $sub == '.tpl') {
85 85
                     $files[] = $base_path.$item;
86
-        	}
86
+            }
87 87
         }
88 88
     }
89 89
     $list = null;
Please login to merge, or discard this patch.
main/inc/ajax/nanogong.ajax.php 1 patch
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -16,84 +16,84 @@
 block discarded – undo
16 16
 //Fix in order to add the exe_id
17 17
 
18 18
 if (isset($_REQUEST['from_htaccess'])) {
19
-	if (isset($_REQUEST['file'])) {
20
-		$fileinfo = pathinfo($_REQUEST['file']);
21
-		$items = explode('-', $fileinfo['filename']);
22
-		$_REQUEST['exe_id'] = $items[5];
23
-	}
19
+    if (isset($_REQUEST['file'])) {
20
+        $fileinfo = pathinfo($_REQUEST['file']);
21
+        $items = explode('-', $fileinfo['filename']);
22
+        $_REQUEST['exe_id'] = $items[5];
23
+    }
24 24
 }
25 25
 $nano = new Nanogong($_REQUEST);
26 26
 $is_nano = false;
27 27
 
28 28
 if (isset($_REQUEST['is_nano'])) {
29
-	$is_nano = true;
29
+    $is_nano = true;
30 30
 }
31 31
 
32 32
 switch ($action) {
33
-	case 'get_file':
34
-		if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
-			$file_path = $nano->load_filename_if_exists();
36
-			//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
-			if ($file_path) {
38
-				$info = pathinfo($file_path);
39
-				$user_info = api_get_user_info($nano->params['user_id']);
40
-				$name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
-				$download = true;
42
-				if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
-					$download = false;
44
-				}
45
-				DocumentManager::file_send_for_download($file_path, $download);
46
-				exit;
47
-			}
48
-		}
49
-		break;
50
-	case 'show_audio':
51
-		if (!$is_nano) {
52
-			echo $nano->return_js($_REQUEST);
53
-		}
54
-		echo $nano->show_audio_file($is_nano);
55
-		break;
56
-	case 'delete':
57
-		$return = $nano->delete_files();
58
-		if ($return == 1) {
59
-			//cant' do this because the post that nano send doesnt take into account the session
60
-			Display::display_confirmation_message(get_lang('FileDeleted'));
61
-		} else {
62
-			Display::display_confirmation_message(get_lang('FileNotFound'));
63
-		}
64
-		break;
65
-	case 'show_form':
66
-		api_protect_course_script(true);
67
-		Display::display_reduced_header();
68
-		echo $nano->return_js($_REQUEST);
69
-		echo $nano->return_form();
70
-		break;
33
+    case 'get_file':
34
+        if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
35
+            $file_path = $nano->load_filename_if_exists();
36
+            //$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
37
+            if ($file_path) {
38
+                $info = pathinfo($file_path);
39
+                $user_info = api_get_user_info($nano->params['user_id']);
40
+                $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension'];
41
+                $download = true;
42
+                if (isset($_REQUEST['download'])  && $_REQUEST['download'] == 0) {
43
+                    $download = false;
44
+                }
45
+                DocumentManager::file_send_for_download($file_path, $download);
46
+                exit;
47
+            }
48
+        }
49
+        break;
50
+    case 'show_audio':
51
+        if (!$is_nano) {
52
+            echo $nano->return_js($_REQUEST);
53
+        }
54
+        echo $nano->show_audio_file($is_nano);
55
+        break;
56
+    case 'delete':
57
+        $return = $nano->delete_files();
58
+        if ($return == 1) {
59
+            //cant' do this because the post that nano send doesnt take into account the session
60
+            Display::display_confirmation_message(get_lang('FileDeleted'));
61
+        } else {
62
+            Display::display_confirmation_message(get_lang('FileNotFound'));
63
+        }
64
+        break;
65
+    case 'show_form':
66
+        api_protect_course_script(true);
67
+        Display::display_reduced_header();
68
+        echo $nano->return_js($_REQUEST);
69
+        echo $nano->return_form();
70
+        break;
71 71
     case 'save_file':
72
-    	//User access same as upload.php
72
+        //User access same as upload.php
73 73
 
74
-    	$return = $nano->upload_file($is_nano);
74
+        $return = $nano->upload_file($is_nano);
75 75
 
76
-    	if ($is_nano) {
77
-    		//nano looks for numbers
78
-	    	if ($return == 1) {
79
-	    		//cant' do this because the post that nano send doesnt take into account the session
80
-	    		echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded'));
81
-	    	} else {
82
-	    		echo 0;
83
-	    		//Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension'));
84
-	    	}
85
-    	} else {
86
-    		Display::display_reduced_header();
87
-    		echo $nano->return_js($_REQUEST);
88
-    		//normal form
89
-    		if ($return == 1) {
90
-    			//cant' do this because the post that nano send doesnt take into account the session
91
-    			$message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm');
92
-    		} else {
93
-    			$message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning');
94
-    		}
95
-    		echo $nano->return_form($message);
96
-    	}
76
+        if ($is_nano) {
77
+            //nano looks for numbers
78
+            if ($return == 1) {
79
+                //cant' do this because the post that nano send doesnt take into account the session
80
+                echo 1; //Display::display_confirmation_message(get_lang('UplUploadSucceeded'));
81
+            } else {
82
+                echo 0;
83
+                //Display::display_warning_message(get_lang('UplUnableToSaveFileFilteredExtension'));
84
+            }
85
+        } else {
86
+            Display::display_reduced_header();
87
+            echo $nano->return_js($_REQUEST);
88
+            //normal form
89
+            if ($return == 1) {
90
+                //cant' do this because the post that nano send doesnt take into account the session
91
+                $message = Display::return_message(get_lang('UplUploadSucceeded'), 'confirm');
92
+            } else {
93
+                $message = Display::return_message(get_lang('UplUnableToSaveFileFilteredExtension'), 'warning');
94
+            }
95
+            echo $nano->return_form($message);
96
+        }
97 97
         break;
98 98
     default:
99 99
         echo '';
Please login to merge, or discard this patch.
main/inc/ajax/install.ajax.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 $action = $_GET['a'];
10 10
 
11 11
 switch ($action) {
12
-	case 'send_contact_information':
12
+    case 'send_contact_information':
13 13
         if (!empty($_POST)) {
14 14
             // get params from contact form
15 15
             $person_name = $_POST['person_name'];
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
             }
62 62
         break;
63
-	default:
64
-		echo '';
63
+    default:
64
+        echo '';
65 65
 }
66 66
 exit;
Please login to merge, or discard this patch.
main/inc/lib/magpierss/rss_cache.inc 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
         }
97 97
         
98 98
         if ($filesize = filesize($cache_file) ) {
99
-        	$data = fread( $fp, filesize($cache_file) );
100
-        	$rss = $this->unserialize( $data );
99
+            $data = fread( $fp, filesize($cache_file) );
100
+            $rss = $this->unserialize( $data );
101 101
         
102
-        	return $rss;
103
-    	}
102
+            return $rss;
103
+        }
104 104
     	
105
-    	return 0;
105
+        return 0;
106 106
     }
107 107
 
108 108
 /*=======================================================================*\
@@ -136,17 +136,17 @@  discard block
 block discarded – undo
136 136
         }
137 137
     }
138 138
 
139
-	public function cache_age( $url ) {
140
-		$filename = $this->file_name( $url);
141
-		if ( file_exists( $filename ) ) {
142
-			$mtime = filemtime( $filename );
139
+    public function cache_age( $url ) {
140
+        $filename = $this->file_name( $url);
141
+        if ( file_exists( $filename ) ) {
142
+            $mtime = filemtime( $filename );
143 143
             $age = time() - $mtime;
144
-			return $age;
145
-		}
146
-		else {
147
-			return -1;	
148
-		}
149
-	}
144
+            return $age;
145
+        }
146
+        else {
147
+            return -1;	
148
+        }
149
+    }
150 150
 	
151 151
 /*=======================================================================*\
152 152
     Function:   serialize
Please login to merge, or discard this patch.
main/inc/lib/access_url_edit_users_to_url_functions.lib.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@
 block discarded – undo
40 40
             // search users where username or firstname or lastname begins likes $needle
41 41
             $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
42 42
             $sql = 'SELECT u.user_id, username, lastname, firstname FROM '.$tbl_user.' u '.
43
-                   ' WHERE (username LIKE "'.$needle.'%" '.
44
-                   ' OR firstname LIKE "'.$needle.'%" '.
45
-                   ' OR lastname LIKE "'.$needle.'%") '.
43
+                    ' WHERE (username LIKE "'.$needle.'%" '.
44
+                    ' OR firstname LIKE "'.$needle.'%" '.
45
+                    ' OR lastname LIKE "'.$needle.'%") '.
46 46
                     $order_clause .
47
-                   ' LIMIT 11';
47
+                    ' LIMIT 11';
48 48
 
49 49
             $rs = Database::query($sql);
50 50
             $i=0;
Please login to merge, or discard this patch.
main/inc/lib/pear/HTML/Table.php 1 patch
Indentation   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,6 @@  discard block
 block discarded – undo
48 48
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
49 49
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
50 50
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51
-
52 51
  *
53 52
  * @category   HTML
54 53
  * @package    HTML_Table
@@ -256,7 +255,7 @@  discard block
 block discarded – undo
256 255
 
257 256
         $body = $this->_tbodyCount++;
258 257
         $this->_tbodies[$body] = new HTML_Table_Storage($this->_tabOffset,
259
-                                                         $this->_useTGroups);
258
+                                                            $this->_useTGroups);
260 259
         $this->_tbodies[$body]->setAutoFill($this->_autoFill);
261 260
         $this->_tbodies[$body]->setAttributes($attributes);
262 261
         return $body;
@@ -308,7 +307,7 @@  discard block
 block discarded – undo
308 307
         if (isset($colgroup)) {
309 308
             $attributes = $this->_parseAttributes($attributes);
310 309
             $this->_colgroup[] = array('attr' => $attributes,
311
-                                       'contents' => $colgroup);
310
+                                        'contents' => $colgroup);
312 311
         } else {
313 312
             $this->_colgroup = array();
314 313
         }
Please login to merge, or discard this patch.