Completed
Push — 1.11.x ( 69878b...1da93a )
by José
64:32 queued 39:16
created
main/admin/access_url_add_usergroup_to_url.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
                   <?php
88 88
                     echo Display::get_alphabet_options($firstLetterUserGroup);
89 89
                     echo Display::get_numeric_options(0, 9, $firstLetterUserGroup);
90
-                  ?>
90
+                    ?>
91 91
             </select>
92 92
         </td>
93 93
         <td width="20%">&nbsp;</td>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 $tbl_course = Database:: get_main_table(TABLE_MAIN_COURSE);
31 31
 
32 32
 $tool_name = get_lang('AddUserGroupToURL');
33
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
34
-$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
33
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
34
+$interbreadcrumb[] = array('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
35 35
 
36 36
 Display::display_header($tool_name);
37 37
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 
47 47
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
48 48
     $form_sent = $_POST['form_sent'];
49
-    $userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array() ;
50
-    $urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
49
+    $userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array();
50
+    $urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array();
51 51
     $firstLetterUserGroup = $_POST['first_letter_user_group'];
52 52
 
53 53
     if ($form_sent == 1) {
Please login to merge, or discard this patch.
Braces   +8 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,10 @@  discard block
 block discarded – undo
99 99
         <td width="40%" align="center">
100 100
         <select name="user_group_list[]" multiple="multiple" size="20" style="width:400px;">
101 101
 		<?php foreach ($dbUserGroups as $item) { ?>
102
-			<option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) echo 'selected="selected"'; ?>><?php echo $item['name']; ?>
102
+			<option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) {
103
+    echo 'selected="selected"';
104
+}
105
+?>><?php echo $item['name']; ?>
103 106
             </option>
104 107
         <?php } ?>
105 108
     </select>
@@ -110,7 +113,10 @@  discard block
 block discarded – undo
110 113
    <td width="40%" align="center">
111 114
     <select name="url_list[]" multiple="multiple" size="20" style="width:300px;">
112 115
 		<?php foreach ($db_urls as $url_obj) { ?>
113
-        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
116
+        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) {
117
+    echo 'selected="selected"';
118
+}
119
+?>><?php echo $url_obj['url']; ?>
114 120
         </option>
115 121
 		<?php } ?>
116 122
     </select>
Please login to merge, or discard this patch.
main/admin/course_request_rejected.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
     $from = intval($from);
115 115
     $number_of_items = intval($number_of_items);
116 116
     $column = intval($column);
117
-    $direction = !in_array(strtolower(trim($direction)), ['asc','desc']) ? 'asc' : $direction;
117
+    $direction = !in_array(strtolower(trim($direction)), ['asc', 'desc']) ? 'asc' : $direction;
118 118
 
119 119
     $sql = "SELECT
120 120
                 id AS col0,
Please login to merge, or discard this patch.
main/admin/course_intro_pdf_import.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -90,26 +90,26 @@
 block discarded – undo
90 90
 {
91 91
     $baseDir = api_get_path(SYS_ARCHIVE_PATH);
92 92
     $uploadPath = 'pdfimport/';
93
-    $errors = array ();
93
+    $errors = array();
94 94
     if (!is_dir($baseDir.$uploadPath)) {
95 95
         @mkdir($baseDir.$uploadPath);
96 96
     }
97
-    if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024*1024*1024)) {
97
+    if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024 * 1024 * 1024)) {
98 98
         error_log('Could not unzip uploaded file in '.__FILE__.', line '.__LINE__);
99 99
         return $errors;
100 100
     }
101 101
     $list = scandir($baseDir.$uploadPath);
102 102
     $i = 0;
103 103
     foreach ($list as $file) {
104
-        if (substr($file,0,1) == '.' or !is_file($baseDir.$uploadPath.$file)) {
104
+        if (substr($file, 0, 1) == '.' or !is_file($baseDir.$uploadPath.$file)) {
105 105
             continue;
106 106
         }
107
-        $parts = preg_split('/_/',$file);
107
+        $parts = preg_split('/_/', $file);
108 108
         $course = api_get_course_info($parts[0]);
109 109
         if (count($course) > 0) {
110 110
             // Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name)
111 111
             $fileSize = filesize($baseDir.$uploadPath.$file);
112
-            $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2],0,-4));
112
+            $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2], 0, -4));
113 113
             if ($docId > 0) {
114 114
                 if (!is_file($baseDir.$uploadPath.$file)) {
115 115
                     error_log($baseDir.$uploadPath.$file.' does not exists in '.__FILE__);
Please login to merge, or discard this patch.
main/admin/add_courses_to_usergroup.php 3 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -229,31 +229,31 @@  discard block
 block discarded – undo
229 229
   <td align="center">
230 230
   <div id="content_source">
231 231
       <?php
232
-      if (!($add_type=='multiple')) {
232
+        if (!($add_type=='multiple')) {
233 233
         ?>
234 234
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
235 235
         <div id="ajax_list_users_single"></div>
236 236
         <?php
237
-      } else {
238
-      ?>
237
+        } else {
238
+        ?>
239 239
       <div id="ajax_list_multiple">
240 240
         <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
241 241
       </div>
242 242
     <?php
243
-      }
244
-     ?>
243
+        }
244
+        ?>
245 245
   </div>
246 246
   </td>
247 247
   <td width="10%" valign="middle" align="center">
248 248
   <?php
249
-  if ($ajax_search) {
250
-  ?>
249
+    if ($ajax_search) {
250
+    ?>
251 251
     <button class="btn bt-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" >
252 252
         <em class="fa fa-arrow-left"></em>
253 253
     </button>
254 254
   <?php
255
-  } else {
256
-  ?>
255
+    } else {
256
+    ?>
257 257
     <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))">
258 258
         <em class="fa fa-arrow-right"></em>
259 259
     </button>
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
         <em class="fa fa-arrow-left"></em>
263 263
     </button>
264 264
     <?php
265
-  }
266
-  ?>
265
+    }
266
+    ?>
267 267
     <br /><br /><br /><br /><br /><br />
268 268
   </td>
269 269
   <td align="center">
Please login to merge, or discard this patch.
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,10 @@
 block discarded – undo
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) {
148
+    echo '&add=true' ;
149
+}
150
+?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
148 151
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 152
 
150 153
 if ($add_type=='multiple') {
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 api_protect_admin_script(true);
20 20
 
21 21
 // Setting breadcrumbs.
22
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
23
-$interbreadcrumb[] = array('url' => 'usergroups.php','name' => get_lang('Classes'));
22
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
23
+$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
24 24
 
25 25
 // Setting the name of the tool.
26 26
 $tool_name = get_lang('SubscribeClassToCourses');
27 27
 
28 28
 $add_type = 'multiple';
29
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
29
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
30 30
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
31 31
 }
32 32
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
 $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id);
99 99
 $searchForm->addHeader(get_lang('AdvancedSearch'));
100
-$renderer =& $searchForm->defaultRenderer();
100
+$renderer = & $searchForm->defaultRenderer();
101 101
 $searchForm->addElement('hidden', 'id', $id);
102 102
 foreach ($filters as $param) {
103 103
     $searchForm->addElement($param['type'], $param['name'], $param['label']);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 
142 142
 //checking for extra field with filter on
143 143
 
144
-function search($needle,$type)
144
+function search($needle, $type)
145 145
 {
146 146
     global $elements_in;
147 147
     $xajax_response = new xajaxResponse();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 }
181 181
 
182 182
 echo '<div class="actions">';
183
-echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>';
183
+echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>';
184 184
 echo Display::url(get_lang('AdvancedSearch'), '#', array('class' => 'advanced_options', 'id' => 'advanced_search'));
185 185
 echo '</div>';
186 186
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 ?>
192 192
 
193
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
193
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
194 194
 
195 195
 <?php echo '<legend>'.$data['name'].': '.$tool_name.'</legend>';
196 196
 echo Display::input('hidden', 'id', $id);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
   <td align="center"><b><?php echo get_lang('CoursesInGroup') ?> :</b></td>
210 210
 </tr>
211 211
 
212
-<?php if ($add_type=='multiple') { ?>
212
+<?php if ($add_type == 'multiple') { ?>
213 213
 <tr>
214 214
 <td align="center">
215 215
 <?php echo get_lang('FirstLetterCourseTitle'); ?> :
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
   <td align="center">
228 228
   <div id="content_source">
229 229
       <?php
230
-      if (!($add_type=='multiple')) {
230
+      if (!($add_type == 'multiple')) {
231 231
         ?>
232 232
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
233 233
         <div id="ajax_list_users_single"></div>
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
       } else {
236 236
       ?>
237 237
       <div id="ajax_list_multiple">
238
-        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?>
238
+        <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?>
239 239
       </div>
240 240
     <?php
241 241
       }
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
   </td>
267 267
   <td align="center">
268 268
 <?php
269
-    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false );
269
+    echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false);
270 270
     unset($sessionUsersList);
271 271
 ?>
272 272
  </td>
Please login to merge, or discard this patch.
main/admin/user_export.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
 
23 23
 set_time_limit(0);
24 24
 
25
-$courses = array ();
25
+$courses = array();
26 26
 $courses[''] = '--';
27 27
 $sql = "SELECT code,visual_code,title FROM $course_table ORDER BY visual_code";
28 28
 
29 29
 global $_configuration;
30 30
 
31 31
 if (api_is_multiple_url_enabled()) {
32
-	$tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
32
+	$tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
33 33
 	$access_url_id = api_get_current_access_url_id();
34
-	if ($access_url_id != -1){
34
+	if ($access_url_id != -1) {
35 35
 	$sql = "SELECT code,visual_code,title
36 36
 		FROM $course_table as c
37 37
 		INNER JOIN $tbl_course_rel_access_url as course_rel_url
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
 }
47 47
 $form = new FormValidator('export_users');
48 48
 $form->addElement('header', $tool_name);
49
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML','xml');
49
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML', 'xml');
50 50
 $form->addElement('radio', 'file_type', null, 'CSV', 'csv');
51 51
 $form->addElement('radio', 'file_type', null, 'XLS', 'xls');
52 52
 
53
-$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'),'1');
53
+$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'), '1');
54 54
 $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses);
55 55
 $form->addButtonExport(get_lang('Export'));
56 56
 $form->setDefaults(array('file_type' => 'csv'));
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 				u.firstname 	AS FirstName,
69 69
 				u.email 		AS Email,
70 70
 				u.username	AS UserName,
71
-				".(($_configuration['password_encryption']!='none')?" ":"u.password AS Password, ")."
71
+				".(($_configuration['password_encryption'] != 'none') ? " " : "u.password AS Password, ")."
72 72
 				u.auth_source	AS AuthSource,
73 73
 				u.status		AS Status,
74 74
 				u.official_code	AS OfficialCode,
@@ -83,10 +83,10 @@  discard block
 block discarded – undo
83 83
 		$filename = 'export_users_'.$course_code.'_'.api_get_local_time();
84 84
 	} else {
85 85
 		if (api_is_multiple_url_enabled()) {
86
-			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
86
+			$tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
87 87
 			$access_url_id = api_get_current_access_url_id();
88 88
 			if ($access_url_id != -1) {
89
-			$sql.= " FROM $user_table u
89
+			$sql .= " FROM $user_table u
90 90
 					INNER JOIN $tbl_user_rel_access_url as user_rel_url
91 91
 				ON (u.user_id= user_rel_url.user_id)
92 92
 				WHERE access_url_id = $access_url_id
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 		$filename = 'export_users_'.api_get_local_time();
99 99
 	}
100 100
 	$data = array();
101
-	$extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false);
102
-	if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') {
101
+	$extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false);
102
+	if ($export['addcsvheader'] == '1' AND $export['file_type'] == 'csv') {
103 103
 		if ($_configuration['password_encryption'] != 'none') {
104 104
 			$data[] = array(
105 105
 				'UserId',
@@ -127,19 +127,19 @@  discard block
 block discarded – undo
127 127
 			);
128 128
 		}
129 129
 
130
-		foreach($extra_fields as $extra) {
131
-			$data[0][]=$extra[1];
130
+		foreach ($extra_fields as $extra) {
131
+			$data[0][] = $extra[1];
132 132
 		}
133 133
 	}
134 134
 
135 135
 	$res = Database::query($sql);
136
-	while($user = Database::fetch_array($res,'ASSOC')) {
136
+	while ($user = Database::fetch_array($res, 'ASSOC')) {
137 137
 		$student_data = UserManager:: get_extra_user_data(
138 138
 			$user['UserId'],
139 139
 			true,
140 140
 			false
141 141
 		);
142
-		foreach($student_data as $key=>$value) {
142
+		foreach ($student_data as $key=>$value) {
143 143
 			$key = substr($key, 6);
144 144
 			if (is_array($value)) {
145 145
 				$user[$key] = $value[$key];
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 				$user[$key] = $value;
148 148
 			}
149 149
 		}
150
-		$data[] = $user	;
150
+		$data[] = $user;
151 151
 	}
152 152
 
153 153
 	switch ($file_type) {
Please login to merge, or discard this patch.
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -29,20 +29,20 @@  discard block
 block discarded – undo
29 29
 global $_configuration;
30 30
 
31 31
 if (api_is_multiple_url_enabled()) {
32
-	$tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
33
-	$access_url_id = api_get_current_access_url_id();
34
-	if ($access_url_id != -1){
35
-	$sql = "SELECT code,visual_code,title
32
+    $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
33
+    $access_url_id = api_get_current_access_url_id();
34
+    if ($access_url_id != -1){
35
+    $sql = "SELECT code,visual_code,title
36 36
 		FROM $course_table as c
37 37
 		INNER JOIN $tbl_course_rel_access_url as course_rel_url
38 38
 		ON (c.id = course_rel_url.c_id)
39 39
 		WHERE access_url_id = $access_url_id
40 40
 		ORDER BY visual_code";
41
-	}
41
+    }
42 42
 }
43 43
 $result = Database::query($sql);
44 44
 while ($course = Database::fetch_object($result)) {
45
-	$courses[$course->code] = $course->visual_code.' - '.$course->title;
45
+    $courses[$course->code] = $course->visual_code.' - '.$course->title;
46 46
 }
47 47
 $form = new FormValidator('export_users');
48 48
 $form->addElement('header', $tool_name);
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
 $form->setDefaults(array('file_type' => 'csv'));
57 57
 
58 58
 if ($form->validate()) {
59
-	$export = $form->exportValues();
60
-	$file_type = $export['file_type'];
61
-	$course_code = Database::escape_string($export['course_code']);
62
-	$courseInfo = api_get_course_info($course_code);
63
-	$courseId = $courseInfo['real_id'];
59
+    $export = $form->exportValues();
60
+    $file_type = $export['file_type'];
61
+    $course_code = Database::escape_string($export['course_code']);
62
+    $courseInfo = api_get_course_info($course_code);
63
+    $courseId = $courseInfo['real_id'];
64 64
 
65
-	$sql = "SELECT
65
+    $sql = "SELECT
66 66
 				u.user_id 	AS UserId,
67 67
 				u.lastname 	AS LastName,
68 68
 				u.firstname 	AS FirstName,
@@ -73,96 +73,96 @@  discard block
 block discarded – undo
73 73
 				u.status		AS Status,
74 74
 				u.official_code	AS OfficialCode,
75 75
 				u.phone		AS Phone";
76
-	if (strlen($course_code) > 0) {
77
-		$sql .= " FROM $user_table u, $course_user_table cu
76
+    if (strlen($course_code) > 0) {
77
+        $sql .= " FROM $user_table u, $course_user_table cu
78 78
 					WHERE
79 79
 						u.user_id = cu.user_id AND
80 80
 						cu.c_id = $courseId AND
81 81
 						cu.relation_type<>".COURSE_RELATION_TYPE_RRHH."
82 82
 					ORDER BY lastname,firstname";
83
-		$filename = 'export_users_'.$course_code.'_'.api_get_local_time();
84
-	} else {
85
-		if (api_is_multiple_url_enabled()) {
86
-			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
87
-			$access_url_id = api_get_current_access_url_id();
88
-			if ($access_url_id != -1) {
89
-			$sql.= " FROM $user_table u
83
+        $filename = 'export_users_'.$course_code.'_'.api_get_local_time();
84
+    } else {
85
+        if (api_is_multiple_url_enabled()) {
86
+            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
87
+            $access_url_id = api_get_current_access_url_id();
88
+            if ($access_url_id != -1) {
89
+            $sql.= " FROM $user_table u
90 90
 					INNER JOIN $tbl_user_rel_access_url as user_rel_url
91 91
 				ON (u.user_id= user_rel_url.user_id)
92 92
 				WHERE access_url_id = $access_url_id
93 93
 				ORDER BY lastname,firstname";
94
-			}
95
-		} else {
96
-			$sql .= " FROM $user_table u ORDER BY lastname,firstname";
97
-		}
98
-		$filename = 'export_users_'.api_get_local_time();
99
-	}
100
-	$data = array();
101
-	$extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false);
102
-	if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') {
103
-		if ($_configuration['password_encryption'] != 'none') {
104
-			$data[] = array(
105
-				'UserId',
106
-				'LastName',
107
-				'FirstName',
108
-				'Email',
109
-				'UserName',
110
-				'AuthSource',
111
-				'Status',
112
-				'OfficialCode',
113
-				'PhoneNumber',
114
-			);
115
-		} else {
116
-			$data[] = array(
117
-				'UserId',
118
-				'LastName',
119
-				'FirstName',
120
-				'Email',
121
-				'UserName',
122
-				'Password',
123
-				'AuthSource',
124
-				'Status',
125
-				'OfficialCode',
126
-				'PhoneNumber',
127
-			);
128
-		}
129
-
130
-		foreach($extra_fields as $extra) {
131
-			$data[0][]=$extra[1];
132
-		}
133
-	}
134
-
135
-	$res = Database::query($sql);
136
-	while($user = Database::fetch_array($res,'ASSOC')) {
137
-		$student_data = UserManager:: get_extra_user_data(
138
-			$user['UserId'],
139
-			true,
140
-			false
141
-		);
142
-		foreach($student_data as $key=>$value) {
143
-			$key = substr($key, 6);
144
-			if (is_array($value)) {
145
-				$user[$key] = $value[$key];
146
-			} else {
147
-				$user[$key] = $value;
148
-			}
149
-		}
150
-		$data[] = $user	;
151
-	}
152
-
153
-	switch ($file_type) {
154
-		case 'xml':
155
-			Export::arrayToXml($data, $filename, 'Contact', 'Contacts');
156
-			exit;
157
-			break;
158
-		case 'csv':
159
-			Export::arrayToCsv($data, $filename);
160
-			exit;
161
-		case 'xls':
162
-			Export::arrayToXls($data, $filename);
163
-			exit;
164
-			break;
165
-	}
94
+            }
95
+        } else {
96
+            $sql .= " FROM $user_table u ORDER BY lastname,firstname";
97
+        }
98
+        $filename = 'export_users_'.api_get_local_time();
99
+    }
100
+    $data = array();
101
+    $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false);
102
+    if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') {
103
+        if ($_configuration['password_encryption'] != 'none') {
104
+            $data[] = array(
105
+                'UserId',
106
+                'LastName',
107
+                'FirstName',
108
+                'Email',
109
+                'UserName',
110
+                'AuthSource',
111
+                'Status',
112
+                'OfficialCode',
113
+                'PhoneNumber',
114
+            );
115
+        } else {
116
+            $data[] = array(
117
+                'UserId',
118
+                'LastName',
119
+                'FirstName',
120
+                'Email',
121
+                'UserName',
122
+                'Password',
123
+                'AuthSource',
124
+                'Status',
125
+                'OfficialCode',
126
+                'PhoneNumber',
127
+            );
128
+        }
129
+
130
+        foreach($extra_fields as $extra) {
131
+            $data[0][]=$extra[1];
132
+        }
133
+    }
134
+
135
+    $res = Database::query($sql);
136
+    while($user = Database::fetch_array($res,'ASSOC')) {
137
+        $student_data = UserManager:: get_extra_user_data(
138
+            $user['UserId'],
139
+            true,
140
+            false
141
+        );
142
+        foreach($student_data as $key=>$value) {
143
+            $key = substr($key, 6);
144
+            if (is_array($value)) {
145
+                $user[$key] = $value[$key];
146
+            } else {
147
+                $user[$key] = $value;
148
+            }
149
+        }
150
+        $data[] = $user	;
151
+    }
152
+
153
+    switch ($file_type) {
154
+        case 'xml':
155
+            Export::arrayToXml($data, $filename, 'Contact', 'Contacts');
156
+            exit;
157
+            break;
158
+        case 'csv':
159
+            Export::arrayToCsv($data, $filename);
160
+            exit;
161
+        case 'xls':
162
+            Export::arrayToXls($data, $filename);
163
+            exit;
164
+            break;
165
+    }
166 166
 }
167 167
 
168 168
 Display :: display_header($tool_name);
Please login to merge, or discard this patch.
main/admin/course_export.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $courses = $course_list;
47 47
     }
48 48
 
49
-	if (!empty($courses)) {
49
+    if (!empty($courses)) {
50 50
 
51 51
         $archiveFile = 'export_courses_list_'.api_get_local_time();
52 52
 
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
                 Export::arrayToXls($listToExport, $archiveFile);
99 99
                 break;
100 100
         }
101
-	} else {
101
+    } else {
102 102
         Display::addFlash(
103 103
             Display::return_message(
104 104
                 get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty')
105 105
             )
106 106
         );
107
-	}
107
+    }
108 108
 }
109 109
 
110 110
 
@@ -114,29 +114,29 @@  discard block
 block discarded – undo
114 114
 $form->addHeader($tool_name);
115 115
 $form->addHidden('formSent', 1);
116 116
 $form->addElement(
117
-	'radio',
118
-	'select_type',
119
-	get_lang('Option'),
120
-	get_lang('ExportAllCoursesList'),
121
-	 '1',
122
-	 ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"]
117
+    'radio',
118
+    'select_type',
119
+    get_lang('Option'),
120
+    get_lang('ExportAllCoursesList'),
121
+        '1',
122
+        ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"]
123 123
 );
124 124
 
125 125
 $form->addElement(
126
-	'radio',
127
-	'select_type',
128
-	'',
129
-	get_lang('ExportSelectedCoursesFromCoursesList'),
130
-	'2',
131
-	['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"]
126
+    'radio',
127
+    'select_type',
128
+    '',
129
+    get_lang('ExportSelectedCoursesFromCoursesList'),
130
+    '2',
131
+    ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"]
132 132
 );
133 133
 
134 134
 if (!empty($course_list)) {
135
-	$form->addHtml('<div id="div-course-list" style="display:none">');
136
-	$coursesInList = [];
137
-	foreach ($course_list as $course) {
138
-		$coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')';
139
-	}
135
+    $form->addHtml('<div id="div-course-list" style="display:none">');
136
+    $coursesInList = [];
137
+    foreach ($course_list as $course) {
138
+        $coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')';
139
+    }
140 140
 
141 141
     $form->addSelect(
142 142
         'course_code',
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         ['multiple' => 'multiple']
146 146
     );
147 147
 
148
-	$form->addHtml('</div>');
148
+    $form->addHtml('</div>');
149 149
 }
150 150
 
151 151
 $form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 api_protect_admin_script();
15 15
 
16 16
 $tool_name = get_lang('ExportCourses');
17
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
17
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
18 18
 
19 19
 set_time_limit(0);
20 20
 
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
         $dataToExport = [];
65 65
 
66 66
         foreach ($courses as $course) {
67
-            $dataToExport['code'] = str_replace(';',',',$course['code']);
68
-            $dataToExport['title'] = str_replace(';',',',$course['title']);
69
-            $dataToExport['category_code'] = str_replace(';',',',$course['category_code']);
67
+            $dataToExport['code'] = str_replace(';', ',', $course['code']);
68
+            $dataToExport['title'] = str_replace(';', ',', $course['title']);
69
+            $dataToExport['category_code'] = str_replace(';', ',', $course['category_code']);
70 70
             $categoryInfo = CourseCategory::getCategory($course['category_code']);
71 71
             if ($categoryInfo) {
72
-                $dataToExport['category_name'] = str_replace(';',',',$categoryInfo['name']);
72
+                $dataToExport['category_name'] = str_replace(';', ',', $categoryInfo['name']);
73 73
             } else {
74 74
                 $dataToExport['category_name'] = '';
75 75
             }
76
-            $dataToExport['tutor_name'] = str_replace(';',',',$course['tutor_name']);
77
-            $dataToExport['course_language'] = str_replace(';',',',$course['course_language']);
76
+            $dataToExport['tutor_name'] = str_replace(';', ',', $course['tutor_name']);
77
+            $dataToExport['course_language'] = str_replace(';', ',', $course['course_language']);
78 78
 
79 79
             $dataToExport['students'] = '';
80 80
             $dataToExport['teachers'] = '';
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
             if (is_array($usersInCourse) && !empty($usersInCourse)) {
85 85
                 foreach ($usersInCourse as $user) {
86 86
                     if ($user['status_rel'] == COURSEMANAGER) {
87
-                        $dataToExport['teachers'] .= $user['username'] . '|';
87
+                        $dataToExport['teachers'] .= $user['username'].'|';
88 88
                     } else {
89
-                        $dataToExport['students'] .= $user['username'] . '|';
89
+                        $dataToExport['students'] .= $user['username'].'|';
90 90
                     }
91 91
                 }
92 92
             }
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 	$form->addHtml('</div>');
159 159
 }
160 160
 
161
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
162
-$form->addElement('radio', 'file_type', '' , 'XLS' , 'xls', null);
161
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null);
162
+$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null);
163 163
 $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml'));
164 164
 
165 165
 $form->setDefaults(['select_type' => '1', 'file_type' => 'csv']);
Please login to merge, or discard this patch.
main/admin/usergroup_user_import.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
         foreach ($mandatory_fields as $field) {
27 27
             if (!isset($user_class[$field]) || strlen($user_class[$field]) == 0) {
28
-                $user_class['error'] = get_lang($field . 'Mandatory');
28
+                $user_class['error'] = get_lang($field.'Mandatory');
29 29
                 $errors[] = $user_class;
30 30
             }
31 31
         }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 // 2.1.1 Check whether code exists in DB
38 38
                 $exists = $usergroup->usergroup_exists($user_class['ClassName']);
39 39
                 if (!$exists) {
40
-                    $user_class['error'] = get_lang('CodeDoesNotExists') . ': ' . $user_class['ClassName'];
40
+                    $user_class['error'] = get_lang('CodeDoesNotExists').': '.$user_class['ClassName'];
41 41
                     $errors[] = $user_class;
42 42
                 } else {
43 43
                     $classcodes[$user_class['CourseCode']] = 1;
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
         if (!UserManager::is_username_empty($user_class['UserName'])) {
50 50
             // 3.1. Check whether username is too long.
51 51
             if (UserManager::is_username_too_long($user_class['UserName'])) {
52
-                $user_class['error'] = get_lang('UserNameTooLong') . ': ' . $user_class['UserName'];
52
+                $user_class['error'] = get_lang('UserNameTooLong').': '.$user_class['UserName'];
53 53
                 $errors[] = $user_class;
54 54
             }
55 55
 
56 56
             $username = UserManager::purify_username($user_class['UserName'], $purification_option_for_usernames);
57 57
             // 3.2. Check whether username exists.
58 58
             if (UserManager::is_username_available($username)) {
59
-                $user_class['error'] = get_lang('UnknownUser') . ': ' . $username;
59
+                $user_class['error'] = get_lang('UnknownUser').': '.$username;
60 60
                 $errors[] = $user_class;
61 61
             }
62 62
         }
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
             $class_name = $user_data['class_name'];
106 106
             $user_list_name = $user_data['user_list_name'];
107 107
             $usergroup->subscribe_users_to_usergroup($class_id, $user_list, $deleteUsersNotInList);
108
-            $message .= Display::return_message(get_lang('Class') . ': ' . $class_name . '<br />', 'normal', false);
109
-            $message .= Display::return_message(get_lang('Users') . ': ' . implode(', ', $user_list_name));
108
+            $message .= Display::return_message(get_lang('Class').': '.$class_name.'<br />', 'normal', false);
109
+            $message .= Display::return_message(get_lang('Users').': '.implode(', ', $user_list_name));
110 110
         }
111 111
     }
112 112
     return $message;
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 $this_section = SECTION_PLATFORM_ADMIN;
129 129
 api_protect_admin_script(true);
130 130
 
131
-$tool_name = get_lang('AddUsersToAClass') . ' CSV';
131
+$tool_name = get_lang('AddUsersToAClass').' CSV';
132 132
 
133 133
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
134 134
 $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes'));
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 if (count($errors) != 0) {
165 165
     $error_message = "\n";
166 166
     foreach ($errors as $index => $error_class_user) {
167
-        $error_message .= get_lang('Line') . ' ' . $error_class_user['line'] . ': ' . $error_class_user['error'] . '</b>';
167
+        $error_message .= get_lang('Line').' '.$error_class_user['line'].': '.$error_class_user['error'].'</b>';
168 168
         $error_message .= "<br />";
169 169
     }
170 170
     $error_message .= "\n";
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 }
173 173
 $form->display();
174 174
 ?>
175
-<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
175
+<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
176 176
 <pre>
177 177
 <b>UserName</b>;<b>ClassName</b>
178 178
 jdoe;class01
Please login to merge, or discard this patch.
main/admin/sub_language.php 3 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,8 +200,9 @@
 block discarded – undo
200 200
 					continue;
201 201
 				}
202 202
 
203
-				if (is_array($variable_value))
204
-					echo $lang_file;
203
+				if (is_array($variable_value)) {
204
+									echo $lang_file;
205
+				}
205 206
 				$founded = false;
206 207
 				if ($search_in_english && $search_in_variable) {
207 208
 					// searching the item in the parent tool
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $this_section = SECTION_PLATFORM_ADMIN;
12 12
 
13 13
 api_protect_admin_script();
14
-$htmlHeadXtra[] ='<script>
14
+$htmlHeadXtra[] = '<script>
15 15
  $(document).ready(function() {
16 16
 	$(".save").click(function() {
17 17
 		var button_name=$(this).attr("name");
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 				    \'new_language\': is_new_language,
37 37
 				    \'variable_language\': is_variable_language,
38 38
 				    \'file_id\': file_id,
39
-				    \'id\': ' . intval($_REQUEST['id']) . ',
40
-                    \'sub\': ' . intval($_REQUEST['sub_language_id']) . ',
41
-                    \'sub_language_id\': ' . intval($_REQUEST['sub_language_id']) . '
39
+				    \'id\': ' . intval($_REQUEST['id']).',
40
+                    \'sub\': ' . intval($_REQUEST['sub_language_id']).',
41
+                    \'sub_language_id\': ' . intval($_REQUEST['sub_language_id']).'
42 42
 				},
43 43
 				success: function(datos) {
44 44
 					if (datos == "1") {
45
-						$("#div_message_information_id").html(\'' . Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success') . '\');
45
+						$("#div_message_information_id").html(\'' . Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success').'\');
46 46
 					} else {
47 47
 						$("#div_message_information_id").html("<div class=\"alert alert-warning\">" + datos +"</div>");
48 48
 					}
49 49
 				}
50 50
 			});
51 51
 		} else {
52
-			$("#div_message_information_id").html(\'' . Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error') . '\');
52
+			$("#div_message_information_id").html(\'' . Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error').'\');
53 53
 		}
54 54
 	});
55 55
 });
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 // setting the name of the tool
61 61
 $tool_name = get_lang('CreateSubLanguage');
62 62
 // setting breadcrumbs
63
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
64
-$interbreadcrumb[] = array ('url' => 'languages.php', 'name' => get_lang('PlatformLanguages'));
63
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
64
+$interbreadcrumb[] = array('url' => 'languages.php', 'name' => get_lang('PlatformLanguages'));
65 65
 
66 66
 $sublanguage_folder_error = false;
67 67
 
68
-if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) {
69
-	$language_name              = SubLanguageManager::get_name_of_language_by_id ($_GET['id']);
70
-	$sub_language_name          = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
68
+if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
69
+	$language_name              = SubLanguageManager::get_name_of_language_by_id($_GET['id']);
70
+	$sub_language_name          = SubLanguageManager::get_name_of_language_by_id($_GET['sub_language_id']);
71 71
 	$all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
72 72
 	$all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
73 73
 	$sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
@@ -75,20 +75,20 @@  discard block
 block discarded – undo
75 75
 	if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
76 76
 		$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
77 77
 	}
78
-	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
78
+	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id']) === true) {
79 79
 		$language_id_exist = true;
80 80
 	} else {
81 81
 		$language_id_exist = false;
82 82
 	}
83 83
 } else {
84
-	$language_name='';
85
-	$language_id_exist=false;
84
+	$language_name = '';
85
+	$language_id_exist = false;
86 86
 }
87 87
 
88 88
 $intro = sprintf(get_lang('RegisterTermsOfSubLanguageForX'), strtolower($sub_language_name));
89 89
 $path_folder = api_get_path(SYS_LANG_PATH).$all_data_of_language['dokeos_folder'];
90 90
 
91
-if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder'])==0) {
91
+if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder']) == 0) {
92 92
 	api_not_allowed(true);
93 93
 }
94 94
 
@@ -109,16 +109,16 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 $txt_search_word = (!empty($_REQUEST['txt_search_word']) ? Security::remove_XSS($_REQUEST['txt_search_word']) : '');
112
-$html ='<div style="float:left" class="actions">';
113
-$html.='<form style="float:left"  id="Searchlanguage" name="Searchlanguage" method="GET" action="sub_language.php">';
114
-$html.='&nbsp;'.get_lang('OriginalName').'&nbsp; :&nbsp;';
112
+$html = '<div style="float:left" class="actions">';
113
+$html .= '<form style="float:left"  id="Searchlanguage" name="Searchlanguage" method="GET" action="sub_language.php">';
114
+$html .= '&nbsp;'.get_lang('OriginalName').'&nbsp; :&nbsp;';
115 115
 
116
-$html.='<input name="id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['id']).'" />';
117
-$html.='<input name="sub_language_id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['sub_language_id']).'" />';
118
-$html.='<input name="txt_search_word" type="text" size="50"  id="txt_search_word" value="'.$txt_search_word.'" />';
119
-$html.="&nbsp;".'<button name="SubmitSearchLanguage" class="search" type="submit">'.get_lang('Search').'</button>';
120
-$html.='</form>';
121
-$html.='</div>';
116
+$html .= '<input name="id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['id']).'" />';
117
+$html .= '<input name="sub_language_id" type="hidden"  id="id" value="'.Security::remove_XSS($_REQUEST['sub_language_id']).'" />';
118
+$html .= '<input name="txt_search_word" type="text" size="50"  id="txt_search_word" value="'.$txt_search_word.'" />';
119
+$html .= "&nbsp;".'<button name="SubmitSearchLanguage" class="search" type="submit">'.get_lang('Search').'</button>';
120
+$html .= '</form>';
121
+$html .= '</div>';
122 122
 echo $html;
123 123
 echo '<br /><br /><br />';
124 124
 if (!empty($sublanguage_folder_error)) {
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 	$language_files_to_load_keys = array_flip($language_files_to_load);
155 155
 	$array_to_search = $parent_language_array;
156 156
 	$list_info = array();
157
-	$term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
157
+	$term = '/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
158 158
 	//@todo optimize this foreach
159 159
 	foreach ($language_files_to_load as $lang_file) {
160 160
 		//searching in parent language of the sub language
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 				}
168 168
 				$founded = false;
169 169
 				// searching the item in the parent tool
170
-				if (preg_match($term,$parent_variable_value)!==0) {
170
+				if (preg_match($term, $parent_variable_value) !== 0) {
171 171
 					$founded = true;
172 172
 				}
173 173
 				if ($founded) {
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
 						$size =4;
184 184
 					}*/
185 185
 
186
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
187
-					$obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
186
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
187
+					$obj_button = '<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
188 188
 
189 189
 					$list_info[] = array(
190
-						$lang_file . '.inc.php',
190
+						$lang_file.'.inc.php',
191 191
 						$parent_name_variable,
192 192
 						$english_name_variable,
193 193
 						$parent_variable_value,
@@ -211,16 +211,16 @@  discard block
 block discarded – undo
211 211
 				$founded = false;
212 212
 				if ($search_in_english && $search_in_variable) {
213 213
 					// searching the item in the parent tool
214
-					if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
214
+					if (preg_match($term, $variable_value) !== 0 || preg_match($term, $name_variable) !== 0) {
215 215
 						$founded = true;
216 216
 					}
217 217
 				} else {
218 218
 					if ($search_in_english) {
219
-						if (preg_match($term,$variable_value)!==0) {
219
+						if (preg_match($term, $variable_value) !== 0) {
220 220
 							$founded = true;
221 221
 						}
222 222
 					} else {
223
-						if (preg_match($term,$name_variable)!==0) {
223
+						if (preg_match($term, $name_variable) !== 0) {
224 224
 							$founded = true;
225 225
 						}
226 226
 					}
@@ -237,16 +237,16 @@  discard block
 block discarded – undo
237 237
 						$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
238 238
 					}
239 239
 					//config buttons
240
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
240
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
241 241
 						$sub_language_name_variable.'
242 242
 						</textarea>';
243
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
243
+					$obj_button = '<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
244 244
 
245 245
 					//loading variable from the english array
246 246
 					$english_name_variable = $english_language_array[$lang_file][$name_variable];
247 247
 
248 248
 					$list_info[] = array(
249
-						$lang_file . '.inc.php',
249
+						$lang_file.'.inc.php',
250 250
 						$name_variable,
251 251
 						$english_name_variable,
252 252
 						$parent_variable_value,
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
 				$founded = false;
273 273
 				// searching the item in the parent tool
274
-				if (preg_match($term,$variable_value)!==0) {
274
+				if (preg_match($term, $variable_value) !== 0) {
275 275
 					$founded = true;
276 276
 				}
277 277
 				if ($founded) {
@@ -279,15 +279,15 @@  discard block
 block discarded – undo
279 279
 					$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
280 280
 					$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
281 281
 					//config buttons
282
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
283
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
282
+					$obj_text = '<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
283
+					$obj_button = '<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
284 284
 
285 285
 					//loading variable from the english array
286 286
 					$english_name_variable = $english_language_array[$lang_file][$name_variable];
287
-					$list_info[]=array($lang_file.'.inc.php',
287
+					$list_info[] = array($lang_file.'.inc.php',
288 288
 						$name_variable,
289 289
 						$english_name_variable,
290
-						$parent_variable_value,$obj_text,$obj_button);
290
+						$parent_variable_value, $obj_text, $obj_button);
291 291
 				}
292 292
 			}
293 293
 		}
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 $list_info = array();
302 302
 if (isset($_REQUEST['txt_search_word'])) {
303 303
 	//@todo fix to accept a char with 1 char
304
-	if (strlen(trim($_REQUEST['txt_search_word']))>2) {
304
+	if (strlen(trim($_REQUEST['txt_search_word'])) > 2) {
305 305
 		$list_info = search_language_term(
306 306
 			$_REQUEST['txt_search_word'],
307 307
 			true,
@@ -317,14 +317,14 @@  discard block
 block discarded – undo
317 317
 	'sub_language_id' => intval($_GET['sub_language_id']),
318 318
 	'txt_search_word' => $txt_search_word
319 319
 );
320
-$table = new SortableTableFromArrayConfig($list_info, 1,20,'data_info');
320
+$table = new SortableTableFromArrayConfig($list_info, 1, 20, 'data_info');
321 321
 $table->set_additional_parameters($parameters);
322 322
 $table->set_header(0, get_lang('LanguageFile'));
323 323
 $table->set_header(1, get_lang('LanguageVariable'));
324 324
 $table->set_header(2, get_lang('EnglishName'));
325 325
 $table->set_header(3, get_lang('OriginalName'));
326
-$table->set_header(4, get_lang('Translation'),false);
327
-$table->set_header(5, get_lang('Action'),false);
326
+$table->set_header(4, get_lang('Translation'), false);
327
+$table->set_header(5, get_lang('Action'), false);
328 328
 $table->display();
329 329
 
330 330
 Display :: display_footer();
Please login to merge, or discard this patch.
Indentation   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -66,30 +66,30 @@  discard block
 block discarded – undo
66 66
 $sublanguage_folder_error = false;
67 67
 
68 68
 if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) {
69
-	$language_name              = SubLanguageManager::get_name_of_language_by_id ($_GET['id']);
70
-	$sub_language_name          = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
71
-	$all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
72
-	$all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
73
-	$sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
69
+    $language_name              = SubLanguageManager::get_name_of_language_by_id ($_GET['id']);
70
+    $sub_language_name          = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
71
+    $all_data_of_language       = SubLanguageManager::get_all_information_of_language($_GET['id']);
72
+    $all_data_of_sublanguage    = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
73
+    $sub_language_file          = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
74 74
 
75
-	if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
76
-		$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
77
-	}
78
-	if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
79
-		$language_id_exist = true;
80
-	} else {
81
-		$language_id_exist = false;
82
-	}
75
+    if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
76
+        $sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
77
+    }
78
+    if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
79
+        $language_id_exist = true;
80
+    } else {
81
+        $language_id_exist = false;
82
+    }
83 83
 } else {
84
-	$language_name='';
85
-	$language_id_exist=false;
84
+    $language_name='';
85
+    $language_id_exist=false;
86 86
 }
87 87
 
88 88
 $intro = sprintf(get_lang('RegisterTermsOfSubLanguageForX'), strtolower($sub_language_name));
89 89
 $path_folder = api_get_path(SYS_LANG_PATH).$all_data_of_language['dokeos_folder'];
90 90
 
91 91
 if (!is_dir($path_folder) || strlen($all_data_of_language['dokeos_folder'])==0) {
92
-	api_not_allowed(true);
92
+    api_not_allowed(true);
93 93
 }
94 94
 
95 95
 Display :: display_header($language_name);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 echo $html;
115 115
 echo '<br /><br /><br />';
116 116
 if (!empty($sublanguage_folder_error)) {
117
-	Display::display_warning_message($sublanguage_folder_error);
117
+    Display::display_warning_message($sublanguage_folder_error);
118 118
 }
119 119
 echo '<div id="div_message_information_id">&nbsp;</div>';
120 120
 
@@ -128,186 +128,186 @@  discard block
 block discarded – undo
128 128
  * @return array
129 129
  */
130 130
 function search_language_term(
131
-	$term,
132
-	$search_in_variable = true,
133
-	$search_in_english = true,
134
-	$search_in_parent = true,
135
-	$search_in_sub_language = true
131
+    $term,
132
+    $search_in_variable = true,
133
+    $search_in_english = true,
134
+    $search_in_parent = true,
135
+    $search_in_sub_language = true
136 136
 ) {
137
-	//These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION)
138
-	/*
137
+    //These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION)
138
+    /*
139 139
 		These 4 arrays are set in global.inc.php with the condition that will be load from sub_language.php or sub_language_ajax.inc.php
140 140
 		$english_language_array
141 141
 		$parent_language_array
142 142
 		$sub_language_array
143 143
 		$language_files_to_load
144 144
 	*/
145
-	global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array;
146
-	$language_files_to_load_keys = array_flip($language_files_to_load);
147
-	$array_to_search = $parent_language_array;
148
-	$list_info = array();
149
-	$term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
150
-	//@todo optimize this foreach
151
-	foreach ($language_files_to_load as $lang_file) {
152
-		//searching in parent language of the sub language
153
-		if ($search_in_parent) {
154
-			$variables = $parent_language_array[$lang_file];
155
-			foreach ($variables as $parent_name_variable =>$parent_variable_value) {
156
-				//arrays are avoided
157
-				if (is_array($parent_variable_value)) {
158
-					continue;
159
-				}
160
-				$founded = false;
161
-				// searching the item in the parent tool
162
-				if (preg_match($term,$parent_variable_value)!==0) {
163
-					$founded = true;
164
-				}
165
-				if ($founded) {
166
-					//loading variable from the english array
167
-					$sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable];
168
-					//loading variable from the english array
169
-					$english_name_variable = $english_language_array[$lang_file][$parent_name_variable];
145
+    global $language_files_to_load, $sub_language_array, $english_language_array, $parent_language_array;
146
+    $language_files_to_load_keys = array_flip($language_files_to_load);
147
+    $array_to_search = $parent_language_array;
148
+    $list_info = array();
149
+    $term='/'.Security::remove_XSS(trim($_REQUEST['txt_search_word'])).'/i';
150
+    //@todo optimize this foreach
151
+    foreach ($language_files_to_load as $lang_file) {
152
+        //searching in parent language of the sub language
153
+        if ($search_in_parent) {
154
+            $variables = $parent_language_array[$lang_file];
155
+            foreach ($variables as $parent_name_variable =>$parent_variable_value) {
156
+                //arrays are avoided
157
+                if (is_array($parent_variable_value)) {
158
+                    continue;
159
+                }
160
+                $founded = false;
161
+                // searching the item in the parent tool
162
+                if (preg_match($term,$parent_variable_value)!==0) {
163
+                    $founded = true;
164
+                }
165
+                if ($founded) {
166
+                    //loading variable from the english array
167
+                    $sub_language_name_variable = $sub_language_array[$lang_file][$parent_name_variable];
168
+                    //loading variable from the english array
169
+                    $english_name_variable = $english_language_array[$lang_file][$parent_name_variable];
170 170
 
171
-					//config buttons
172
-					/*if (strlen($english_name_variable)>1500) {
171
+                    //config buttons
172
+                    /*if (strlen($english_name_variable)>1500) {
173 173
 						$size =20;
174 174
 					} else {
175 175
 						$size =4;
176 176
 					}*/
177 177
 
178
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
179
-					$obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
178
+                    $obj_text='<textarea rows="10" cols="40" name="txt|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$parent_name_variable.'" >'.$sub_language_name_variable.'</textarea>';
179
+                    $obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'"  />'.get_lang('Save').'</button>';
180 180
 
181
-					$list_info[] = array(
182
-						$lang_file . '.inc.php',
183
-						$parent_name_variable,
184
-						$english_name_variable,
185
-						$parent_variable_value,
186
-						$obj_text,
187
-						$obj_button
188
-					);
189
-				}
190
-			}
191
-		}
181
+                    $list_info[] = array(
182
+                        $lang_file . '.inc.php',
183
+                        $parent_name_variable,
184
+                        $english_name_variable,
185
+                        $parent_variable_value,
186
+                        $obj_text,
187
+                        $obj_button
188
+                    );
189
+                }
190
+            }
191
+        }
192 192
 
193
-		//search in english
194
-		if ($search_in_english || $search_in_variable) {
195
-			$variables = $english_language_array[$lang_file];
196
-			foreach ($variables as $name_variable =>$variable_value) {
197
-				if (is_array($variable_value)) {
198
-					continue;
199
-				}
193
+        //search in english
194
+        if ($search_in_english || $search_in_variable) {
195
+            $variables = $english_language_array[$lang_file];
196
+            foreach ($variables as $name_variable =>$variable_value) {
197
+                if (is_array($variable_value)) {
198
+                    continue;
199
+                }
200 200
 
201
-				if (is_array($variable_value))
202
-					echo $lang_file;
203
-				$founded = false;
204
-				if ($search_in_english && $search_in_variable) {
205
-					// searching the item in the parent tool
206
-					if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
207
-						$founded = true;
208
-					}
209
-				} else {
210
-					if ($search_in_english) {
211
-						if (preg_match($term,$variable_value)!==0) {
212
-							$founded = true;
213
-						}
214
-					} else {
215
-						if (preg_match($term,$name_variable)!==0) {
216
-							$founded = true;
217
-						}
218
-					}
219
-				}
201
+                if (is_array($variable_value))
202
+                    echo $lang_file;
203
+                $founded = false;
204
+                if ($search_in_english && $search_in_variable) {
205
+                    // searching the item in the parent tool
206
+                    if (preg_match($term,$variable_value)!==0 || preg_match($term,$name_variable)!==0 ) {
207
+                        $founded = true;
208
+                    }
209
+                } else {
210
+                    if ($search_in_english) {
211
+                        if (preg_match($term,$variable_value)!==0) {
212
+                            $founded = true;
213
+                        }
214
+                    } else {
215
+                        if (preg_match($term,$name_variable)!==0) {
216
+                            $founded = true;
217
+                        }
218
+                    }
219
+                }
220 220
 
221
-				if ($founded) {
222
-					//loading variable from the english array
223
-					$sub_language_name_variable = null;
224
-					if (isset($sub_language_array[$lang_file][$name_variable])) {
225
-						$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
226
-					}
227
-					$parent_variable_value = null;
228
-					if (isset($parent_language_array[$lang_file][$name_variable])) {
229
-						$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
230
-					}
231
-					//config buttons
232
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
233
-						$sub_language_name_variable.'
221
+                if ($founded) {
222
+                    //loading variable from the english array
223
+                    $sub_language_name_variable = null;
224
+                    if (isset($sub_language_array[$lang_file][$name_variable])) {
225
+                        $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
226
+                    }
227
+                    $parent_variable_value = null;
228
+                    if (isset($parent_language_array[$lang_file][$name_variable])) {
229
+                        $parent_variable_value = $parent_language_array[$lang_file][$name_variable];
230
+                    }
231
+                    //config buttons
232
+                    $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.
233
+                        $sub_language_name_variable.'
234 234
 						</textarea>';
235
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
235
+                    $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
236 236
 
237
-					//loading variable from the english array
238
-					$english_name_variable = $english_language_array[$lang_file][$name_variable];
237
+                    //loading variable from the english array
238
+                    $english_name_variable = $english_language_array[$lang_file][$name_variable];
239 239
 
240
-					$list_info[] = array(
241
-						$lang_file . '.inc.php',
242
-						$name_variable,
243
-						$english_name_variable,
244
-						$parent_variable_value,
245
-						$obj_text,
246
-						$obj_button
247
-					);
248
-				}
249
-			}
250
-		}
240
+                    $list_info[] = array(
241
+                        $lang_file . '.inc.php',
242
+                        $name_variable,
243
+                        $english_name_variable,
244
+                        $parent_variable_value,
245
+                        $obj_text,
246
+                        $obj_button
247
+                    );
248
+                }
249
+            }
250
+        }
251 251
 
252
-		// Search in sub language
253
-		if ($search_in_sub_language) {
254
-			$variables = $sub_language_array[$lang_file];
255
-			foreach ($variables as $name_variable =>$variable_value) {
256
-				if (is_array($parent_variable_value)) {
257
-					continue;
258
-				}
252
+        // Search in sub language
253
+        if ($search_in_sub_language) {
254
+            $variables = $sub_language_array[$lang_file];
255
+            foreach ($variables as $name_variable =>$variable_value) {
256
+                if (is_array($parent_variable_value)) {
257
+                    continue;
258
+                }
259 259
 
260
-				if (is_array($variable_value)) {
261
-					continue;
262
-				}
260
+                if (is_array($variable_value)) {
261
+                    continue;
262
+                }
263 263
 
264
-				$founded = false;
265
-				// searching the item in the parent tool
266
-				if (preg_match($term,$variable_value)!==0) {
267
-					$founded = true;
268
-				}
269
-				if ($founded) {
270
-					//loading variable from the english array
271
-					$sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
272
-					$parent_variable_value = $parent_language_array[$lang_file][$name_variable];
273
-					//config buttons
274
-					$obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
275
-					$obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
264
+                $founded = false;
265
+                // searching the item in the parent tool
266
+                if (preg_match($term,$variable_value)!==0) {
267
+                    $founded = true;
268
+                }
269
+                if ($founded) {
270
+                    //loading variable from the english array
271
+                    $sub_language_name_variable = $sub_language_array[$lang_file][$name_variable];
272
+                    $parent_variable_value = $parent_language_array[$lang_file][$name_variable];
273
+                    //config buttons
274
+                    $obj_text='<textarea rows="10" cols="40" name="txt|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="txtid_'.$language_files_to_load_keys[$lang_file].'_'.$name_variable.'" >'.$sub_language_name_variable.'</textarea>';
275
+                    $obj_button='<button class="save" type="button" name="btn|'.$name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$name_variable.'"  />'.get_lang('Save').'</button>';
276 276
 
277
-					//loading variable from the english array
278
-					$english_name_variable = $english_language_array[$lang_file][$name_variable];
279
-					$list_info[]=array($lang_file.'.inc.php',
280
-						$name_variable,
281
-						$english_name_variable,
282
-						$parent_variable_value,$obj_text,$obj_button);
283
-				}
284
-			}
285
-		}
286
-	}
277
+                    //loading variable from the english array
278
+                    $english_name_variable = $english_language_array[$lang_file][$name_variable];
279
+                    $list_info[]=array($lang_file.'.inc.php',
280
+                        $name_variable,
281
+                        $english_name_variable,
282
+                        $parent_variable_value,$obj_text,$obj_button);
283
+                }
284
+            }
285
+        }
286
+    }
287 287
 
288
-	$list_info = array_unique_dimensional($list_info);
289
-	return $list_info;
288
+    $list_info = array_unique_dimensional($list_info);
289
+    return $list_info;
290 290
 }
291 291
 
292 292
 // Allow see data in sort table
293 293
 $list_info = array();
294 294
 if (isset($_REQUEST['txt_search_word'])) {
295
-	//@todo fix to accept a char with 1 char
296
-	if (strlen(trim($_REQUEST['txt_search_word']))>2) {
297
-		$list_info = search_language_term(
298
-			$_REQUEST['txt_search_word'],
299
-			true,
300
-			true,
301
-			true,
302
-			true
303
-		);
304
-	}
295
+    //@todo fix to accept a char with 1 char
296
+    if (strlen(trim($_REQUEST['txt_search_word']))>2) {
297
+        $list_info = search_language_term(
298
+            $_REQUEST['txt_search_word'],
299
+            true,
300
+            true,
301
+            true,
302
+            true
303
+        );
304
+    }
305 305
 }
306 306
 
307 307
 $parameters = array(
308
-	'id' => intval($_GET['id']),
309
-	'sub_language_id' => intval($_GET['sub_language_id']),
310
-	'txt_search_word' => $txt_search_word
308
+    'id' => intval($_GET['id']),
309
+    'sub_language_id' => intval($_GET['sub_language_id']),
310
+    'txt_search_word' => $txt_search_word
311 311
 );
312 312
 $table = new SortableTableFromArrayConfig($list_info, 1,20,'data_info');
313 313
 $table->set_additional_parameters($parameters);
Please login to merge, or discard this patch.
main/admin/extra_fields.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $obj->setupBreadcrumb($interbreadcrumb, $action);
37 37
 
38 38
 //jqgrid will use this URL to do the selects
39
-$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_extra_fields&type=' . $extraFieldType;
39
+$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_extra_fields&type='.$extraFieldType;
40 40
 
41 41
 //The order is important you need to check the the $column variable in the model.ajax.php file
42 42
 $columns = $obj->getJqgridColumnNames();
@@ -64,43 +64,43 @@  discard block
 block discarded – undo
64 64
         array(),
65 65
         $action_links,
66 66
         true
67
-    ). '
67
+    ).'
68 68
 
69 69
     $("#field_type").on("change", function() {
70 70
         id = $(this).val();
71 71
         switch(id) {
72 72
             case "1":
73
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')) . '");
73
+                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')).'");
74 74
                 break;
75 75
             case "2":
76
-                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')) . '");
76
+                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')).'");
77 77
                 break;
78 78
             case "3":
79
-                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')) . '");
79
+                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')).'");
80 80
                 break;
81 81
             case "4":
82
-                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')) . '");
82
+                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')).'");
83 83
                 break;
84 84
             case "5":
85
-                $("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')) . '");
85
+                $("#example").html("' . addslashes(Display::return_icon('userfield_multidropdown.png')).'");
86 86
                 break;
87 87
             case "6":
88
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
88
+                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
89 89
                 break;
90 90
             case "7":
91
-                $("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')) . '");
91
+                $("#example").html("' . addslashes(Display::return_icon('userfield_date_time.png')).'");
92 92
                 break;
93 93
             case "8":
94
-                $("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')) . '");
94
+                $("#example").html("' . addslashes(Display::return_icon('userfield_doubleselect.png')).'");
95 95
                 break;
96 96
             case "9":
97
-                $("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')) . '");
97
+                $("#example").html("' . addslashes(Display::return_icon('userfield_divider.png')).'");
98 98
                 break;
99 99
             case "10":
100
-                $("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')) . '");
100
+                $("#example").html("' . addslashes(Display::return_icon('userfield_user_tag.png')).'");
101 101
                 break;
102 102
             case "11":
103
-                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')) . '");
103
+                $("#example").html("' . addslashes(Display::return_icon('userfield_data.png')).'");
104 104
                 break;
105 105
         }
106 106
     });
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         ) {
120 120
             api_not_allowed();
121 121
         }
122
-        $url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']);
122
+        $url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']);
123 123
         $form = $obj->return_form($url, 'add');
124 124
 
125 125
         // The validation or display
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
             $obj->display();
136 136
         } else {
137 137
             echo '<div class="actions">';
138
-            echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
139
-            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
138
+            echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
139
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
140 140
             echo '</div>';
141 141
             $form->addElement('hidden', 'sec_token');
142 142
             $form->setConstants(array('sec_token' => $token));
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         break;
146 146
     case 'edit':
147 147
         // Action handling: Editing
148
-        $url = api_get_self() . '?type=' . $obj->type . '&action=' . Security::remove_XSS($_GET['action']) . '&id=' . intval($_GET['id']);
148
+        $url = api_get_self().'?type='.$obj->type.'&action='.Security::remove_XSS($_GET['action']).'&id='.intval($_GET['id']);
149 149
         $form = $obj->return_form($url, 'edit');
150 150
 
151 151
         // The validation or display
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
             $obj->display();
160 160
         } else {
161 161
             echo '<div class="actions">';
162
-            echo '<a href="' . api_get_self() . '?type=' . $obj->type . '">' .
163
-            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM) . '</a>';
162
+            echo '<a href="'.api_get_self().'?type='.$obj->type.'">'.
163
+            Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
164 164
             echo '</div>';
165 165
             $form->addElement('hidden', 'sec_token');
166 166
             $form->setConstants(array('sec_token' => $token));
Please login to merge, or discard this patch.