Passed
Push — 1.10.x ( 04397c...5e25f1 )
by Angel Fernando Quiroz
181:14 queued 130:00
created
main/admin/user_import.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -241,10 +241,10 @@
 block discarded – undo
241 241
     return $users;
242 242
 }
243 243
 /**
244
- * XML-parser: handle start of element
245
- * @param   string  $parser Deprecated?
246
- * @param   string  $data The data to be parsed
247
- */
244
+     * XML-parser: handle start of element
245
+     * @param   string  $parser Deprecated?
246
+     * @param   string  $data The data to be parsed
247
+     */
248 248
 function element_start($parser, $data)
249 249
 {
250 250
     $data = api_utf8_decode($data);
Please login to merge, or discard this patch.
main/admin/filler.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 $output = array();
31 31
 if (!empty($_GET['fill'])) {
32 32
     switch ($_GET['fill']) {
33
-    	case 'users':
34
-        	require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php';
33
+        case 'users':
34
+            require api_get_path(SYS_TEST_PATH).'datafiller/fill_users.php';
35 35
             $output = fill_users();
36 36
             break;
37 37
         case 'courses':
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
     $result .= '<table>';
54 54
     foreach ($output as $line) {
55 55
         $result .= '<tr>';
56
-	    $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
-	    $result .= '</tr>';
56
+        $result .= '<td class="filler-report-data-init">'.$line['line-init'].' </td><td class="filler-report-data">'.$line['line-info'].'</td>';
57
+        $result .= '</tr>';
58 58
     }
59 59
     $result .= '</table>';
60 60
     $result .= '</div>';
Please login to merge, or discard this patch.
main/admin/access_url_edit_course_category_to_url.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
 }
125 125
 
126 126
 if ($add_type == 'multiple') {
127
-	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
128
-	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
127
+    $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
128
+    $link_add_type_multiple = get_lang('SessionAddTypeMultiple');
129 129
 } else {
130
-	$link_add_type_unique = get_lang('SessionAddTypeUnique');
131
-	$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
130
+    $link_add_type_unique = get_lang('SessionAddTypeUnique');
131
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
132 132
 }
133 133
 
134 134
 $url_list = UrlManager::get_url_data();
@@ -192,34 +192,34 @@  discard block
 block discarded – undo
192 192
     <?php } else { ?>
193 193
 	  <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
194 194
 		<?php
195
-		foreach ($noUserGroupList as $noItem) {
196
-		?>
195
+        foreach ($noUserGroupList as $noItem) {
196
+        ?>
197 197
 			<option value="<?php echo $noItem['id']; ?>">
198 198
                 <?php echo $noItem['name']; ?>
199 199
             </option>
200 200
 		<?php
201
-		}
202
-		?>
201
+        }
202
+        ?>
203 203
 	  </select>
204 204
 	<?php
205
-  	  }
206
-  	 ?>
205
+        }
206
+        ?>
207 207
   </div>
208 208
   </td>
209 209
   <td width="10%" valign="middle" align="center">
210 210
   <?php
211
-  if ($ajax_search) {
212
-	?>
211
+    if ($ajax_search) {
212
+    ?>
213 213
 	<button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" ></button>
214 214
   	<?php
215
-  } else {
216
-  	?>
215
+    } else {
216
+        ?>
217 217
 	<button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" ></button>
218 218
 	<br /><br />
219 219
 	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" ></button>
220 220
 	<?php
221
-  }
222
-  ?>
221
+    }
222
+    ?>
223 223
 	<br /><br /><br /><br /><br /><br />
224 224
   </td>
225 225
   <td align="center">
@@ -240,11 +240,11 @@  discard block
 block discarded – undo
240 240
 	<td colspan="3" align="center">
241 241
 		<br />
242 242
 		<?php
243
-		if(isset($_GET['add']))
244
-			echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
245
-		else
246
-			echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
247
-		?>
243
+        if(isset($_GET['add']))
244
+            echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
245
+        else
246
+            echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
247
+        ?>
248 248
 	</td>
249 249
 </tr>
250 250
 </table>
Please login to merge, or discard this patch.
main/admin/add_users_to_group.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
               <?php
402 402
                 $selected_letter = isset($_POST['firstLetterUser']) ? $_POST['firstLetterUser'] : null;
403 403
                 echo Display :: get_alphabet_options($selected_letter);
404
-              ?>
404
+                ?>
405 405
 	     </select>
406 406
     </div>
407 407
 </td>
@@ -412,59 +412,59 @@  discard block
 block discarded – undo
412 412
   <td align="center">
413 413
   <div id="content_source">
414 414
   	  <?php
415
-  	  if (!($add_type=='multiple')) {
416
-  	  	?>
415
+        if (!($add_type=='multiple')) {
416
+            ?>
417 417
 		<input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single',document.getElementById('relation').value)" />
418 418
 		<div id="ajax_list_users_single"></div>
419 419
 		<?php
420
-  	  } else {
421
-  	  ?>
420
+        } else {
421
+        ?>
422 422
   	  <div id="ajax_origin_list_multiple">
423 423
 	  <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">
424 424
 		<?php
425
-		if (!empty($nosessionUsersList)) {
426
-			foreach($nosessionUsersList as $enreg) {
427
-			?>
425
+        if (!empty($nosessionUsersList)) {
426
+            foreach($nosessionUsersList as $enreg) {
427
+            ?>
428 428
 				<option value="<?php echo $enreg['user_id']; ?>"  > <?php echo $enreg['firstname'].' '.$enreg['lastname'].' ('.$enreg['username'].')'; ?></option>
429 429
 			<?php
430
-			}
431
-		}
432
-		?>
430
+            }
431
+        }
432
+        ?>
433 433
 	  </select>
434 434
 	  </div>
435 435
 	<?php
436
-  	  }
437
-  	  unset($nosessionUsersList);
438
-  	 ?>
436
+        }
437
+        unset($nosessionUsersList);
438
+        ?>
439 439
   </div>
440 440
   </td>
441 441
   <td width="10%" valign="middle" align="center">
442 442
   <?php
443
-  if ($ajax_search) {
444
-  ?>
443
+    if ($ajax_search) {
444
+    ?>
445 445
     <button class="btn btn-default" type="button" onclick="remove_item(document.getElementById('destination_users'))" ><em class="fa fa-arrow-left"></em></button>
446 446
   <?php
447
-  } else {
448
-  ?>
447
+    } else {
448
+    ?>
449 449
   	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))"><em class="fa fa-arrow-right"></em></button>
450 450
 	<br /><br />
451 451
 	<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))"><em class="fa fa-arrow-left"></em></button>
452 452
 	<?php
453
-  }
454
-  ?>
453
+    }
454
+    ?>
455 455
 	<br /><br /><br /><br /><br />
456 456
   </td>
457 457
   <td align="center">
458 458
   <div id="ajax_destination_list">
459 459
   <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" style="width:360px;">
460 460
 	<?php
461
-	if (!empty($sessionUsersList)) {
462
-		foreach($sessionUsersList as $enreg) { ?>
461
+    if (!empty($sessionUsersList)) {
462
+        foreach($sessionUsersList as $enreg) { ?>
463 463
 			<option value="<?php echo $enreg['user_id']; ?>">
464 464
                 <?php echo $enreg['firstname'].' '.$enreg['lastname'].' ('.$enreg['username'].')'; ?>
465 465
             </option>
466 466
 	<?php }
467
-	} unset($sessionUsersList);
467
+    } unset($sessionUsersList);
468 468
     ?>
469 469
   </select>
470 470
   </div>
@@ -474,8 +474,8 @@  discard block
 block discarded – undo
474 474
 	<td colspan="3" align="center">
475 475
 		<br />
476 476
 		<?php
477
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" ><em class="fa fa-floppy-o"></em> '.get_lang('SubscribeUsersToGroup').'</button>';
478
-		?>
477
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" ><em class="fa fa-floppy-o"></em> '.get_lang('SubscribeUsersToGroup').'</button>';
478
+        ?>
479 479
 	</td>
480 480
 </tr>
481 481
 </table>
Please login to merge, or discard this patch.
main/admin/specific_fields.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,15 +43,15 @@  discard block
 block discarded – undo
43 43
 $table->set_column_filter(3, 'edit_filter');
44 44
 
45 45
 function edit_filter($id,$url_params,$row) {
46
-	global $charset;
47
-	$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
-	$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
-	return $return;
46
+    global $charset;
47
+    $return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
48
+    $return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
49
+    return $return;
50 50
 }
51 51
 
52 52
 if ($_REQUEST['action'] == 'delete') {
53
-	delete_specific_field($_REQUEST['field_id']);
54
-	header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
53
+    delete_specific_field($_REQUEST['field_id']);
54
+    header('Location: specific_fields.php?message='.get_lang('FieldRemoved'));
55 55
 }
56 56
 
57 57
 // Start output
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 echo Display::display_normal_message(get_lang('SpecificSearchFieldsIntro'));
62 62
 
63 63
 if(!empty($_GET['message'])) {
64
-  Display::display_confirmation_message($_GET['message']);
64
+    Display::display_confirmation_message($_GET['message']);
65 65
 }
66 66
 
67 67
 echo '<div class="actions">';
Please login to merge, or discard this patch.
main/admin/class_user_import.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
     $classcodes = array ();
19 19
 
20 20
     if (!isset($_POST['subscribe']) && !isset($_POST['subscribe']))  {
21
-          $user_class['error'] = get_lang('SelectAnAction');
22
-          $errors[] = $user_class;
23
-          return $errors;
21
+            $user_class['error'] = get_lang('SelectAnAction');
22
+            $errors[] = $user_class;
23
+            return $errors;
24 24
     }
25 25
     foreach ($user_classes as $index => $user_class) {
26 26
         $user_class['line'] = $index + 1;
Please login to merge, or discard this patch.
main/admin/special_exports.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
 require_once '../coursecopy/classes/CourseSelectForm.class.php';
29 29
 
30 30
 if (function_exists('ini_set')) {
31
-	api_set_memory_limit('256M');
32
-	ini_set('max_execution_time',0);
31
+    api_set_memory_limit('256M');
32
+    ini_set('max_execution_time',0);
33 33
 }
34 34
 
35 35
 // Displaying the header
@@ -50,36 +50,36 @@  discard block
 block discarded – undo
50 50
 if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') ||
51 51
     (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'full_backup')
52 52
 ) {
53
-	$export = false;
54
-	if (isset ($_POST['action']) && $_POST['action'] == 'course_select_form') {
55
-		$FileZip = create_zip();
56
-		$to_group_id = 0;
57
-		$sql_session = "SELECT id, name FROM $tbl_session ";
58
-		$query_session = Database::query($sql_session);
59
-		$ListSession = array();
60
-		while ($rows_session = Database::fetch_assoc($query_session)) {
61
-			$ListSession[$rows_session['id']] = $rows_session['name'];
62
-		}
53
+    $export = false;
54
+    if (isset ($_POST['action']) && $_POST['action'] == 'course_select_form') {
55
+        $FileZip = create_zip();
56
+        $to_group_id = 0;
57
+        $sql_session = "SELECT id, name FROM $tbl_session ";
58
+        $query_session = Database::query($sql_session);
59
+        $ListSession = array();
60
+        while ($rows_session = Database::fetch_assoc($query_session)) {
61
+            $ListSession[$rows_session['id']] = $rows_session['name'];
62
+        }
63 63
 
64 64
         $groupCondition = " props.to_group_id = $to_group_id";
65 65
         if (empty($to_group_id)) {
66 66
             $groupCondition = " (props.to_group_id = 0 OR props.to_group_id IS NULL)";
67 67
         }
68 68
 
69
-		$zip_folder=new PclZip($FileZip['TEMP_FILE_ZIP']);
70
-		if(!isset($_POST['resource']) || count($_POST['resource']) == 0 ) {
71
-			Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
72
-		} else {
73
-			$Resource = $_POST['resource'];
69
+        $zip_folder=new PclZip($FileZip['TEMP_FILE_ZIP']);
70
+        if(!isset($_POST['resource']) || count($_POST['resource']) == 0 ) {
71
+            Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
72
+        } else {
73
+            $Resource = $_POST['resource'];
74 74
 
75
-			foreach ($Resource as $Code_course => $Sessions) {
76
-				$_course 		= api_get_course_info($Code_course);
77
-				$tbl_document 	= Database::get_course_table(TABLE_DOCUMENT);
78
-				$tbl_property 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
79
-				$course_id 		= $_course['real_id'];
75
+            foreach ($Resource as $Code_course => $Sessions) {
76
+                $_course 		= api_get_course_info($Code_course);
77
+                $tbl_document 	= Database::get_course_table(TABLE_DOCUMENT);
78
+                $tbl_property 	= Database::get_course_table(TABLE_ITEM_PROPERTY);
79
+                $course_id 		= $_course['real_id'];
80 80
 
81
-				//Add item to the zip file course
82
-				$sql = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
81
+                //Add item to the zip file course
82
+                $sql = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
83 83
                         WHERE props.tool='".TOOL_DOCUMENT."'
84 84
 						AND docs.id=props.ref
85 85
 						AND docs.path LIKE '".$querypath."/%'
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 						AND $groupCondition
90 90
 						AND docs.c_id = $course_id
91 91
 						AND props.c_id = $course_id";
92
-				$query = Database::query($sql );
93
-				while ($rows_course_file = Database::fetch_assoc($query)) {
92
+                $query = Database::query($sql );
93
+                while ($rows_course_file = Database::fetch_assoc($query)) {
94 94
                     $zip_folder->add(
95 95
                         $FileZip['PATH_COURSE'].$_course['directory']."/document".$rows_course_file['path'],
96 96
                         PCLZIP_OPT_ADD_PATH,
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
                         PCLZIP_OPT_REMOVE_PATH,
99 99
                         $FileZip['PATH_COURSE'].$_course['directory']."/document".$FileZip['PATH_REMOVE']
100 100
                     );
101
-				}
101
+                }
102 102
 
103
-				foreach ($Sessions as $IdSession => $value){
104
-					$session_id = Security::remove_XSS($IdSession);
105
-					//Add tem to the zip file session course
106
-					$sql_session_doc = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
103
+                foreach ($Sessions as $IdSession => $value){
104
+                    $session_id = Security::remove_XSS($IdSession);
105
+                    //Add tem to the zip file session course
106
+                    $sql_session_doc = "SELECT path FROM $tbl_document AS docs, $tbl_property AS props
107 107
 						WHERE props.tool='".TOOL_DOCUMENT."'
108 108
 							AND docs.id=props.ref
109 109
 							AND docs.path LIKE '".$querypath."/%'
@@ -113,8 +113,8 @@  discard block
 block discarded – undo
113 113
 							AND $groupCondition
114 114
 							AND docs.c_id = $course_id
115 115
 							AND props.c_id = $course_id";
116
-					$query_session_doc = Database::query($sql_session_doc);
117
-					while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
116
+                    $query_session_doc = Database::query($sql_session_doc);
117
+                    while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
118 118
                         $zip_folder->add(
119 119
                             $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'],
120 120
                             PCLZIP_OPT_ADD_PATH,
@@ -122,15 +122,15 @@  discard block
 block discarded – undo
122 122
                             PCLZIP_OPT_REMOVE_PATH,
123 123
                             $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
124 124
                         );
125
-					}
126
-				}
127
-			}
128
-			$name = rename_zip($FileZip);
129
-			$export = true;
130
-		}
131
-	} else {
132
-		$name = fullexportspecial();
133
-	}
125
+                    }
126
+                }
127
+            }
128
+            $name = rename_zip($FileZip);
129
+            $export = true;
130
+        }
131
+    } else {
132
+        $name = fullexportspecial();
133
+    }
134 134
 ?>
135 135
 <!-- Manual download <script language="JavaScript">
136 136
  // setTimeout(\'download_backup()\',2000);
@@ -143,23 +143,23 @@  discard block
 block discarded – undo
143 143
 }
144 144
 
145 145
 if ($export && $name) {
146
-	Display::display_confirmation_message(get_lang('BackupCreated'));
147
-	echo '<br /><a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.urlencode($name).'&session=true">'.get_lang('Download').'</a>';
146
+    Display::display_confirmation_message(get_lang('BackupCreated'));
147
+    echo '<br /><a class="btn btn-default" href="'.api_get_path(WEB_CODE_PATH).'course_info/download.php?archive='.urlencode($name).'&session=true">'.get_lang('Download').'</a>';
148 148
 } else {
149
-	// Display forms especial export
150
-	if (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') {
151
-		$cb = new CourseBuilder();
152
-		$course = $cb->build_session_course();
153
-		if($course === false){
154
-			Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
155
-			form_special_export();
156
-		} else {
157
-			Display::display_normal_message(get_lang('ToExportSpecialSelect'));
158
-			CourseSelectForm :: display_form_session_export($course);
159
-		}
160
-	} else {
161
-		form_special_export();
162
-	}
149
+    // Display forms especial export
150
+    if (isset ($_POST['backup_option']) && $_POST['backup_option'] == 'select_items') {
151
+        $cb = new CourseBuilder();
152
+        $course = $cb->build_session_course();
153
+        if($course === false){
154
+            Display::display_error_message(get_lang('ErrorMsgSpecialExport'));
155
+            form_special_export();
156
+        } else {
157
+            Display::display_normal_message(get_lang('ToExportSpecialSelect'));
158
+            CourseSelectForm :: display_form_session_export($course);
159
+        }
160
+    } else {
161
+        form_special_export();
162
+    }
163 163
 }
164 164
 
165 165
 /* FOOTER */
@@ -200,10 +200,10 @@  discard block
 block discarded – undo
200 200
     }
201 201
     $temp_zip_file = $temp_zip_dir."/".md5(time()).".zip";  //create zipfile of given directory
202 202
     return array('PATH' => $path,
203
-                 'PATH_TEMP_ARCHIVE' => $temp_zip_dir,
204
-                 'PATH_COURSE' => $sys_course_path,
205
-                 'TEMP_FILE_ZIP' => $temp_zip_file,
206
-                 'PATH_REMOVE' => $remove_dir);
203
+                    'PATH_TEMP_ARCHIVE' => $temp_zip_dir,
204
+                    'PATH_COURSE' => $sys_course_path,
205
+                    'TEMP_FILE_ZIP' => $temp_zip_file,
206
+                    'PATH_REMOVE' => $remove_dir);
207 207
 }
208 208
 
209 209
 function rename_zip($FileZip) {
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
                 $query_session_doc = Database::query($sql_session_doc);
288 288
                 while ($rows_course_session_file = Database::fetch_assoc($query_session_doc)) {
289 289
                     $zip_folder->add($FileZip['PATH_COURSE'].$_course['directory'].'/document'.$rows_course_session_file['path'],
290
-                         PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$rows_session['name'],
291
-                         PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
292
-                     );
290
+                            PCLZIP_OPT_ADD_PATH, $_course['directory']."/".$rows_session['name'],
291
+                            PCLZIP_OPT_REMOVE_PATH, $FileZip['PATH_COURSE'].$_course['directory'].'/document'.$FileZip['PATH_REMOVE']
292
+                        );
293 293
                 }
294 294
             }
295 295
         }
Please login to merge, or discard this patch.
main/notebook/index.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 
38 38
 // Tool name
39 39
 if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
40
-	$tool = 'NoteAddNew';
41
-	$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
40
+    $tool = 'NoteAddNew';
41
+    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
42 42
 }
43 43
 if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
44
-	$tool = 'ModifyNote';
45
-	$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
44
+    $tool = 'ModifyNote';
45
+    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
46 46
 }
47 47
 
48 48
 // Displaying the header
@@ -53,16 +53,16 @@  discard block
 block discarded – undo
53 53
 
54 54
 // Action handling: Adding a note
55 55
 if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
56
-	if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
57
-		api_not_allowed();
58
-	}
56
+    if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
57
+        api_not_allowed();
58
+    }
59 59
 
60
-	if (!empty($_GET['isStudentView'])) {
61
-		NotebookManager::display_notes();
62
-		exit;
63
-	}
60
+    if (!empty($_GET['isStudentView'])) {
61
+        NotebookManager::display_notes();
62
+        exit;
63
+    }
64 64
 
65
-	$_SESSION['notebook_view'] = 'creation_date';
65
+    $_SESSION['notebook_view'] = 'creation_date';
66 66
 
67 67
     $form = new FormValidator(
68 68
         'note',
Please login to merge, or discard this patch.
main/survey/survey_invite.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
 $this_section = SECTION_COURSES;
19 19
 
20 20
 if (!api_is_allowed_to_edit(false, true)) {
21
-	Display :: display_header(get_lang('ToolSurvey'));
22
-	Display :: display_error_message(get_lang('NotAllowed'), false);
23
-	Display :: display_footer();
24
-	exit;
21
+    Display :: display_header(get_lang('ToolSurvey'));
22
+    Display :: display_error_message(get_lang('NotAllowed'), false);
23
+    Display :: display_footer();
24
+    exit;
25 25
 }
26 26
 
27 27
 // Database table definitions
@@ -37,15 +37,15 @@  discard block
 block discarded – undo
37 37
 $survey_id = Security::remove_XSS($_GET['survey_id']);
38 38
 $survey_data = SurveyManager::get_survey($survey_id);
39 39
 if (empty($survey_data)) {
40
-	Display :: display_header(get_lang('ToolSurvey'));
41
-	Display :: display_error_message(get_lang('InvallidSurvey'), false);
42
-	Display :: display_footer();
43
-	exit;
40
+    Display :: display_header(get_lang('ToolSurvey'));
41
+    Display :: display_error_message(get_lang('InvallidSurvey'), false);
42
+    Display :: display_footer();
43
+    exit;
44 44
 }
45 45
 
46 46
 $urlname = strip_tags(api_substr(api_html_entity_decode($survey_data['title'], ENT_QUOTES), 0, 40));
47 47
 if (api_strlen(strip_tags($survey_data['title'])) > 40) {
48
-	$urlname .= '...';
48
+    $urlname .= '...';
49 49
 }
50 50
 
51 51
 // Breadcrumbs
@@ -80,23 +80,23 @@  discard block
 block discarded – undo
80 80
 		WHERE c_id = $course_id AND code='".Database::escape_string($survey_data['code'])."'";
81 81
 $result = Database::query($sql);
82 82
 if (Database::num_rows($result) > 1) {
83
-	Display::display_warning_message(get_lang('IdenticalSurveycodeWarning'));
83
+    Display::display_warning_message(get_lang('IdenticalSurveycodeWarning'));
84 84
 }
85 85
 
86 86
 // Invited / answered message
87 87
 if ($survey_data['invited'] > 0 && !isset($_POST['submit'])) {
88
-	$message  = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.$survey_data['answered'].'</a> ';
89
-	$message .= get_lang('HaveAnswered').' ';
90
-	$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
91
-	$message .= get_lang('WereInvited');
92
-	Display::display_normal_message($message, false);
88
+    $message  = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.$survey_data['answered'].'</a> ';
89
+    $message .= get_lang('HaveAnswered').' ';
90
+    $message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
91
+    $message .= get_lang('WereInvited');
92
+    Display::display_normal_message($message, false);
93 93
 }
94 94
 
95 95
 // Building the form for publishing the survey
96 96
 $form = new FormValidator(
97
-	'publish_form',
98
-	'post',
99
-	api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidReq()
97
+    'publish_form',
98
+    'post',
99
+    api_get_self().'?survey_id='.$survey_id.'&'.api_get_cidReq()
100 100
 );
101 101
 $form->addElement('header', '', $tool_name);
102 102
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 );
110 110
 $possible_users = array();
111 111
 foreach ($complete_user_list as & $user) {
112
-	$possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
112
+    $possible_users[$user['user_id']] = api_get_person_name($user['firstname'], $user['lastname']);
113 113
 }
114 114
 
115 115
 
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
 
126 126
 // Additional users
127 127
 $form->addElement(
128
-	'textarea',
129
-	'additional_users',
130
-	array(get_lang('AdditonalUsers'), get_lang('AdditonalUsersComment')),
131
-	array('rows' => 5)
128
+    'textarea',
129
+    'additional_users',
130
+    array(get_lang('AdditonalUsers'), get_lang('AdditonalUsersComment')),
131
+    array('rows' => 5)
132 132
 );
133 133
 
134 134
 $form->addElement('html', '<div id="check_mail">');
@@ -141,15 +141,15 @@  discard block
 block discarded – undo
141 141
 $form->addText('mail_title', get_lang('MailTitle'), false);
142 142
 // The text of the mail
143 143
 $form->addHtmlEditor(
144
-	'mail_text',
145
-	array(get_lang('MailText'), get_lang('UseLinkSyntax')),
146
-	false,
147
-	array('ToolbarSet' => 'Survey', 'Height' => '150')
144
+    'mail_text',
145
+    array(get_lang('MailText'), get_lang('UseLinkSyntax')),
146
+    false,
147
+    array('ToolbarSet' => 'Survey', 'Height' => '150')
148 148
 );
149 149
 $form->addElement('html', '</div>');
150 150
 // You cab send a reminder to unanswered people if the survey is not anonymous
151 151
 if ($survey_data['anonymous'] != 1) {
152
-	$form->addElement('checkbox', 'remindUnAnswered', '', get_lang('RemindUnanswered'));
152
+    $form->addElement('checkbox', 'remindUnAnswered', '', get_lang('RemindUnanswered'));
153 153
 }
154 154
 // Allow resending to all selected users
155 155
 $form->addElement('checkbox', 'resend_to_all', '', get_lang('ReminderResendToAllUsers'));
@@ -163,11 +163,11 @@  discard block
 block discarded – undo
163 163
 }*/
164 164
 $portal_url = api_get_path(WEB_PATH);
165 165
 if (api_is_multiple_url_enabled()) {
166
-	$access_url_id = api_get_current_access_url_id();
167
-	if ($access_url_id != -1) {
168
-		$url = api_get_access_url($access_url_id);
169
-		$portal_url = $url['url'];
170
-	}
166
+    $access_url_id = api_get_current_access_url_id();
167
+    if ($access_url_id != -1) {
168
+        $url = api_get_access_url($access_url_id);
169
+        $portal_url = $url['url'];
170
+    }
171 171
 }
172 172
 
173 173
 // Show the URL that can be used by users to fill a survey without invitation
@@ -177,56 +177,56 @@  discard block
 block discarded – undo
177 177
 $form->addElement('label', null, $auto_survey_link);
178 178
 
179 179
 if ($form->validate()) {
180
-   	$values = $form->exportValues();
180
+        $values = $form->exportValues();
181 181
     if (isset($values['send_mail']) && $values['send_mail'] == 1) {
182 182
         if (empty($values['mail_title']) || empty($values['mail_text'])) {
183 183
             Display :: display_error_message(get_lang('FormHasErrorsPleaseComplete'));
184 184
             // Getting the invited users
185
-        	$defaults = SurveyUtil::get_invited_users($survey_data['code']);
186
-
187
-        	// Getting the survey mail text
188
-        	if (!empty($survey_data['reminder_mail'])) {
189
-        		$defaults['mail_text'] = $survey_data['reminder_mail'];
190
-        	} else {
191
-        		$defaults['mail_text'] = $survey_data['invite_mail'];
192
-        	}
193
-        	$defaults['mail_title'] = $survey_data['mail_subject'];
194
-        	$defaults['send_mail'] = 1;
195
-        	$form->setDefaults($defaults);
185
+            $defaults = SurveyUtil::get_invited_users($survey_data['code']);
186
+
187
+            // Getting the survey mail text
188
+            if (!empty($survey_data['reminder_mail'])) {
189
+                $defaults['mail_text'] = $survey_data['reminder_mail'];
190
+            } else {
191
+                $defaults['mail_text'] = $survey_data['invite_mail'];
192
+            }
193
+            $defaults['mail_title'] = $survey_data['mail_subject'];
194
+            $defaults['send_mail'] = 1;
195
+            $form->setDefaults($defaults);
196 196
             $form->display();
197 197
             return;
198 198
         }
199 199
     }
200 200
     // Save the invitation mail
201
-	SurveyUtil::save_invite_mail(
202
-		$values['mail_text'],
203
-		$values['mail_title'],
204
-		!empty($survey_data['invite_mail'])
205
-	);
201
+    SurveyUtil::save_invite_mail(
202
+        $values['mail_text'],
203
+        $values['mail_title'],
204
+        !empty($survey_data['invite_mail'])
205
+    );
206 206
 
207 207
     $resendAll = isset($values['resend_to_all']) ? $values['resend_to_all'] : '';
208 208
     $sendMail = isset($values['send_mail']) ? $values['send_mail'] : '';
209 209
     $remindUnAnswered = isset($values['remindUnAnswered']) ? $values['remindUnAnswered'] : '';
210 210
 
211
-	// Saving the invitations for the course users
212
-	$count_course_users = SurveyUtil::saveInvitations(
213
-		$values['users'],
214
-		$values['mail_title'],
215
-		$values['mail_text'],
211
+    // Saving the invitations for the course users
212
+    $count_course_users = SurveyUtil::saveInvitations(
213
+        $values['users'],
214
+        $values['mail_title'],
215
+        $values['mail_text'],
216 216
         $resendAll,
217 217
         $sendMail,
218 218
         $remindUnAnswered
219
-	);
219
+    );
220 220
 
221
-	// Saving the invitations for the additional users
222
-	$values['additional_users'] = $values['additional_users'].';'; 	// This is for the case when you enter only one email
223
-	$temp = str_replace(',', ';', $values['additional_users']);		// This is to allow , and ; as email separators
224
-	$additional_users = explode(';', $temp);
225
-	for ($i = 0; $i < count($additional_users); $i++) {
226
-		$additional_users[$i] = trim($additional_users[$i]);
227
-	}
221
+    // Saving the invitations for the additional users
222
+    $values['additional_users'] = $values['additional_users'].';'; 	// This is for the case when you enter only one email
223
+    $temp = str_replace(',', ';', $values['additional_users']);		// This is to allow , and ; as email separators
224
+    $additional_users = explode(';', $temp);
225
+    for ($i = 0; $i < count($additional_users); $i++) {
226
+        $additional_users[$i] = trim($additional_users[$i]);
227
+    }
228 228
 
229
-	$counter_additional_users = SurveyUtil::saveInvitations(
229
+    $counter_additional_users = SurveyUtil::saveInvitations(
230 230
         $additional_users,
231 231
         $values['mail_title'],
232 232
         $values['mail_text'],
@@ -235,43 +235,43 @@  discard block
 block discarded – undo
235 235
         $remindUnAnswered
236 236
     );
237 237
 
238
-	// Updating the invited field in the survey table
239
-	SurveyUtil::update_count_invited($survey_data['code']);
240
-	$total_count = $count_course_users + $counter_additional_users;
238
+    // Updating the invited field in the survey table
239
+    SurveyUtil::update_count_invited($survey_data['code']);
240
+    $total_count = $count_course_users + $counter_additional_users;
241 241
     $table_survey = Database :: get_course_table(TABLE_SURVEY);
242
-	// Counting the number of people that are invited
243
-	$sql = "SELECT * FROM $table_survey
242
+    // Counting the number of people that are invited
243
+    $sql = "SELECT * FROM $table_survey
244 244
 	        WHERE
245 245
 	        	c_id = $course_id AND
246 246
 	        	code = '".Database::escape_string($survey_data['code'])."'
247 247
 			";
248
-	$result = Database::query($sql);
249
-	$row = Database::fetch_array($result);
250
-	$total_invited = $row['invited'];
248
+    $result = Database::query($sql);
249
+    $row = Database::fetch_array($result);
250
+    $total_invited = $row['invited'];
251 251
     if ($total_invited > 0) {
252
-    	$message  = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.
253
-			$survey_data['answered'].'</a> ';
254
-    	$message .= get_lang('HaveAnswered').' ';
255
-    	$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.
256
-			$total_invited.'</a> ';
257
-    	$message .= get_lang('WereInvited');
258
-    	Display::display_normal_message($message, false);
259
-    	Display::display_confirmation_message($total_count.' '.get_lang('InvitationsSend'));
252
+        $message  = '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=answered&survey_id='.$survey_data['survey_id'].'">'.
253
+            $survey_data['answered'].'</a> ';
254
+        $message .= get_lang('HaveAnswered').' ';
255
+        $message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.
256
+            $total_invited.'</a> ';
257
+        $message .= get_lang('WereInvited');
258
+        Display::display_normal_message($message, false);
259
+        Display::display_confirmation_message($total_count.' '.get_lang('InvitationsSend'));
260 260
     }
261 261
 } else {
262
-	// Getting the invited users
263
-	$defaults = SurveyUtil::get_invited_users($survey_data['code']);
264
-
265
-	// Getting the survey mail text
266
-	if (!empty($survey_data['reminder_mail'])) {
267
-		$defaults['mail_text'] = $survey_data['reminder_mail'];
268
-	} else {
269
-		$defaults['mail_text'] = $survey_data['invite_mail'];
270
-	}
271
-	$defaults['mail_title'] = $survey_data['mail_subject'];
272
-	$defaults['send_mail'] = 1;
273
-
274
-	$form->setDefaults($defaults);
262
+    // Getting the invited users
263
+    $defaults = SurveyUtil::get_invited_users($survey_data['code']);
264
+
265
+    // Getting the survey mail text
266
+    if (!empty($survey_data['reminder_mail'])) {
267
+        $defaults['mail_text'] = $survey_data['reminder_mail'];
268
+    } else {
269
+        $defaults['mail_text'] = $survey_data['invite_mail'];
270
+    }
271
+    $defaults['mail_title'] = $survey_data['mail_subject'];
272
+    $defaults['send_mail'] = 1;
273
+
274
+    $form->setDefaults($defaults);
275 275
     $form->display();
276 276
 }
277 277
 Display :: display_footer();
Please login to merge, or discard this patch.