Completed
Push — 1.11.x ( ca7787...41c0f2 )
by José
31:51
created
main/inc/lib/events.lib.php 1 patch
Spacing   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -77,9 +77,7 @@  discard block
 block discarded – undo
77 77
         Database::query($sql);
78 78
 
79 79
         // Auto subscribe
80
-        $user_status = $userInfo['status']  == SESSIONADMIN ? 'sessionadmin' :
81
-            $userInfo['status'] == COURSEMANAGER ? 'teacher' :
82
-                $userInfo['status'] == DRH ? 'DRH' : 'student';
80
+        $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
83 81
         $autoSubscribe = api_get_setting($user_status.'_autosubscribe');
84 82
         if ($autoSubscribe) {
85 83
             $autoSubscribe = explode('|', $autoSubscribe);
@@ -336,7 +334,7 @@  discard block
 block discarded – undo
336 334
         global $debug;
337 335
 
338 336
         if ($debug) error_log('Called to update_event_exercice');
339
-        if ($debug) error_log('duration:' . $duration);
337
+        if ($debug) error_log('duration:'.$duration);
340 338
 
341 339
         if ($exeid != '') {
342 340
             /*
@@ -384,7 +382,7 @@  discard block
 block discarded – undo
384 382
         		   status = '".$status."',
385 383
         		   questions_to_check = '".$remind_list."',
386 384
         		   data_tracking = '".implode(',', $question_list)."',
387
-                   user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
385
+                   user_ip = '" . Database::escape_string(api_get_real_ip())."'
388 386
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
389 387
             $res = Database::query($sql);
390 388
 
@@ -1055,15 +1053,15 @@  discard block
 block discarded – undo
1055 1053
 
1056 1054
         if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
1057 1055
             $sql = "DELETE FROM $track_e_exercises
1058
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1056
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1059 1057
             Database::query($sql);
1060 1058
 
1061 1059
             $sql = "DELETE FROM $track_attempts
1062
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1060
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1063 1061
             Database::query($sql);
1064 1062
 
1065 1063
             $sql = "DELETE FROM $recording_table
1066
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1064
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1067 1065
             Database::query($sql);
1068 1066
         }
1069 1067
 
@@ -1105,7 +1103,7 @@  discard block
 block discarded – undo
1105 1103
             Event::addEvent(
1106 1104
                 LOG_EXERCISE_RESULT_DELETE,
1107 1105
                 LOG_EXERCISE_AND_USER_ID,
1108
-                $exercise_id . '-' . $user_id,
1106
+                $exercise_id.'-'.$user_id,
1109 1107
                 null,
1110 1108
                 null,
1111 1109
                 $course_id,
@@ -1705,7 +1703,7 @@  discard block
 block discarded – undo
1705 1703
         Event::addEvent(
1706 1704
             LOG_QUESTION_RESULT_DELETE,
1707 1705
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1708
-            $exe_id . '-' . $question_id,
1706
+            $exe_id.'-'.$question_id,
1709 1707
             null,
1710 1708
             null,
1711 1709
             $courseId,
@@ -1741,7 +1739,7 @@  discard block
 block discarded – undo
1741 1739
         Event::addEvent(
1742 1740
             LOG_QUESTION_RESULT_DELETE,
1743 1741
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1744
-            $exe_id . '-' . $question_id,
1742
+            $exe_id.'-'.$question_id,
1745 1743
             null,
1746 1744
             null,
1747 1745
             $courseId,
Please login to merge, or discard this patch.
main/admin/dashboard_add_users_to_user.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 
25 25
 // setting breadcrumbs
26 26
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
27
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
27
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
28 28
 
29 29
 // Database Table Definitions
30 30
 $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
@@ -44,17 +44,17 @@  discard block
 block discarded – undo
44 44
 $isAdmin = UserManager::is_admin($user_id);
45 45
 if ($isAdmin) {
46 46
     $userStatus = PLATFORM_ADMIN;
47
-    $tool_name= get_lang('AssignUsersToPlatformAdministrator');
47
+    $tool_name = get_lang('AssignUsersToPlatformAdministrator');
48 48
 } else if ($user_info['status'] == SESSIONADMIN) {
49
-    $tool_name= get_lang('AssignUsersToSessionsAdministrator');
50
-} else if  ($user_info['status'] == STUDENT_BOSS) {
51
-    $tool_name= get_lang('AssignUsersToBoss');
49
+    $tool_name = get_lang('AssignUsersToSessionsAdministrator');
50
+} else if ($user_info['status'] == STUDENT_BOSS) {
51
+    $tool_name = get_lang('AssignUsersToBoss');
52 52
 } else {
53
-    $tool_name= get_lang('AssignUsersToHumanResourcesManager');
53
+    $tool_name = get_lang('AssignUsersToHumanResourcesManager');
54 54
 }
55 55
 
56 56
 $add_type = 'multiple';
57
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
57
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
58 58
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
59 59
 }
60 60
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 function search_users($needle, $type)
66 66
 {
67
-    global $tbl_access_url_rel_user,  $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
67
+    global $tbl_access_url_rel_user, $tbl_user, $user_anonymous, $current_user_id, $user_id, $userStatus;
68 68
 
69 69
     $xajax_response = new xajaxResponse();
70 70
     $return = '';
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
                     LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
103 103
                     WHERE
104 104
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
105
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
105
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
106 106
                         user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
107 107
                         $without_assigned_users AND
108 108
                         access_url_id = ".api_get_current_access_url_id()."
@@ -114,13 +114,13 @@  discard block
 block discarded – undo
114 114
                     FROM $tbl_user user
115 115
                     WHERE
116 116
                         ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND
117
-                        status NOT IN(".DRH.", ".SESSIONADMIN.", " . STUDENT_BOSS . ") AND
117
+                        status NOT IN(".DRH.", ".SESSIONADMIN.", ".STUDENT_BOSS.") AND
118 118
                         user_id NOT IN ($user_anonymous, $current_user_id, $user_id)
119 119
                     $without_assigned_users
120 120
                     $order_clause
121 121
             ";
122 122
         }
123
-        $rs	= Database::query($sql);
123
+        $rs = Database::query($sql);
124 124
         $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
125 125
 
126 126
         if ($type == 'single') {
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
 
141 141
             switch ($userStatus) {
142 142
                 case DRH:
143
-                    $sql .= " user.status <> 6 AND user.status <> " . DRH;
143
+                    $sql .= " user.status <> 6 AND user.status <> ".DRH;
144 144
                     break;
145 145
                 case STUDENT_BOSS:
146
-                    $sql .= " user.status <> 6 AND user.status <> " . STUDENT_BOSS;
146
+                    $sql .= " user.status <> 6 AND user.status <> ".STUDENT_BOSS;
147 147
                     break;
148 148
             }
149 149
 
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
                     $return .= '...<br />';
161 161
                 }
162 162
             }
163
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
163
+           $xajax_response->addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return));
164 164
         } else {
165 165
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
166
-            while($user = Database :: fetch_array($rs)) {
166
+            while ($user = Database :: fetch_array($rs)) {
167 167
                 $person_name = api_get_person_name($user['firstname'], $user['lastname']);
168
-                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name,ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
168
+                $return .= '<option value="'.$user['user_id'].'" title="'.htmlspecialchars($person_name, ENT_QUOTES).'">'.$person_name.' ('.$user['username'].')</option>';
169 169
             }
170 170
             $return .= '</select>';
171 171
             $xajax_response->addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 }
243 243
 </script>';
244 244
 
245
-$formSent=0;
245
+$formSent = 0;
246 246
 $errorMsg = '';
247 247
 $UserList = array();
248 248
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 
258 258
 $searchForm = new FormValidator('search', 'get', api_get_self().'?user='.$user_id);
259 259
 $searchForm->addHeader(get_lang('AdvancedSearch'));
260
-$renderer =& $searchForm->defaultRenderer();
260
+$renderer = & $searchForm->defaultRenderer();
261 261
 
262 262
 $searchForm->addElement('hidden', 'user', $user_id);
263 263
 foreach ($filters as $param) {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             $affected_rows = 0;
300 300
     }
301 301
 
302
-    if ($affected_rows)	{
302
+    if ($affected_rows) {
303 303
         $msg = get_lang('AssignedUsersHaveBeenUpdatedSuccessfully');
304 304
     }
305 305
 }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 }
323 323
 
324 324
 $actionsRight = Display::url(
325
-    '<em class="fa fa-search"></em> ' . get_lang('AdvancedSearch'),
325
+    '<em class="fa fa-search"></em> '.get_lang('AdvancedSearch'),
326 326
     '#',
327 327
     array('class' => 'btn btn-default advanced_options', 'id' => 'advanced_search')
328 328
 );
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 $assigned_users_id = array_keys($assigned_users_to_hrm);
360 360
 $without_assigned_users = '';
361 361
 if (count($assigned_users_id) > 0) {
362
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
362
+	$without_assigned_users = " user.user_id NOT IN(".implode(',', $assigned_users_id).") AND ";
363 363
 }
364 364
 
365 365
 $search_user = '';
366 366
 if (!empty($firstLetterUser)) {
367 367
 	$needle = Database::escape_string($firstLetterUser);
368
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
368
+	$search_user = "AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
369 369
 }
370 370
 
371 371
 $sqlConditions = null;
@@ -406,12 +406,12 @@  discard block
 block discarded – undo
406 406
 			    $sqlConditions
407 407
             ORDER BY firstname ";
408 408
 }
409
-$result	= Database::query($sql);
409
+$result = Database::query($sql);
410 410
 ?>
411
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
411
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" class="form-horizontal" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
412 412
 <input type="hidden" name="formSent" value="1" />
413 413
 <?php
414
-if(!empty($msg)) {
414
+if (!empty($msg)) {
415 415
 	Display::display_normal_message($msg); //main API
416 416
 }
417 417
 ?>
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
                         <?php
428 428
                             while ($enreg = Database::fetch_array($result)) {
429 429
                                 $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']); ?>
430
-                                <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"';?>>
430
+                                <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
431 431
                                 <?php echo $person_name.' ('.$enreg['username'].')'; ?>
432 432
                                 </option>
433 433
                         <?php } ?>
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
     </div>
441 441
     <div class="col-md-4">
442 442
         <div class="code-course">
443
-            <?php if($add_type == 'multiple') { ?>
444
-                <p><?php echo get_lang('FirstLetterUser');?></p>
443
+            <?php if ($add_type == 'multiple') { ?>
444
+                <p><?php echo get_lang('FirstLetterUser'); ?></p>
445 445
                 <select class="selectpicker show-tick form-control" name="firstLetterUser" onchange = "xajax_search_users(this.value,'multiple')">
446 446
                     <option value="%">--</option>
447 447
                     <?php echo Display::get_alphabet_options($firstLetterUser); ?>
@@ -492,10 +492,10 @@  discard block
 block discarded – undo
492 492
                 <select id='destination' class="form-control" name="UsersList[]" multiple="multiple" size="15" >
493 493
                     <?php
494 494
                     if (is_array($assigned_users_to_hrm)) {
495
-                        foreach($assigned_users_to_hrm as $enreg) {
495
+                        foreach ($assigned_users_to_hrm as $enreg) {
496 496
                             $person_name = api_get_person_name($enreg['firstname'], $enreg['lastname']);
497 497
                     ?>
498
-                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name,ENT_QUOTES).'"'; ?>>
498
+                            <option value="<?php echo $enreg['user_id']; ?>" <?php echo 'title="'.htmlspecialchars($person_name, ENT_QUOTES).'"'; ?>>
499 499
                             <?php echo $person_name.' ('.$enreg['username'].')'; ?>
500 500
                             </option>
501 501
                         <?php }
Please login to merge, or discard this patch.
main/admin/dashboard_add_sessions_to_user.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 }
47 47
 
48 48
 $add_type = 'multiple';
49
-if (isset($_GET['add_type']) && $_GET['add_type']!='') {
49
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
50 50
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
51 51
 }
52 52
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
             $sql = "SELECT s.id, s.name FROM $tbl_session s
83 83
                     WHERE  s.name LIKE '$needle%' $without_assigned_sessions ";
84 84
         }
85
-        $rs	= Database::query($sql);
85
+        $rs = Database::query($sql);
86 86
         $return .= '<select class="form-control" id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20">';
87
-        while($session = Database :: fetch_array($rs)) {
88
-            $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'],ENT_QUOTES).'">'.$session['name'].'</option>';
87
+        while ($session = Database :: fetch_array($rs)) {
88
+            $return .= '<option value="'.$session['id'].'" title="'.htmlspecialchars($session['name'], ENT_QUOTES).'">'.$session['name'].'</option>';
89 89
         }
90 90
         $return .= '</select>';
91
-        $xajax_response->addAssign('ajax_list_sessions_multiple','innerHTML',api_utf8_encode($return));
91
+        $xajax_response->addAssign('ajax_list_sessions_multiple', 'innerHTML', api_utf8_encode($return));
92 92
     }
93 93
 
94 94
     return $xajax_response;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 }
148 148
 </script>';
149 149
 
150
-$formSent=0;
150
+$formSent = 0;
151 151
 $firstLetterSession = isset($_POST['firstLetterSession']) ? $_POST['firstLetterSession'] : null;
152 152
 $errorMsg = '';
153 153
 $UserList = array();
@@ -171,10 +171,10 @@  discard block
 block discarded – undo
171 171
 
172 172
 // Actions
173 173
 if ($user_info['status'] != SESSIONADMIN) {
174
-    $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">' .
175
-        Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM ) . '</a>';
176
-    $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">' .
177
-        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM) . '</a>';
174
+    $actionsLeft = '<a href="dashboard_add_users_to_user.php?user='.$user_id.'">'.
175
+        Display::return_icon('add-user.png', get_lang('AssignUsers'), null, ICON_SIZE_MEDIUM).'</a>';
176
+    $actionsLeft .= '<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.
177
+        Display::return_icon('course-add.png', get_lang('AssignCourses'), null, ICON_SIZE_MEDIUM).'</a>';
178 178
 }
179 179
 
180 180
 echo Display::toolbarAction('toolbar-dashboard', array($actionsLeft));
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 $without_assigned_sessions = '';
191 191
 if (count($assigned_sessions_id) > 0) {
192
-    $without_assigned_sessions = " AND s.id NOT IN (".implode(',',$assigned_sessions_id).") ";
192
+    $without_assigned_sessions = " AND s.id NOT IN (".implode(',', $assigned_sessions_id).") ";
193 193
 }
194 194
 
195 195
 $needle = '%';
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
 		    WHERE  s.name LIKE '$needle%' $without_assigned_sessions
211 211
             ORDER BY s.name";
212 212
 }
213
-$result	= Database::query($sql);
213
+$result = Database::query($sql);
214 214
 ?>
215
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){ echo ' onsubmit="valide();"';}?>>
215
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; }?>>
216 216
     <input type="hidden" name="formSent" value="1" />
217 217
 
218 218
     <div class="row">
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                     <?php
224 224
                     while ($enreg = Database::fetch_array($result)) {
225 225
                     ?>
226
-                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"';?>>
226
+                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
227 227
                             <?php echo $enreg['name']; ?>
228 228
                         </option>
229 229
                     <?php } ?>
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         <div class="col-md-4">
234 234
             <div class="code-course">
235 235
                 <?php if ($add_type == 'multiple') { ?>
236
-                <p><?php echo get_lang('FirstLetterSession');?> :</p>
236
+                <p><?php echo get_lang('FirstLetterSession'); ?> :</p>
237 237
                 <select class="selectpicker form-control" name="firstLetterSession" onchange = "xajax_search_sessions(this.value, 'multiple')">
238 238
                     <option value="%">--</option>
239 239
                         <?php  echo Display :: get_alphabet_options($firstLetterSession); ?>
@@ -282,9 +282,9 @@  discard block
 block discarded – undo
282 282
              <select id='destination' name="SessionsList[]" multiple="multiple" size="20" style="width:320px;">
283 283
                 <?php
284 284
                 if (is_array($assigned_sessions_to_hrm)) {
285
-                    foreach($assigned_sessions_to_hrm as $enreg) {
285
+                    foreach ($assigned_sessions_to_hrm as $enreg) {
286 286
                         ?>
287
-                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'],ENT_QUOTES).'"'; ?>>
287
+                        <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; ?>>
288 288
                             <?php echo $enreg['name'] ?>
289 289
                         </option>
290 290
                 <?php }
Please login to merge, or discard this patch.
main/gradebook/gradebook_edit_link.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 }
25 25
 
26 26
 $linkcat  = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
27
-$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']):'';
27
+$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']) : '';
28 28
 $course_code = api_get_course_id();
29 29
 $session_id = api_get_session_id();
30 30
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     null,
49 49
     $link,
50 50
     'edit_link_form',
51
-    api_get_self() . '?selectcat=' . $linkcat. '&editlink=' . $linkedit.'&'.api_get_cidreq()
51
+    api_get_self().'?selectcat='.$linkcat.'&editlink='.$linkedit.'&'.api_get_cidreq()
52 52
 );
53 53
 if ($form->validate()) {
54 54
     $values = $form->exportValues();
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     //Update weight for attendance
66 66
     $sql = 'SELECT ref_id FROM '.$tbl_grade_links.'
67 67
             WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE;
68
-    $rs_attendance  = Database::query($sql);
68
+    $rs_attendance = Database::query($sql);
69 69
     if (Database::num_rows($rs_attendance) > 0) {
70 70
         $row_attendance = Database::fetch_array($rs_attendance);
71 71
         $attendance_id  = $row_attendance['ref_id'];
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             'type' => LINK_STUDENTPUBLICATION
102 102
         ]);
103 103
 
104
-    header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id().'&'.api_get_cidreq());
104
+    header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat='.$link->get_category_id().'&'.api_get_cidreq());
105 105
     exit;
106 106
 }
107 107
 
Please login to merge, or discard this patch.
main/admin/settings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
     Display::addFlash(Display::return_message(get_lang('FileDeleted')));
60 60
 }
61 61
 
62
-if (isset($_GET['action']) &&  $_GET['action'] == 'delete_grading') {
62
+if (isset($_GET['action']) && $_GET['action'] == 'delete_grading') {
63 63
     $id = intval($_GET['id']);
64 64
     api_delete_setting_option($id);
65 65
 }
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
         // Set true for allow_message_tool variable if social tool is actived
227 227
         foreach ($convert_byte_to_mega_list as $item) {
228 228
             if (isset($values[$item])) {
229
-                $values[$item] = round($values[$item]*1024*1024);
229
+                $values[$item] = round($values[$item] * 1024 * 1024);
230 230
             }
231 231
         }
232 232
 
Please login to merge, or discard this patch.
main/mySpace/student.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     );
32 32
 }
33 33
 
34
-if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") {
34
+if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") {
35 35
     $interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors'));
36 36
 }
37 37
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             $detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$sessionId.'">
168 168
 				            '.Display::return_icon('2rightarrow.png').'</a>';
169 169
         } else {
170
-            $detailsLink =  '<a href="myStudents.php?student='.$student_id.'">
170
+            $detailsLink = '<a href="myStudents.php?student='.$student_id.'">
171 171
 				             '.Display::return_icon('2rightarrow.png').'</a>';
172 172
         }
173 173
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
     );
240 240
     $actionsLeft .= Display::url(
241 241
         Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM),
242
-        api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php"
242
+        api_get_path(WEB_CODE_PATH)."mySpace/company_reports.php"
243 243
     );
244 244
     $actionsLeft .= Display::url(
245 245
         Display::return_icon(
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
             [],
249 249
             ICON_SIZE_MEDIUM
250 250
         ),
251
-        api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php"
251
+        api_get_path(WEB_CODE_PATH)."gradebook/certificate_report.php"
252 252
     );
253 253
 }
254 254
 
Please login to merge, or discard this patch.
main/session/session_category_edit.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 	exit();
34 34
 }
35 35
 
36
-list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']);
37
-list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']);
36
+list($year_start, $month_start, $day_start) = explode('-', $infos['date_start']);
37
+list($year_end, $month_end, $day_end) = explode('-', $infos['date_end']);
38 38
 
39
-if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) {
39
+if (!api_is_platform_admin() && $infos['session_admin_id'] != $_user['user_id'] && !api_is_session_admin()) {
40 40
 	api_not_allowed(true);
41 41
 }
42 42
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
 // display the header
74 74
 Display::display_header($tool_name);
75 75
 if (!empty($return)) {
76
-	Display::display_error_message($return,false);
76
+	Display::display_error_message($return, false);
77 77
 }
78 78
 ?>
79 79
 <div class="row">
80 80
     <div class="col-md-12">
81 81
         <form method="post" name="form" action="<?php echo api_get_self(); ?>?id=<?php echo $id; ?>" class="form-horizontal">
82 82
         <input type="hidden" name="formSent" value="1">
83
-        <legend><?php echo $tool_name;?> </legend>
83
+        <legend><?php echo $tool_name; ?> </legend>
84 84
         <div class="form-group">
85 85
             <label class="col-sm-3 control-label"><?php echo get_lang('SessionName') ?></label>
86 86
             <div class="col-sm-6">
87
-                <input class="form-control" type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); else echo api_htmlentities($infos['name'],ENT_QUOTES,$charset); ?>">
87
+                <input class="form-control" type="text" name="name" size="50" maxlength="50" value="<?php if ($formSent) echo api_htmlentities($name, ENT_QUOTES, $charset); else echo api_htmlentities($infos['name'], ENT_QUOTES, $charset); ?>">
88 88
             </div>
89 89
             <div class="col-sm-3"></div>
90 90
         </div>
91 91
         <div class="form-group">
92 92
             <div class="col-sm-offset-3 col-sm-6">
93
-                <?php echo get_lang('TheTimeLimitsAreReferential');?>
93
+                <?php echo get_lang('TheTimeLimitsAreReferential'); ?>
94 94
                 <a href="javascript://" onclick="if(document.getElementById('options').style.display == 'none'){document.getElementById('options').style.display = 'block';}else{document.getElementById('options').style.display = 'none';}"><?php echo get_lang('EditTimeLimit') ?></a>
95 95
             </div>
96 96
         </div>
@@ -100,58 +100,58 @@  discard block
 block discarded – undo
100 100
                 <div class="col-sm-6">
101 101
                     <select name="day_start">
102 102
                         <option value="1">01</option>
103
-                        <option value="2" <?php if($day_start == 2) echo 'selected="selected"'; ?> >02</option>
104
-                        <option value="3" <?php if($day_start == 3) echo 'selected="selected"'; ?> >03</option>
105
-                        <option value="4" <?php if($day_start == 4) echo 'selected="selected"'; ?> >04</option>
106
-                        <option value="5" <?php if($day_start == 5) echo 'selected="selected"'; ?> >05</option>
107
-                        <option value="6" <?php if($day_start == 6) echo 'selected="selected"'; ?> >06</option>
108
-                        <option value="7" <?php if($day_start == 7) echo 'selected="selected"'; ?> >07</option>
109
-                        <option value="8" <?php if($day_start == 8) echo 'selected="selected"'; ?> >08</option>
110
-                        <option value="9" <?php if($day_start == 9) echo 'selected="selected"'; ?> >09</option>
111
-                        <option value="10" <?php if($day_start == 10) echo 'selected="selected"'; ?> >10</option>
112
-                        <option value="11" <?php if($day_start == 11) echo 'selected="selected"'; ?> >11</option>
113
-                        <option value="12" <?php if($day_start == 12) echo 'selected="selected"'; ?> >12</option>
114
-                        <option value="13" <?php if($day_start == 13) echo 'selected="selected"'; ?> >13</option>
115
-                        <option value="14" <?php if($day_start == 14) echo 'selected="selected"'; ?> >14</option>
116
-                        <option value="15" <?php if($day_start == 15) echo 'selected="selected"'; ?> >15</option>
117
-                        <option value="16" <?php if($day_start == 16) echo 'selected="selected"'; ?> >16</option>
118
-                        <option value="17" <?php if($day_start == 17) echo 'selected="selected"'; ?> >17</option>
119
-                        <option value="18" <?php if($day_start == 18) echo 'selected="selected"'; ?> >18</option>
120
-                        <option value="19" <?php if($day_start == 19) echo 'selected="selected"'; ?> >19</option>
121
-                        <option value="20" <?php if($day_start == 20) echo 'selected="selected"'; ?> >20</option>
122
-                        <option value="21" <?php if($day_start == 21) echo 'selected="selected"'; ?> >21</option>
123
-                        <option value="22" <?php if($day_start == 22) echo 'selected="selected"'; ?> >22</option>
124
-                        <option value="23" <?php if($day_start == 23) echo 'selected="selected"'; ?> >23</option>
125
-                        <option value="24" <?php if($day_start == 24) echo 'selected="selected"'; ?> >24</option>
126
-                        <option value="25" <?php if($day_start == 25) echo 'selected="selected"'; ?> >25</option>
127
-                        <option value="26" <?php if($day_start == 26) echo 'selected="selected"'; ?> >26</option>
128
-                        <option value="27" <?php if($day_start == 27) echo 'selected="selected"'; ?> >27</option>
129
-                        <option value="28" <?php if($day_start == 28) echo 'selected="selected"'; ?> >28</option>
130
-                        <option value="29" <?php if($day_start == 29) echo 'selected="selected"'; ?> >29</option>
131
-                        <option value="30" <?php if($day_start == 30) echo 'selected="selected"'; ?> >30</option>
132
-                        <option value="31" <?php if($day_start == 31) echo 'selected="selected"'; ?> >31</option>
103
+                        <option value="2" <?php if ($day_start == 2) echo 'selected="selected"'; ?> >02</option>
104
+                        <option value="3" <?php if ($day_start == 3) echo 'selected="selected"'; ?> >03</option>
105
+                        <option value="4" <?php if ($day_start == 4) echo 'selected="selected"'; ?> >04</option>
106
+                        <option value="5" <?php if ($day_start == 5) echo 'selected="selected"'; ?> >05</option>
107
+                        <option value="6" <?php if ($day_start == 6) echo 'selected="selected"'; ?> >06</option>
108
+                        <option value="7" <?php if ($day_start == 7) echo 'selected="selected"'; ?> >07</option>
109
+                        <option value="8" <?php if ($day_start == 8) echo 'selected="selected"'; ?> >08</option>
110
+                        <option value="9" <?php if ($day_start == 9) echo 'selected="selected"'; ?> >09</option>
111
+                        <option value="10" <?php if ($day_start == 10) echo 'selected="selected"'; ?> >10</option>
112
+                        <option value="11" <?php if ($day_start == 11) echo 'selected="selected"'; ?> >11</option>
113
+                        <option value="12" <?php if ($day_start == 12) echo 'selected="selected"'; ?> >12</option>
114
+                        <option value="13" <?php if ($day_start == 13) echo 'selected="selected"'; ?> >13</option>
115
+                        <option value="14" <?php if ($day_start == 14) echo 'selected="selected"'; ?> >14</option>
116
+                        <option value="15" <?php if ($day_start == 15) echo 'selected="selected"'; ?> >15</option>
117
+                        <option value="16" <?php if ($day_start == 16) echo 'selected="selected"'; ?> >16</option>
118
+                        <option value="17" <?php if ($day_start == 17) echo 'selected="selected"'; ?> >17</option>
119
+                        <option value="18" <?php if ($day_start == 18) echo 'selected="selected"'; ?> >18</option>
120
+                        <option value="19" <?php if ($day_start == 19) echo 'selected="selected"'; ?> >19</option>
121
+                        <option value="20" <?php if ($day_start == 20) echo 'selected="selected"'; ?> >20</option>
122
+                        <option value="21" <?php if ($day_start == 21) echo 'selected="selected"'; ?> >21</option>
123
+                        <option value="22" <?php if ($day_start == 22) echo 'selected="selected"'; ?> >22</option>
124
+                        <option value="23" <?php if ($day_start == 23) echo 'selected="selected"'; ?> >23</option>
125
+                        <option value="24" <?php if ($day_start == 24) echo 'selected="selected"'; ?> >24</option>
126
+                        <option value="25" <?php if ($day_start == 25) echo 'selected="selected"'; ?> >25</option>
127
+                        <option value="26" <?php if ($day_start == 26) echo 'selected="selected"'; ?> >26</option>
128
+                        <option value="27" <?php if ($day_start == 27) echo 'selected="selected"'; ?> >27</option>
129
+                        <option value="28" <?php if ($day_start == 28) echo 'selected="selected"'; ?> >28</option>
130
+                        <option value="29" <?php if ($day_start == 29) echo 'selected="selected"'; ?> >29</option>
131
+                        <option value="30" <?php if ($day_start == 30) echo 'selected="selected"'; ?> >30</option>
132
+                        <option value="31" <?php if ($day_start == 31) echo 'selected="selected"'; ?> >31</option>
133 133
                   </select>
134 134
                   /
135 135
                   <select name="month_start">
136 136
                         <option value="1">01</option>
137
-                        <option value="2" <?php if($month_start == 2) echo 'selected="selected"'; ?> >02</option>
138
-                        <option value="3" <?php if($month_start == 3) echo 'selected="selected"'; ?> >03</option>
139
-                        <option value="4" <?php if($month_start == 4) echo 'selected="selected"'; ?> >04</option>
140
-                        <option value="5" <?php if($month_start == 5) echo 'selected="selected"'; ?> >05</option>
141
-                        <option value="6" <?php if($month_start == 6) echo 'selected="selected"'; ?> >06</option>
142
-                        <option value="7" <?php if($month_start == 7) echo 'selected="selected"'; ?> >07</option>
143
-                        <option value="8" <?php if($month_start == 8) echo 'selected="selected"'; ?> >08</option>
144
-                        <option value="9" <?php if($month_start == 9) echo 'selected="selected"'; ?> >09</option>
145
-                        <option value="10" <?php if($month_start == 10) echo 'selected="selected"'; ?> >10</option>
146
-                        <option value="11" <?php if($month_start == 11) echo 'selected="selected"'; ?> >11</option>
147
-                        <option value="12" <?php if($month_start == 12) echo 'selected="selected"'; ?> >12</option>
137
+                        <option value="2" <?php if ($month_start == 2) echo 'selected="selected"'; ?> >02</option>
138
+                        <option value="3" <?php if ($month_start == 3) echo 'selected="selected"'; ?> >03</option>
139
+                        <option value="4" <?php if ($month_start == 4) echo 'selected="selected"'; ?> >04</option>
140
+                        <option value="5" <?php if ($month_start == 5) echo 'selected="selected"'; ?> >05</option>
141
+                        <option value="6" <?php if ($month_start == 6) echo 'selected="selected"'; ?> >06</option>
142
+                        <option value="7" <?php if ($month_start == 7) echo 'selected="selected"'; ?> >07</option>
143
+                        <option value="8" <?php if ($month_start == 8) echo 'selected="selected"'; ?> >08</option>
144
+                        <option value="9" <?php if ($month_start == 9) echo 'selected="selected"'; ?> >09</option>
145
+                        <option value="10" <?php if ($month_start == 10) echo 'selected="selected"'; ?> >10</option>
146
+                        <option value="11" <?php if ($month_start == 11) echo 'selected="selected"'; ?> >11</option>
147
+                        <option value="12" <?php if ($month_start == 12) echo 'selected="selected"'; ?> >12</option>
148 148
                   </select>
149 149
                   /
150 150
                 <select name="year_start">
151 151
                         <?php
152
-                        for($i=$thisYear-5;$i <= ($thisYear+5);$i++)
152
+                        for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++)
153 153
                         { ?>
154
-                                <option value="<?php echo $i; ?>" <?php if($year_start == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
154
+                                <option value="<?php echo $i; ?>" <?php if ($year_start == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
155 155
                         <?php
156 156
                         } ?>
157 157
                 </select>
@@ -163,61 +163,61 @@  discard block
 block discarded – undo
163 163
                 <div class="col-sm-6">
164 164
                     <select name="day_end">
165 165
                         <option value="0">--</option>
166
-                        <option value="1" <?php if($day_end == 1) echo 'selected="selected"'; ?> >01</option>
167
-                        <option value="2" <?php if($day_end == 2) echo 'selected="selected"'; ?> >02</option>
168
-                        <option value="3" <?php if($day_end == 3) echo 'selected="selected"'; ?> >03</option>
169
-                        <option value="4" <?php if($day_end == 4) echo 'selected="selected"'; ?> >04</option>
170
-                        <option value="5" <?php if($day_end == 5) echo 'selected="selected"'; ?> >05</option>
171
-                        <option value="6" <?php if($day_end == 6) echo 'selected="selected"'; ?> >06</option>
172
-                        <option value="7" <?php if($day_end == 7) echo 'selected="selected"'; ?> >07</option>
173
-                        <option value="8" <?php if($day_end == 8) echo 'selected="selected"'; ?> >08</option>
174
-                        <option value="9" <?php if($day_end == 9) echo 'selected="selected"'; ?> >09</option>
175
-                        <option value="10" <?php if($day_end == 10) echo 'selected="selected"'; ?> >10</option>
176
-                        <option value="11" <?php if($day_end == 11) echo 'selected="selected"'; ?> >11</option>
177
-                        <option value="12" <?php if($day_end == 12) echo 'selected="selected"'; ?> >12</option>
178
-                        <option value="13" <?php if($day_end == 13) echo 'selected="selected"'; ?> >13</option>
179
-                        <option value="14" <?php if($day_end == 14) echo 'selected="selected"'; ?> >14</option>
180
-                        <option value="15" <?php if($day_end == 15) echo 'selected="selected"'; ?> >15</option>
181
-                        <option value="16" <?php if($day_end == 16) echo 'selected="selected"'; ?> >16</option>
182
-                        <option value="17" <?php if($day_end == 17) echo 'selected="selected"'; ?> >17</option>
183
-                        <option value="18" <?php if($day_end == 18) echo 'selected="selected"'; ?> >18</option>
184
-                        <option value="19" <?php if($day_end == 19) echo 'selected="selected"'; ?> >19</option>
185
-                        <option value="20" <?php if($day_end == 20) echo 'selected="selected"'; ?> >20</option>
186
-                        <option value="21" <?php if($day_end == 21) echo 'selected="selected"'; ?> >21</option>
187
-                        <option value="22" <?php if($day_end == 22) echo 'selected="selected"'; ?> >22</option>
188
-                        <option value="23" <?php if($day_end == 23) echo 'selected="selected"'; ?> >23</option>
189
-                        <option value="24" <?php if($day_end == 24) echo 'selected="selected"'; ?> >24</option>
190
-                        <option value="25" <?php if($day_end == 25) echo 'selected="selected"'; ?> >25</option>
191
-                        <option value="26" <?php if($day_end == 26) echo 'selected="selected"'; ?> >26</option>
192
-                        <option value="27" <?php if($day_end == 27) echo 'selected="selected"'; ?> >27</option>
193
-                        <option value="28" <?php if($day_end == 28) echo 'selected="selected"'; ?> >28</option>
194
-                        <option value="29" <?php if($day_end == 29) echo 'selected="selected"'; ?> >29</option>
195
-                        <option value="30" <?php if($day_end == 30) echo 'selected="selected"'; ?> >30</option>
196
-                        <option value="31" <?php if($day_end == 31) echo 'selected="selected"'; ?> >31</option>
166
+                        <option value="1" <?php if ($day_end == 1) echo 'selected="selected"'; ?> >01</option>
167
+                        <option value="2" <?php if ($day_end == 2) echo 'selected="selected"'; ?> >02</option>
168
+                        <option value="3" <?php if ($day_end == 3) echo 'selected="selected"'; ?> >03</option>
169
+                        <option value="4" <?php if ($day_end == 4) echo 'selected="selected"'; ?> >04</option>
170
+                        <option value="5" <?php if ($day_end == 5) echo 'selected="selected"'; ?> >05</option>
171
+                        <option value="6" <?php if ($day_end == 6) echo 'selected="selected"'; ?> >06</option>
172
+                        <option value="7" <?php if ($day_end == 7) echo 'selected="selected"'; ?> >07</option>
173
+                        <option value="8" <?php if ($day_end == 8) echo 'selected="selected"'; ?> >08</option>
174
+                        <option value="9" <?php if ($day_end == 9) echo 'selected="selected"'; ?> >09</option>
175
+                        <option value="10" <?php if ($day_end == 10) echo 'selected="selected"'; ?> >10</option>
176
+                        <option value="11" <?php if ($day_end == 11) echo 'selected="selected"'; ?> >11</option>
177
+                        <option value="12" <?php if ($day_end == 12) echo 'selected="selected"'; ?> >12</option>
178
+                        <option value="13" <?php if ($day_end == 13) echo 'selected="selected"'; ?> >13</option>
179
+                        <option value="14" <?php if ($day_end == 14) echo 'selected="selected"'; ?> >14</option>
180
+                        <option value="15" <?php if ($day_end == 15) echo 'selected="selected"'; ?> >15</option>
181
+                        <option value="16" <?php if ($day_end == 16) echo 'selected="selected"'; ?> >16</option>
182
+                        <option value="17" <?php if ($day_end == 17) echo 'selected="selected"'; ?> >17</option>
183
+                        <option value="18" <?php if ($day_end == 18) echo 'selected="selected"'; ?> >18</option>
184
+                        <option value="19" <?php if ($day_end == 19) echo 'selected="selected"'; ?> >19</option>
185
+                        <option value="20" <?php if ($day_end == 20) echo 'selected="selected"'; ?> >20</option>
186
+                        <option value="21" <?php if ($day_end == 21) echo 'selected="selected"'; ?> >21</option>
187
+                        <option value="22" <?php if ($day_end == 22) echo 'selected="selected"'; ?> >22</option>
188
+                        <option value="23" <?php if ($day_end == 23) echo 'selected="selected"'; ?> >23</option>
189
+                        <option value="24" <?php if ($day_end == 24) echo 'selected="selected"'; ?> >24</option>
190
+                        <option value="25" <?php if ($day_end == 25) echo 'selected="selected"'; ?> >25</option>
191
+                        <option value="26" <?php if ($day_end == 26) echo 'selected="selected"'; ?> >26</option>
192
+                        <option value="27" <?php if ($day_end == 27) echo 'selected="selected"'; ?> >27</option>
193
+                        <option value="28" <?php if ($day_end == 28) echo 'selected="selected"'; ?> >28</option>
194
+                        <option value="29" <?php if ($day_end == 29) echo 'selected="selected"'; ?> >29</option>
195
+                        <option value="30" <?php if ($day_end == 30) echo 'selected="selected"'; ?> >30</option>
196
+                        <option value="31" <?php if ($day_end == 31) echo 'selected="selected"'; ?> >31</option>
197 197
                   </select>
198 198
                   /
199 199
                   <select name="month_end">
200 200
                         <option value="0">--</option>
201
-                        <option value="1" <?php if($month_end == 1) echo 'selected="selected"'; ?> >01</option>
202
-                        <option value="2" <?php if($month_end == 2) echo 'selected="selected"'; ?> >02</option>
203
-                        <option value="3" <?php if($month_end == 3) echo 'selected="selected"'; ?> >03</option>
204
-                        <option value="4" <?php if($month_end == 4) echo 'selected="selected"'; ?> >04</option>
205
-                        <option value="5" <?php if($month_end == 5) echo 'selected="selected"'; ?> >05</option>
206
-                        <option value="6" <?php if($month_end == 6) echo 'selected="selected"'; ?> >06</option>
207
-                        <option value="7" <?php if($month_end == 7) echo 'selected="selected"'; ?> >07</option>
208
-                        <option value="8" <?php if($month_end == 8) echo 'selected="selected"'; ?> >08</option>
209
-                        <option value="9" <?php if($month_end == 9) echo 'selected="selected"'; ?> >09</option>
210
-                        <option value="10" <?php if($month_end == 10) echo 'selected="selected"'; ?> >10</option>
211
-                        <option value="11" <?php if($month_end == 11) echo 'selected="selected"'; ?> >11</option>
212
-                        <option value="12" <?php if($month_end == 12) echo 'selected="selected"'; ?> >12</option>
201
+                        <option value="1" <?php if ($month_end == 1) echo 'selected="selected"'; ?> >01</option>
202
+                        <option value="2" <?php if ($month_end == 2) echo 'selected="selected"'; ?> >02</option>
203
+                        <option value="3" <?php if ($month_end == 3) echo 'selected="selected"'; ?> >03</option>
204
+                        <option value="4" <?php if ($month_end == 4) echo 'selected="selected"'; ?> >04</option>
205
+                        <option value="5" <?php if ($month_end == 5) echo 'selected="selected"'; ?> >05</option>
206
+                        <option value="6" <?php if ($month_end == 6) echo 'selected="selected"'; ?> >06</option>
207
+                        <option value="7" <?php if ($month_end == 7) echo 'selected="selected"'; ?> >07</option>
208
+                        <option value="8" <?php if ($month_end == 8) echo 'selected="selected"'; ?> >08</option>
209
+                        <option value="9" <?php if ($month_end == 9) echo 'selected="selected"'; ?> >09</option>
210
+                        <option value="10" <?php if ($month_end == 10) echo 'selected="selected"'; ?> >10</option>
211
+                        <option value="11" <?php if ($month_end == 11) echo 'selected="selected"'; ?> >11</option>
212
+                        <option value="12" <?php if ($month_end == 12) echo 'selected="selected"'; ?> >12</option>
213 213
                   </select>
214 214
                   /
215 215
                   <select name="year_end">
216 216
                         <option value="0">----</option>
217 217
                         <?php
218
-                        for($i=$thisYear-5;$i <= ($thisYear+5);$i++)
218
+                        for ($i = $thisYear - 5; $i <= ($thisYear + 5); $i++)
219 219
                         { ?>
220
-                         <option value="<?php echo $i; ?>" <?php if($year_end == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
220
+                         <option value="<?php echo $i; ?>" <?php if ($year_end == $i) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
221 221
                         <?php
222 222
                         } ?>
223 223
                  </select>
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
 
239 239
 
240 240
 <script>
241
-<?php if($year_start=="0000") echo "setDisable(document.form.nolimit);\r\n"; ?>
241
+<?php if ($year_start == "0000") echo "setDisable(document.form.nolimit);\r\n"; ?>
242 242
 function setDisable(select){
243 243
 	document.form.day_start.disabled = (select.checked) ? true : false;
244 244
 	document.form.month_start.disabled = (select.checked) ? true : false;
Please login to merge, or discard this patch.
main/user/add_users_to_session.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -22,9 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 // setting breadcrumbs
24 24
 if (api_is_platform_admin()) {
25
-    $interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
26
-    $interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
27
-    $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
25
+    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
26
+    $interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
27
+    $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview'));
28 28
 }
29 29
 $allowTutors = api_get_setting('allow_tutors_to_assign_students_to_session');
30 30
 $extra_field_list = [];
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $tool_name = get_lang('SubscribeUsersToSession');
40 40
     $add_type = 'unique';
41 41
 
42
-    if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
42
+    if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
43 43
         $add_type = Security::remove_XSS($_REQUEST['add_type']);
44 44
     }
45 45
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     if (is_array($extra_field_list)) {
52 52
     	foreach ($extra_field_list as $extra_field) {
53 53
     		//if is enabled to filter and is a "<select>" field type
54
-    		if ($extra_field[8]==1 && $extra_field[2]==4 ) {
54
+    		if ($extra_field[8] == 1 && $extra_field[2] == 4) {
55 55
                 $new_field_list[] = array(
56 56
                     'name' => $extra_field[3],
57 57
                     'variable' => $extra_field[1],
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     	if (!empty($needle) && !empty($type)) {
75 75
 
76 76
             //normal behaviour
77
-            if ($type == 'any_session' && $needle == 'false')  {
77
+            if ($type == 'any_session' && $needle == 'false') {
78 78
                 $type = 'multiple';
79 79
                 $needle = '';
80 80
             }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     		$cond_user_id = '';
89 89
 
90 90
             //Only for single & multiple
91
-            if (in_array($type, array('single','multiple'))) {
91
+            if (in_array($type, array('single', 'multiple'))) {
92 92
         		if (!empty($id_session)) {
93 93
         		    $id_session = intval($id_session);
94 94
         			// check id_user from session_rel_user table
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
         			$user_ids = array();
99 99
         			if (Database::num_rows($res) > 0) {
100 100
         				while ($row = Database::fetch_row($res)) {
101
-        					$user_ids[] = (int)$row[0];
101
+        					$user_ids[] = (int) $row[0];
102 102
         				}
103 103
         			}
104 104
         			if (count($user_ids) > 0) {
105
-        				$cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')';
105
+        				$cond_user_id = ' AND user.user_id NOT IN('.implode(",", $user_ids).')';
106 106
         			}
107 107
         		}
108 108
             }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     break;
139 139
     		}
140 140
     		if (api_is_multiple_url_enabled()) {
141
-    			$tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
141
+    			$tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
142 142
     			$access_url_id = api_get_current_access_url_id();
143 143
     			if ($access_url_id != -1) {
144 144
                     switch ($type) {
@@ -183,11 +183,11 @@  discard block
 block discarded – undo
183 183
     		}
184 184
 
185 185
     		$rs = Database::query($sql);
186
-            $i=0;
186
+            $i = 0;
187 187
     		if ($type == 'single') {
188 188
     			while ($user = Database::fetch_array($rs)) {
189 189
     	            $i++;
190
-    	            if ($i<=10) {
190
+    	            if ($i <= 10) {
191 191
                 		$person_name = api_get_person_name($user['firstname'], $user['lastname']);
192 192
     					$return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' ('.$user['username'].')'.'\')">'.$person_name.' ('.$user['username'].')</a><br />';
193 193
     	            } else {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
     	            }
196 196
     			}
197 197
 
198
-    			$xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
198
+    			$xajax_response -> addAssign('ajax_list_users_single', 'innerHTML', api_utf8_encode($return));
199 199
     		} else {
200 200
     			$return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">';
201 201
     			while ($user = Database :: fetch_array($rs)) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     	            $return .= '<option value="'.$user['user_id'].'">'.$person_name.' ('.$user['username'].')</option>';
204 204
     			}
205 205
     			$return .= '</select>';
206
-    			$xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
206
+    			$xajax_response -> addAssign('ajax_list_users_multiple', 'innerHTML', api_utf8_encode($return));
207 207
     		}
208 208
     	}
209 209
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     </script>';
261 261
 
262 262
     $form_sent = 0;
263
-    $firstLetterUser = $firstLetterSession='';
263
+    $firstLetterUser = $firstLetterSession = '';
264 264
     $UserList = $SessionList = array();
265 265
     $sessions = array();
266 266
     $noPHP_SELF = true;
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         $UserList = $_POST['sessionUsersList'];
273 273
 
274 274
         if (!is_array($UserList)) {
275
-            $UserList=array();
275
+            $UserList = array();
276 276
         }
277 277
 
278 278
         if ($form_sent == 1) {
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
                 WHERE u.status <> ".DRH." AND u.status<>6 $order_clause";
303 303
 
304 304
         if (api_is_multiple_url_enabled()) {
305
-            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
305
+            $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
306 306
             $access_url_id = api_get_current_access_url_id();
307 307
             if ($access_url_id != -1) {
308 308
                 $sql = "SELECT u.user_id, lastname, firstname, username, session_id
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
         $result = Database::query($sql);
322 322
         $users = Database::store_result($result);
323 323
         foreach ($users as $user) {
324
-            $sessionUsersList[$user['user_id']] = $user ;
324
+            $sessionUsersList[$user['user_id']] = $user;
325 325
         }
326 326
         unset($users); //clean to free memory
327 327
     } else {
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 foreach ($new_field_list as $new_field) {
334 334
                     $varname = 'field_'.$new_field['variable'];
335 335
                     if (UserManager::is_extra_field_available($new_field['variable'])) {
336
-                        if (isset($_POST[$varname]) && $_POST[$varname]!='0') {
336
+                        if (isset($_POST[$varname]) && $_POST[$varname] != '0') {
337 337
                             $use_extra_fields = true;
338 338
                             $extra_field_result[] = UserManager::get_extra_user_data_by_value(
339 339
                                 $new_field['variable'],
@@ -347,9 +347,9 @@  discard block
 block discarded – undo
347 347
 
348 348
         if ($use_extra_fields) {
349 349
             $final_result = array();
350
-           	if (count($extra_field_result)>1) {
351
-    	    for($i=0;$i<count($extra_field_result)-1;$i++) {
352
-                    if (is_array($extra_field_result[$i+1])) {
350
+           	if (count($extra_field_result) > 1) {
351
+    	    for ($i = 0; $i < count($extra_field_result) - 1; $i++) {
352
+                    if (is_array($extra_field_result[$i + 1])) {
353 353
                         $final_result = array_intersect(
354 354
                             $extra_field_result[$i],
355 355
                             $extra_field_result[$i + 1]
@@ -360,17 +360,17 @@  discard block
 block discarded – undo
360 360
                 $final_result = $extra_field_result[0];
361 361
             }
362 362
 
363
-            $where_filter ='';
363
+            $where_filter = '';
364 364
             if (api_is_multiple_url_enabled()) {
365
-                if (is_array($final_result) && count($final_result)>0) {
366
-                    $where_filter = " AND u.user_id IN  ('".implode("','",$final_result)."') ";
365
+                if (is_array($final_result) && count($final_result) > 0) {
366
+                    $where_filter = " AND u.user_id IN  ('".implode("','", $final_result)."') ";
367 367
                 } else {
368 368
                     //no results
369 369
                     $where_filter = " AND u.user_id  = -1";
370 370
                 }
371 371
             } else {
372
-                if (is_array($final_result) && count($final_result)>0) {
373
-                    $where_filter = " WHERE u.user_id IN  ('".implode("','",$final_result)."') ";
372
+                if (is_array($final_result) && count($final_result) > 0) {
373
+                    $where_filter = " WHERE u.user_id IN  ('".implode("','", $final_result)."') ";
374 374
                 } else {
375 375
                     //no results
376 376
                     $where_filter = " WHERE u.user_id  = -1";
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                     $order_clause";
400 400
         }
401 401
         if (api_is_multiple_url_enabled()) {
402
-            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
402
+            $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
403 403
             $access_url_id = api_get_current_access_url_id();
404 404
             if ($access_url_id != -1) {
405 405
                 $sql = "SELECT  u.user_id, lastname, firstname, username, session_id
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
         }
417 417
 
418 418
         $result = Database::query($sql);
419
-        $users = Database::store_result($result,'ASSOC');
419
+        $users = Database::store_result($result, 'ASSOC');
420 420
 
421 421
         foreach ($users as $uid => $user) {
422 422
             if ($user['session_id'] != $id_session) {
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
                 WHERE u.status <> ".DRH." AND u.status<>6 $order_clause";
442 442
 
443 443
         if (api_is_multiple_url_enabled()) {
444
-            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
444
+            $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
445 445
             $access_url_id = api_get_current_access_url_id();
446 446
             if ($access_url_id != -1) {
447 447
                 $sql = "SELECT  u.user_id, lastname, firstname, username, session_id
@@ -457,11 +457,11 @@  discard block
 block discarded – undo
457 457
             }
458 458
         }
459 459
         $result = Database::query($sql);
460
-        $users = Database::store_result($result,'ASSOC');
460
+        $users = Database::store_result($result, 'ASSOC');
461 461
         foreach ($users as $uid => $user) {
462 462
             if ($user['session_id'] == $id_session) {
463 463
                 $sessionUsersList[$user['user_id']] = $user;
464
-                if (array_key_exists($user['user_id'],$nosessionUsersList)) {
464
+                if (array_key_exists($user['user_id'], $nosessionUsersList)) {
465 465
                     unset($nosessionUsersList[$user['user_id']]);
466 466
                 }
467 467
             }
@@ -483,20 +483,20 @@  discard block
 block discarded – undo
483 483
     <div class="actions">
484 484
     	<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>&nbsp;|&nbsp;<?php echo $link_add_group; ?>
485 485
     </div>
486
-    <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
487
-    <?php echo '<legend>'.$tool_name.' (' . $session->getName() . ') </legend>'; ?>
486
+    <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
487
+    <?php echo '<legend>'.$tool_name.' ('.$session->getName().') </legend>'; ?>
488 488
     <?php
489 489
     if ($add_type === 'multiple') {
490 490
     	if (is_array($extra_field_list)) {
491
-    		if (is_array($new_field_list) && count($new_field_list)>0 ) {
491
+    		if (is_array($new_field_list) && count($new_field_list) > 0) {
492 492
     			echo '<h3>'.get_lang('FilterUsers').'</h3>';
493 493
     			foreach ($new_field_list as $new_field) {
494 494
     				echo $new_field['name'];
495 495
     				$varname = 'field_'.$new_field['variable'];
496 496
     				echo '&nbsp;<select name="'.$varname.'">';
497 497
     				echo '<option value="0">--'.get_lang('Select').'--</option>';
498
-    				foreach	($new_field['data'] as $option) {
499
-    					$checked='';
498
+    				foreach ($new_field['data'] as $option) {
499
+    					$checked = '';
500 500
     					if (isset($_POST[$varname])) {
501 501
     						if ($_POST[$varname] == $option[1]) {
502 502
     							$checked = 'selected="true"';
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
                   <?php
545 545
                   foreach ($nosessionUsersList as $uid => $enreg) {
546 546
                   ?>
547
-                      <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option>
547
+                      <option value="<?php echo $uid; ?>" <?php if (in_array($uid, $UserList)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')'; ?></option>
548 548
                   <?php
549 549
                   }
550 550
                   ?>
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
             </div>
597 597
             <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" class="span5">
598 598
             <?php
599
-            foreach($sessionUsersList as $enreg) {
599
+            foreach ($sessionUsersList as $enreg) {
600 600
             ?>
601 601
                 <option value="<?php echo $enreg['user_id']; ?>"><?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].')'; ?></option>
602 602
             <?php
Please login to merge, or discard this patch.
main/inc/lib/nusoap/class.wsdl.php 1 patch
Spacing   +205 added lines, -207 removed lines patch added patch discarded remove patch
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 	var $proxypassword = '';
46 46
 	var $timeout = 0;
47 47
 	var $response_timeout = 30;
48
-	var $curl_options = array();	// User-specified cURL options
49
-	var $use_curl = false;			// whether to always try to use cURL
48
+	var $curl_options = array(); // User-specified cURL options
49
+	var $use_curl = false; // whether to always try to use cURL
50 50
 	// for HTTP authentication
51
-	var $username = '';				// Username for HTTP authentication
52
-	var $password = '';				// Password for HTTP authentication
53
-	var $authtype = '';				// Type of HTTP authentication
54
-	var $certRequest = array();		// Certificate for HTTP SSL authentication
51
+	var $username = ''; // Username for HTTP authentication
52
+	var $password = ''; // Password for HTTP authentication
53
+	var $authtype = ''; // Type of HTTP authentication
54
+	var $certRequest = array(); // Certificate for HTTP SSL authentication
55 55
 
56 56
     /**
57 57
      * constructor
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @param boolean $use_curl try to use cURL
68 68
      * @access public
69 69
      */
70
-    function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){
70
+    function __construct($wsdl = '', $proxyhost = false, $proxyport = false, $proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $curl_options = null, $use_curl = false) {
71 71
 		parent::__construct();
72 72
 		$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
73 73
         $this->proxyhost = $proxyhost;
@@ -103,19 +103,19 @@  discard block
 block discarded – undo
103 103
     		// Schema imports
104 104
     		foreach ($this->schemas as $ns => $list) {
105 105
     			foreach ($list as $xs) {
106
-					$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
106
+					$wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
107 107
 		            foreach ($xs->imports as $ns2 => $list2) {
108 108
 		                for ($ii = 0; $ii < count($list2); $ii++) {
109
-		                	if (! $list2[$ii]['loaded']) {
109
+		                	if (!$list2[$ii]['loaded']) {
110 110
 		                		$this->schemas[$ns]->imports[$ns2][$ii]['loaded'] = true;
111 111
 		                		$url = $list2[$ii]['location'];
112 112
 								if ($url != '') {
113 113
 									$urlparts = parse_url($url);
114 114
 									if (!isset($urlparts['host'])) {
115
-										$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' .$wsdlparts['port'] : '') .
116
-												substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
115
+										$url = $wsdlparts['scheme'].'://'.$wsdlparts['host'].(isset($wsdlparts['port']) ? ':'.$wsdlparts['port'] : '').
116
+												substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1).$urlparts['path'];
117 117
 									}
118
-									if (! in_array($url, $imported_urls)) {
118
+									if (!in_array($url, $imported_urls)) {
119 119
 					                	$this->parseWSDL($url);
120 120
 				                		$imported++;
121 121
 				                		$imported_urls[] = $url;
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
     			}
130 130
     		}
131 131
     		// WSDL imports
132
-			$wsdlparts = parse_url($this->wsdl);	// this is bogusly simple!
132
+			$wsdlparts = parse_url($this->wsdl); // this is bogusly simple!
133 133
             foreach ($this->import as $ns => $list) {
134 134
                 for ($ii = 0; $ii < count($list); $ii++) {
135
-                	if (! $list[$ii]['loaded']) {
135
+                	if (!$list[$ii]['loaded']) {
136 136
                 		$this->import[$ns][$ii]['loaded'] = true;
137 137
                 		$url = $list[$ii]['location'];
138 138
 						if ($url != '') {
139 139
 							$urlparts = parse_url($url);
140 140
 							if (!isset($urlparts['host'])) {
141
-								$url = $wsdlparts['scheme'] . '://' . $wsdlparts['host'] . (isset($wsdlparts['port']) ? ':' . $wsdlparts['port'] : '') .
142
-										substr($wsdlparts['path'],0,strrpos($wsdlparts['path'],'/') + 1) .$urlparts['path'];
141
+								$url = $wsdlparts['scheme'].'://'.$wsdlparts['host'].(isset($wsdlparts['port']) ? ':'.$wsdlparts['port'] : '').
142
+										substr($wsdlparts['path'], 0, strrpos($wsdlparts['path'], '/') + 1).$urlparts['path'];
143 143
 							}
144
-							if (! in_array($url, $imported_urls)) {
144
+							if (!in_array($url, $imported_urls)) {
145 145
 			                	$this->parseWSDL($url);
146 146
 		                		$imported++;
147 147
 		                		$imported_urls[] = $url;
@@ -154,30 +154,28 @@  discard block
 block discarded – undo
154 154
             }
155 155
 		}
156 156
         // add new data to operation data
157
-        foreach($this->bindings as $binding => $bindingData) {
157
+        foreach ($this->bindings as $binding => $bindingData) {
158 158
             if (isset($bindingData['operations']) && is_array($bindingData['operations'])) {
159
-                foreach($bindingData['operations'] as $operation => $data) {
160
-                    $this->debug('post-parse data gathering for ' . $operation);
159
+                foreach ($bindingData['operations'] as $operation => $data) {
160
+                    $this->debug('post-parse data gathering for '.$operation);
161 161
                     $this->bindings[$binding]['operations'][$operation]['input'] =
162 162
 						isset($this->bindings[$binding]['operations'][$operation]['input']) ?
163
-						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) :
164
-						$this->portTypes[ $bindingData['portType'] ][$operation]['input'];
163
+						array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[$bindingData['portType']][$operation]['input']) : $this->portTypes[$bindingData['portType']][$operation]['input'];
165 164
                     $this->bindings[$binding]['operations'][$operation]['output'] =
166 165
 						isset($this->bindings[$binding]['operations'][$operation]['output']) ?
167
-						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) :
168
-						$this->portTypes[ $bindingData['portType'] ][$operation]['output'];
169
-                    if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ])){
170
-						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['input']['message'] ];
166
+						array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[$bindingData['portType']][$operation]['output']) : $this->portTypes[$bindingData['portType']][$operation]['output'];
167
+                    if (isset($this->messages[$this->bindings[$binding]['operations'][$operation]['input']['message']])) {
168
+						$this->bindings[$binding]['operations'][$operation]['input']['parts'] = $this->messages[$this->bindings[$binding]['operations'][$operation]['input']['message']];
171 169
 					}
172
-					if(isset($this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ])){
173
-                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[ $this->bindings[$binding]['operations'][$operation]['output']['message'] ];
170
+					if (isset($this->messages[$this->bindings[$binding]['operations'][$operation]['output']['message']])) {
171
+                   		$this->bindings[$binding]['operations'][$operation]['output']['parts'] = $this->messages[$this->bindings[$binding]['operations'][$operation]['output']['message']];
174 172
                     }
175 173
                     // Set operation style if necessary, but do not override one already provided
176 174
 					if (isset($bindingData['style']) && !isset($this->bindings[$binding]['operations'][$operation]['style'])) {
177 175
                         $this->bindings[$binding]['operations'][$operation]['style'] = $bindingData['style'];
178 176
                     }
179 177
                     $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : '';
180
-                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : '';
178
+                    $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[$bindingData['portType']][$operation]['documentation']) ? $this->portTypes[$bindingData['portType']][$operation]['documentation'] : '';
181 179
                     $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : '';
182 180
                 }
183 181
             }
@@ -203,13 +201,13 @@  discard block
 block discarded – undo
203 201
         $wsdl_props = parse_url($wsdl);
204 202
 
205 203
         if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'http' || $wsdl_props['scheme'] == 'https')) {
206
-            $this->debug('getting WSDL http(s) URL ' . $wsdl);
204
+            $this->debug('getting WSDL http(s) URL '.$wsdl);
207 205
         	// get wsdl
208 206
 	        $tr = new soap_transport_http($wsdl, $this->curl_options, $this->use_curl);
209 207
 			$tr->request_method = 'GET';
210 208
 			$tr->useSOAPAction = false;
211
-			if($this->proxyhost && $this->proxyport){
212
-				$tr->setProxy($this->proxyhost,$this->proxyport,$this->proxyusername,$this->proxypassword);
209
+			if ($this->proxyhost && $this->proxyport) {
210
+				$tr->setProxy($this->proxyhost, $this->proxyport, $this->proxyusername, $this->proxypassword);
213 211
 			}
214 212
 			if ($this->authtype != '') {
215 213
 				$tr->setCredentials($this->username, $this->password, $this->authtype, array(), $this->certRequest);
@@ -220,8 +218,8 @@  discard block
 block discarded – undo
220 218
 			//$this->debug("WSDL response\n" . $tr->incoming_payload);
221 219
 			$this->appendDebug($tr->getDebug());
222 220
 			// catch errors
223
-			if($err = $tr->getError() ){
224
-				$errstr = 'Getting ' . $wsdl . ' - HTTP ERROR: '.$err;
221
+			if ($err = $tr->getError()) {
222
+				$errstr = 'Getting '.$wsdl.' - HTTP ERROR: '.$err;
225 223
 				$this->debug($errstr);
226 224
 	            $this->setError($errstr);
227 225
 				unset($tr);
@@ -232,11 +230,11 @@  discard block
 block discarded – undo
232 230
         } else {
233 231
             // $wsdl is not http(s), so treat it as a file URL or plain file path
234 232
         	if (isset($wsdl_props['scheme']) && ($wsdl_props['scheme'] == 'file') && isset($wsdl_props['path'])) {
235
-        		$path = isset($wsdl_props['host']) ? ($wsdl_props['host'] . ':' . $wsdl_props['path']) : $wsdl_props['path'];
233
+        		$path = isset($wsdl_props['host']) ? ($wsdl_props['host'].':'.$wsdl_props['path']) : $wsdl_props['path'];
236 234
         	} else {
237 235
         		$path = $wsdl;
238 236
         	}
239
-            $this->debug('getting WSDL file ' . $path);
237
+            $this->debug('getting WSDL file '.$path);
240 238
             if ($fp = @fopen($path, 'r')) {
241 239
                 $wsdl_string = '';
242 240
                 while ($data = fread($fp, 32768)) {
@@ -272,7 +270,7 @@  discard block
 block discarded – undo
272 270
                 xml_error_string(xml_get_error_code($this->parser))
273 271
                 );
274 272
             $this->debug($errstr);
275
-			$this->debug("XML payload:\n" . $wsdl_string);
273
+			$this->debug("XML payload:\n".$wsdl_string);
276 274
             $this->setError($errstr);
277 275
             return false;
278 276
         }
@@ -280,7 +278,7 @@  discard block
 block discarded – undo
280 278
         xml_parser_free($this->parser);
281 279
         $this->debug('Parsing WSDL done');
282 280
 		// catch wsdl parse errors
283
-		if($this->getError()){
281
+		if ($this->getError()) {
284 282
 			return false;
285 283
 		}
286 284
         return true;
@@ -318,21 +316,21 @@  discard block
 block discarded – undo
318 316
             // process attributes
319 317
             if (count($attrs) > 0) {
320 318
 				// register namespace declarations
321
-                foreach($attrs as $k => $v) {
322
-                    if (preg_match('/^xmlns/',$k)) {
319
+                foreach ($attrs as $k => $v) {
320
+                    if (preg_match('/^xmlns/', $k)) {
323 321
                         if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
324 322
                             $this->namespaces[$ns_prefix] = $v;
325 323
                         } else {
326
-                            $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v;
324
+                            $this->namespaces['ns'.(count($this->namespaces) + 1)] = $v;
327 325
                         }
328 326
                         if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') {
329 327
                             $this->XMLSchemaVersion = $v;
330
-                            $this->namespaces['xsi'] = $v . '-instance';
328
+                            $this->namespaces['xsi'] = $v.'-instance';
331 329
                         }
332 330
                     }
333 331
                 }
334 332
                 // expand each attribute prefix to its namespace
335
-                foreach($attrs as $k => $v) {
333
+                foreach ($attrs as $k => $v) {
336 334
                     $k = strpos($k, ':') ? $this->expandQname($k) : $k;
337 335
                     if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') {
338 336
                         $v = strpos($v, ':') ? $this->expandQname($v) : $v;
@@ -358,12 +356,12 @@  discard block
 block discarded – undo
358 356
                 case 'message':
359 357
                     if ($name == 'part') {
360 358
 			            if (isset($attrs['type'])) {
361
-		                    $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs));
359
+		                    $this->debug("msg ".$this->currentMessage.": found part (with type) $attrs[name]: ".implode(',', $attrs));
362 360
 		                    $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type'];
363 361
             			}
364 362
 			            if (isset($attrs['element'])) {
365
-		                    $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs));
366
-			                $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^';
363
+		                    $this->debug("msg ".$this->currentMessage.": found part (with element) $attrs[name]: ".implode(',', $attrs));
364
+			                $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'].'^';
367 365
 			            }
368 366
         			}
369 367
         			break;
@@ -432,15 +430,15 @@  discard block
 block discarded – undo
432 430
 					switch ($name) {
433 431
 					    case 'port':
434 432
 					        $this->currentPort = $attrs['name'];
435
-					        $this->debug('current port: ' . $this->currentPort);
433
+					        $this->debug('current port: '.$this->currentPort);
436 434
 					        $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']);
437 435
 
438 436
 					        break;
439 437
 					    case 'address':
440 438
 					        $this->ports[$this->currentPort]['location'] = $attrs['location'];
441 439
 					        $this->ports[$this->currentPort]['bindingType'] = $namespace;
442
-					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace;
443
-					        $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location'];
440
+					        $this->bindings[$this->ports[$this->currentPort]['binding']]['bindingType'] = $namespace;
441
+					        $this->bindings[$this->ports[$this->currentPort]['binding']]['endpoint'] = $attrs['location'];
444 442
 					        break;
445 443
 					}
446 444
 					break;
@@ -450,13 +448,13 @@  discard block
 block discarded – undo
450 448
 			case 'import':
451 449
 			    if (isset($attrs['location'])) {
452 450
                     $this->import[$attrs['namespace']][] = array('location' => $attrs['location'], 'loaded' => false);
453
-                    $this->debug('parsing import ' . $attrs['namespace']. ' - ' . $attrs['location'] . ' (' . count($this->import[$attrs['namespace']]).')');
451
+                    $this->debug('parsing import '.$attrs['namespace'].' - '.$attrs['location'].' ('.count($this->import[$attrs['namespace']]).')');
454 452
 				} else {
455 453
                     $this->import[$attrs['namespace']][] = array('location' => '', 'loaded' => true);
456
-					if (! $this->getPrefixFromNamespace($attrs['namespace'])) {
457
-						$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace'];
454
+					if (!$this->getPrefixFromNamespace($attrs['namespace'])) {
455
+						$this->namespaces['ns'.(count($this->namespaces) + 1)] = $attrs['namespace'];
458 456
 					}
459
-                    $this->debug('parsing import ' . $attrs['namespace']. ' - [no location] (' . count($this->import[$attrs['namespace']]).')');
457
+                    $this->debug('parsing import '.$attrs['namespace'].' - [no location] ('.count($this->import[$attrs['namespace']]).')');
460 458
 				}
461 459
 				break;
462 460
 			//wait for schema
@@ -483,13 +481,13 @@  discard block
 block discarded – undo
483 481
 					}
484 482
 					$this->status = 'binding';
485 483
 					$this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']);
486
-					$this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']);
484
+					$this->debug("current binding: $this->currentBinding of portType: ".$attrs['type']);
487 485
 				}
488 486
 				break;
489 487
 			case 'service':
490 488
 				$this->serviceName = $attrs['name'];
491 489
 				$this->status = 'service';
492
-				$this->debug('current service: ' . $this->serviceName);
490
+				$this->debug('current service: '.$this->serviceName);
493 491
 				break;
494 492
 			case 'definitions':
495 493
 				foreach ($attrs as $name => $value) {
@@ -507,7 +505,7 @@  discard block
 block discarded – undo
507 505
 	* @param string $name element name
508 506
 	* @access private
509 507
 	*/
510
-	function end_element($parser, $name){
508
+	function end_element($parser, $name) {
511 509
 		// unset schema status
512 510
 		if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
513 511
 			$this->status = "";
@@ -592,8 +590,8 @@  discard block
 block discarded – undo
592 590
 		}
593 591
 		$this->debug("getOperations for port '$portName' bindingType $bindingType");
594 592
 		// loop thru ports
595
-		foreach($this->ports as $port => $portData) {
596
-			$this->debug("getOperations checking port $port bindingType " . $portData['bindingType']);
593
+		foreach ($this->ports as $port => $portData) {
594
+			$this->debug("getOperations checking port $port bindingType ".$portData['bindingType']);
597 595
 			if ($portName == '' || $port == $portName) {
598 596
 				// binding type of port matches parameter
599 597
 				if ($portData['bindingType'] == $bindingType) {
@@ -601,8 +599,8 @@  discard block
 block discarded – undo
601 599
 					//$this->debug("port data: " . $this->varDump($portData));
602 600
 					//$this->debug("bindings: " . $this->varDump($this->bindings[ $portData['binding'] ]));
603 601
 					// merge bindings
604
-					if (isset($this->bindings[ $portData['binding'] ]['operations'])) {
605
-						$ops = array_merge ($ops, $this->bindings[ $portData['binding'] ]['operations']);
602
+					if (isset($this->bindings[$portData['binding']]['operations'])) {
603
+						$ops = array_merge($ops, $this->bindings[$portData['binding']]['operations']);
606 604
 					}
607 605
 				}
608 606
 			}
@@ -629,15 +627,15 @@  discard block
 block discarded – undo
629 627
 			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
630 628
 		}
631 629
 		// loop thru ports
632
-		foreach($this->ports as $port => $portData) {
630
+		foreach ($this->ports as $port => $portData) {
633 631
 			// binding type of port matches parameter
634 632
 			if ($portData['bindingType'] == $bindingType) {
635 633
 				// get binding
636 634
 				//foreach($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
637
-				foreach(array_keys($this->bindings[ $portData['binding'] ]['operations']) as $bOperation) {
635
+				foreach (array_keys($this->bindings[$portData['binding']]['operations']) as $bOperation) {
638 636
 					// note that we could/should also check the namespace here
639 637
 					if ($operation == $bOperation) {
640
-						$opData = $this->bindings[ $portData['binding'] ]['operations'][$operation];
638
+						$opData = $this->bindings[$portData['binding']]['operations'][$operation];
641 639
 					    return $opData;
642 640
 					}
643 641
 				}
@@ -660,11 +658,11 @@  discard block
 block discarded – undo
660 658
 			$bindingType = 'http://schemas.xmlsoap.org/wsdl/soap12/';
661 659
 		}
662 660
 		// loop thru ports
663
-		foreach($this->ports as $port => $portData) {
661
+		foreach ($this->ports as $port => $portData) {
664 662
 			// binding type of port matches parameter
665 663
 			if ($portData['bindingType'] == $bindingType) {
666 664
 				// loop through operations for the binding
667
-				foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) {
665
+				foreach ($this->bindings[$portData['binding']]['operations'] as $bOperation => $opData) {
668 666
 					if ($opData['soapAction'] == $soapAction) {
669 667
 					    return $opData;
670 668
 					}
@@ -693,7 +691,7 @@  discard block
 block discarded – undo
693 691
     */
694 692
 	function getTypeDef($type, $ns) {
695 693
 		$this->debug("in getTypeDef: type=$type, ns=$ns");
696
-		if ((! $ns) && isset($this->namespaces['tns'])) {
694
+		if ((!$ns) && isset($this->namespaces['tns'])) {
697 695
 			$ns = $this->namespaces['tns'];
698 696
 			$this->debug("in getTypeDef: type namespace forced to $ns");
699 697
 		}
@@ -751,7 +749,7 @@  discard block
 block discarded – undo
751 749
     *
752 750
     * @access private
753 751
     */
754
-    function webDescription(){
752
+    function webDescription() {
755 753
     	global $HTTP_SERVER_VARS;
756 754
 
757 755
 		if (isset($_SERVER)) {
@@ -845,19 +843,19 @@  discard block
 block discarded – undo
845 843
 				<p>View the <a href="'.$PHP_SELF.'?wsdl">WSDL</a> for the service.
846 844
 				Click on an operation name to view it&apos;s details.</p>
847 845
 				<ul>';
848
-				foreach($this->getOperations() as $op => $data){
846
+				foreach ($this->getOperations() as $op => $data) {
849 847
 				    $b .= "<li><a href='#' onclick=\"popout();popup('$op')\">$op</a></li>";
850 848
 				    // create hidden div
851 849
 				    $b .= "<div id='$op' class='hidden'>
852 850
 				    <a href='#' onclick='popout()'><font color='#ffffff'>Close</font></a><br><br>";
853
-				    foreach($data as $donnie => $marie){ // loop through opdata
854
-						if($donnie == 'input' || $donnie == 'output'){ // show input/output data
851
+				    foreach ($data as $donnie => $marie) { // loop through opdata
852
+						if ($donnie == 'input' || $donnie == 'output') { // show input/output data
855 853
 						    $b .= "<font color='white'>".ucfirst($donnie).':</font><br>';
856
-						    foreach($marie as $captain => $tenille){ // loop through data
857
-								if($captain == 'parts'){ // loop thru parts
854
+						    foreach ($marie as $captain => $tenille) { // loop through data
855
+								if ($captain == 'parts') { // loop thru parts
858 856
 								    $b .= "&nbsp;&nbsp;$captain:<br>";
859 857
 					                //if(is_array($tenille)){
860
-								    	foreach($tenille as $joanie => $chachi){
858
+								    	foreach ($tenille as $joanie => $chachi) {
861 859
 											$b .= "&nbsp;&nbsp;&nbsp;&nbsp;$joanie: $chachi<br>";
862 860
 								    	}
863 861
 					        		//}
@@ -889,31 +887,31 @@  discard block
 block discarded – undo
889 887
 	{
890 888
 		$xml = '<?xml version="1.0" encoding="ISO-8859-1"?>';
891 889
 		$xml .= "\n<definitions";
892
-		foreach($this->namespaces as $k => $v) {
890
+		foreach ($this->namespaces as $k => $v) {
893 891
 			$xml .= " xmlns:$k=\"$v\"";
894 892
 		}
895 893
 		// 10.9.02 - add poulter fix for wsdl and tns declarations
896 894
 		if (isset($this->namespaces['wsdl'])) {
897
-			$xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\"";
895
+			$xml .= " xmlns=\"".$this->namespaces['wsdl']."\"";
898 896
 		}
899 897
 		if (isset($this->namespaces['tns'])) {
900
-			$xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\"";
898
+			$xml .= " targetNamespace=\"".$this->namespaces['tns']."\"";
901 899
 		}
902 900
 		$xml .= '>';
903 901
 		// imports
904 902
 		if (sizeof($this->import) > 0) {
905
-			foreach($this->import as $ns => $list) {
903
+			foreach ($this->import as $ns => $list) {
906 904
 				foreach ($list as $ii) {
907 905
 					if ($ii['location'] != '') {
908
-						$xml .= '<import location="' . $ii['location'] . '" namespace="' . $ns . '" />';
906
+						$xml .= '<import location="'.$ii['location'].'" namespace="'.$ns.'" />';
909 907
 					} else {
910
-						$xml .= '<import namespace="' . $ns . '" />';
908
+						$xml .= '<import namespace="'.$ns.'" />';
911 909
 					}
912 910
 				}
913 911
 			}
914 912
 		}
915 913
 		// types
916
-		if (count($this->schemas)>=1) {
914
+		if (count($this->schemas) >= 1) {
917 915
 			$xml .= "\n<types>\n";
918 916
 			foreach ($this->schemas as $ns => $list) {
919 917
 				foreach ($list as $xs) {
@@ -924,10 +922,10 @@  discard block
 block discarded – undo
924 922
 		}
925 923
 		// messages
926 924
 		if (count($this->messages) >= 1) {
927
-			foreach($this->messages as $msgName => $msgParts) {
928
-				$xml .= "\n<message name=\"" . $msgName . '">';
929
-				if(is_array($msgParts)){
930
-					foreach($msgParts as $partName => $partType) {
925
+			foreach ($this->messages as $msgName => $msgParts) {
926
+				$xml .= "\n<message name=\"".$msgName.'">';
927
+				if (is_array($msgParts)) {
928
+					foreach ($msgParts as $partName => $partType) {
931 929
 						// print 'serializing '.$partType.', sv: '.$this->XMLSchemaVersion.'<br>';
932 930
 						if (strpos($partType, ':')) {
933 931
 						    $typePrefix = $this->getPrefixFromNamespace($this->getPrefix($partType));
@@ -935,7 +933,7 @@  discard block
 block discarded – undo
935 933
 						    // print 'checking typemap: '.$this->XMLSchemaVersion.'<br>';
936 934
 						    $typePrefix = 'xsd';
937 935
 						} else {
938
-						    foreach($this->typemap as $ns => $types) {
936
+						    foreach ($this->typemap as $ns => $types) {
939 937
 						        if (isset($types[$partType])) {
940 938
 						            $typePrefix = $this->getPrefixFromNamespace($ns);
941 939
 						        }
@@ -955,7 +953,7 @@  discard block
 block discarded – undo
955 953
 						} else {
956 954
 							$elementortype = 'type';
957 955
 						}
958
-						$xml .= "\n" . '  <part name="' . $partName . '" ' . $elementortype . '="' . $typePrefix . ':' . $localPart . '" />';
956
+						$xml .= "\n".'  <part name="'.$partName.'" '.$elementortype.'="'.$typePrefix.':'.$localPart.'" />';
959 957
 					}
960 958
 				}
961 959
 				$xml .= '</message>';
@@ -965,54 +963,54 @@  discard block
 block discarded – undo
965 963
 		if (count($this->bindings) >= 1) {
966 964
 			$binding_xml = '';
967 965
 			$portType_xml = '';
968
-			foreach($this->bindings as $bindingName => $attrs) {
969
-				$binding_xml .= "\n<binding name=\"" . $bindingName . '" type="tns:' . $attrs['portType'] . '">';
970
-				$binding_xml .= "\n" . '  <soap:binding style="' . $attrs['style'] . '" transport="' . $attrs['transport'] . '"/>';
971
-				$portType_xml .= "\n<portType name=\"" . $attrs['portType'] . '">';
972
-				foreach($attrs['operations'] as $opName => $opParts) {
973
-					$binding_xml .= "\n" . '  <operation name="' . $opName . '">';
974
-					$binding_xml .= "\n" . '    <soap:operation soapAction="' . $opParts['soapAction'] . '" style="'. $opParts['style'] . '"/>';
966
+			foreach ($this->bindings as $bindingName => $attrs) {
967
+				$binding_xml .= "\n<binding name=\"".$bindingName.'" type="tns:'.$attrs['portType'].'">';
968
+				$binding_xml .= "\n".'  <soap:binding style="'.$attrs['style'].'" transport="'.$attrs['transport'].'"/>';
969
+				$portType_xml .= "\n<portType name=\"".$attrs['portType'].'">';
970
+				foreach ($attrs['operations'] as $opName => $opParts) {
971
+					$binding_xml .= "\n".'  <operation name="'.$opName.'">';
972
+					$binding_xml .= "\n".'    <soap:operation soapAction="'.$opParts['soapAction'].'" style="'.$opParts['style'].'"/>';
975 973
 					if (isset($opParts['input']['encodingStyle']) && $opParts['input']['encodingStyle'] != '') {
976
-						$enc_style = ' encodingStyle="' . $opParts['input']['encodingStyle'] . '"';
974
+						$enc_style = ' encodingStyle="'.$opParts['input']['encodingStyle'].'"';
977 975
 					} else {
978 976
 						$enc_style = '';
979 977
 					}
980
-					$binding_xml .= "\n" . '    <input><soap:body use="' . $opParts['input']['use'] . '" namespace="' . $opParts['input']['namespace'] . '"' . $enc_style . '/></input>';
978
+					$binding_xml .= "\n".'    <input><soap:body use="'.$opParts['input']['use'].'" namespace="'.$opParts['input']['namespace'].'"'.$enc_style.'/></input>';
981 979
 					if (isset($opParts['output']['encodingStyle']) && $opParts['output']['encodingStyle'] != '') {
982
-						$enc_style = ' encodingStyle="' . $opParts['output']['encodingStyle'] . '"';
980
+						$enc_style = ' encodingStyle="'.$opParts['output']['encodingStyle'].'"';
983 981
 					} else {
984 982
 						$enc_style = '';
985 983
 					}
986
-					$binding_xml .= "\n" . '    <output><soap:body use="' . $opParts['output']['use'] . '" namespace="' . $opParts['output']['namespace'] . '"' . $enc_style . '/></output>';
987
-					$binding_xml .= "\n" . '  </operation>';
988
-					$portType_xml .= "\n" . '  <operation name="' . $opParts['name'] . '"';
984
+					$binding_xml .= "\n".'    <output><soap:body use="'.$opParts['output']['use'].'" namespace="'.$opParts['output']['namespace'].'"'.$enc_style.'/></output>';
985
+					$binding_xml .= "\n".'  </operation>';
986
+					$portType_xml .= "\n".'  <operation name="'.$opParts['name'].'"';
989 987
 					if (isset($opParts['parameterOrder'])) {
990
-					    $portType_xml .= ' parameterOrder="' . $opParts['parameterOrder'] . '"';
988
+					    $portType_xml .= ' parameterOrder="'.$opParts['parameterOrder'].'"';
991 989
 					}
992 990
 					$portType_xml .= '>';
993
-					if(isset($opParts['documentation']) && $opParts['documentation'] != '') {
994
-						$portType_xml .= "\n" . '    <documentation>' . htmlspecialchars($opParts['documentation']) . '</documentation>';
991
+					if (isset($opParts['documentation']) && $opParts['documentation'] != '') {
992
+						$portType_xml .= "\n".'    <documentation>'.htmlspecialchars($opParts['documentation']).'</documentation>';
995 993
 					}
996
-					$portType_xml .= "\n" . '    <input message="tns:' . $opParts['input']['message'] . '"/>';
997
-					$portType_xml .= "\n" . '    <output message="tns:' . $opParts['output']['message'] . '"/>';
998
-					$portType_xml .= "\n" . '  </operation>';
994
+					$portType_xml .= "\n".'    <input message="tns:'.$opParts['input']['message'].'"/>';
995
+					$portType_xml .= "\n".'    <output message="tns:'.$opParts['output']['message'].'"/>';
996
+					$portType_xml .= "\n".'  </operation>';
999 997
 				}
1000
-				$portType_xml .= "\n" . '</portType>';
1001
-				$binding_xml .= "\n" . '</binding>';
998
+				$portType_xml .= "\n".'</portType>';
999
+				$binding_xml .= "\n".'</binding>';
1002 1000
 			}
1003
-			$xml .= $portType_xml . $binding_xml;
1001
+			$xml .= $portType_xml.$binding_xml;
1004 1002
 		}
1005 1003
 		// services
1006
-		$xml .= "\n<service name=\"" . $this->serviceName . '">';
1004
+		$xml .= "\n<service name=\"".$this->serviceName.'">';
1007 1005
 		if (count($this->ports) >= 1) {
1008
-			foreach($this->ports as $pName => $attrs) {
1009
-				$xml .= "\n" . '  <port name="' . $pName . '" binding="tns:' . $attrs['binding'] . '">';
1010
-				$xml .= "\n" . '    <soap:address location="' . $attrs['location'] . ($debug ? '?debug=1' : '') . '"/>';
1011
-				$xml .= "\n" . '  </port>';
1006
+			foreach ($this->ports as $pName => $attrs) {
1007
+				$xml .= "\n".'  <port name="'.$pName.'" binding="tns:'.$attrs['binding'].'">';
1008
+				$xml .= "\n".'    <soap:address location="'.$attrs['location'].($debug ? '?debug=1' : '').'"/>';
1009
+				$xml .= "\n".'  </port>';
1012 1010
 			}
1013 1011
 		}
1014
-		$xml .= "\n" . '</service>';
1015
-		return $xml . "\n</definitions>";
1012
+		$xml .= "\n".'</service>';
1013
+		return $xml."\n</definitions>";
1016 1014
 	}
1017 1015
 
1018 1016
 	/**
@@ -1109,7 +1107,7 @@  discard block
 block discarded – undo
1109 1107
 	 */
1110 1108
 	function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') {
1111 1109
 		$this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType");
1112
-		$this->appendDebug('parameters=' . $this->varDump($parameters));
1110
+		$this->appendDebug('parameters='.$this->varDump($parameters));
1113 1111
 
1114 1112
 		if ($direction != 'input' && $direction != 'output') {
1115 1113
 			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
@@ -1117,8 +1115,8 @@  discard block
 block discarded – undo
1117 1115
 			return false;
1118 1116
 		}
1119 1117
 		if (!$opData = $this->getOperationData($operation, $bindingType)) {
1120
-			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
1121
-			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType);
1118
+			$this->debug('Unable to retrieve WSDL data for operation: '.$operation.' bindingType: '.$bindingType);
1119
+			$this->setError('Unable to retrieve WSDL data for operation: '.$operation.' bindingType: '.$bindingType);
1122 1120
 			return false;
1123 1121
 		}
1124 1122
 		$this->debug('in serializeRPCParameters: opData:');
@@ -1126,7 +1124,7 @@  discard block
 block discarded – undo
1126 1124
 
1127 1125
 		// Get encoding style for output and set to current
1128 1126
 		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1129
-		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1127
+		if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1130 1128
 			$encodingStyle = $opData['output']['encodingStyle'];
1131 1129
 			$enc_style = $encodingStyle;
1132 1130
 		}
@@ -1211,7 +1209,7 @@  discard block
 block discarded – undo
1211 1209
 	function serializeParameters($operation, $direction, $parameters)
1212 1210
 	{
1213 1211
 		$this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion");
1214
-		$this->appendDebug('parameters=' . $this->varDump($parameters));
1212
+		$this->appendDebug('parameters='.$this->varDump($parameters));
1215 1213
 
1216 1214
 		if ($direction != 'input' && $direction != 'output') {
1217 1215
 			$this->debug('The value of the \$direction argument needs to be either "input" or "output"');
@@ -1219,8 +1217,8 @@  discard block
 block discarded – undo
1219 1217
 			return false;
1220 1218
 		}
1221 1219
 		if (!$opData = $this->getOperationData($operation)) {
1222
-			$this->debug('Unable to retrieve WSDL data for operation: ' . $operation);
1223
-			$this->setError('Unable to retrieve WSDL data for operation: ' . $operation);
1220
+			$this->debug('Unable to retrieve WSDL data for operation: '.$operation);
1221
+			$this->setError('Unable to retrieve WSDL data for operation: '.$operation);
1224 1222
 			return false;
1225 1223
 		}
1226 1224
 		$this->debug('opData:');
@@ -1228,7 +1226,7 @@  discard block
 block discarded – undo
1228 1226
 
1229 1227
 		// Get encoding style for output and set to current
1230 1228
 		$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1231
-		if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1229
+		if (($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) {
1232 1230
 			$encodingStyle = $opData['output']['encodingStyle'];
1233 1231
 			$enc_style = $encodingStyle;
1234 1232
 		}
@@ -1239,14 +1237,14 @@  discard block
 block discarded – undo
1239 1237
 
1240 1238
 			$use = $opData[$direction]['use'];
1241 1239
 			$this->debug("use=$use");
1242
-			$this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)');
1240
+			$this->debug('got '.count($opData[$direction]['parts']).' part(s)');
1243 1241
 			if (is_array($parameters)) {
1244 1242
 				$parametersArrayType = $this->isArraySimpleOrStruct($parameters);
1245
-				$this->debug('have ' . $parametersArrayType . ' parameters');
1246
-				foreach($opData[$direction]['parts'] as $name => $type) {
1243
+				$this->debug('have '.$parametersArrayType.' parameters');
1244
+				foreach ($opData[$direction]['parts'] as $name => $type) {
1247 1245
 					$this->debug('serializing part "'.$name.'" of type "'.$type.'"');
1248 1246
 					// Track encoding style
1249
-					if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
1247
+					if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) {
1250 1248
 						$encodingStyle = $opData[$direction]['encodingStyle'];
1251 1249
 						$enc_style = $encodingStyle;
1252 1250
 					} else {
@@ -1287,18 +1285,18 @@  discard block
 block discarded – undo
1287 1285
 	 * @return string value serialized as an XML string
1288 1286
 	 * @access private
1289 1287
 	 */
1290
-	function serializeType($name, $type, $value, $use='encoded', $encodingStyle=false, $unqualified=false)
1288
+	function serializeType($name, $type, $value, $use = 'encoded', $encodingStyle = false, $unqualified = false)
1291 1289
 	{
1292
-		$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=" . ($unqualified ? "unqualified" : "qualified"));
1293
-		$this->appendDebug("value=" . $this->varDump($value));
1294
-		if($use == 'encoded' && $encodingStyle) {
1295
-			$encodingStyle = ' SOAP-ENV:encodingStyle="' . $encodingStyle . '"';
1290
+		$this->debug("in serializeType: name=$name, type=$type, use=$use, encodingStyle=$encodingStyle, unqualified=".($unqualified ? "unqualified" : "qualified"));
1291
+		$this->appendDebug("value=".$this->varDump($value));
1292
+		if ($use == 'encoded' && $encodingStyle) {
1293
+			$encodingStyle = ' SOAP-ENV:encodingStyle="'.$encodingStyle.'"';
1296 1294
 		}
1297 1295
 
1298 1296
 		// if a soapval has been supplied, let its type override the WSDL
1299 1297
     	if (is_object($value) && get_class($value) == 'soapval') {
1300 1298
     		if ($value->type_ns) {
1301
-    			$type = $value->type_ns . ':' . $value->type;
1299
+    			$type = $value->type_ns.':'.$value->type;
1302 1300
 		    	$forceType = true;
1303 1301
 		    	$this->debug("in serializeType: soapval overrides type to $type");
1304 1302
     		} elseif ($value->type) {
@@ -1317,7 +1315,7 @@  discard block
 block discarded – undo
1317 1315
 	    			$value['!'] = $value;
1318 1316
 	    		}
1319 1317
 	    		foreach ($attrs as $n => $v) {
1320
-	    			$value['!' . $n] = $v;
1318
+	    			$value['!'.$n] = $v;
1321 1319
 	    		}
1322 1320
 		    	$this->debug("in serializeType: soapval provides attributes");
1323 1321
 		    }
@@ -1335,7 +1333,7 @@  discard block
 block discarded – undo
1335 1333
 				$this->debug("in serializeType: expanded prefixed type: $uqType, $ns");
1336 1334
 			}
1337 1335
 
1338
-			if($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/'){
1336
+			if ($ns == $this->XMLSchemaVersion || $ns == 'http://schemas.xmlsoap.org/soap/encoding/') {
1339 1337
 				$this->debug('in serializeType: type namespace indicates XML Schema or SOAP Encoding type');
1340 1338
 				if ($unqualified && $use == 'literal') {
1341 1339
 					$elementNS = " xmlns=\"\"";
@@ -1348,7 +1346,7 @@  discard block
 block discarded – undo
1348 1346
 						$xml = "<$name$elementNS/>";
1349 1347
 					} else {
1350 1348
 						// TODO: depends on nillable, which should be checked before calling this method
1351
-						$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
1349
+						$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\"/>";
1352 1350
 					}
1353 1351
 					$this->debug("in serializeType: returning: $xml");
1354 1352
 					return $xml;
@@ -1358,7 +1356,7 @@  discard block
 block discarded – undo
1358 1356
 					return $this->serialize_val($value, $name, false, false, false, false, $use);
1359 1357
 				}
1360 1358
 		    	if ($uqType == 'boolean') {
1361
-		    		if ((is_string($value) && $value == 'false') || (! $value)) {
1359
+		    		if ((is_string($value) && $value == 'false') || (!$value)) {
1362 1360
 						$value = 'false';
1363 1361
 					} else {
1364 1362
 						$value = 'true';
@@ -1376,12 +1374,12 @@  discard block
 block discarded – undo
1376 1374
 				if (!$this->getTypeDef($uqType, $ns)) {
1377 1375
 					if ($use == 'literal') {
1378 1376
 						if ($forceType) {
1379
-							$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
1377
+							$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\">$value</$name>";
1380 1378
 						} else {
1381 1379
 							$xml = "<$name$elementNS>$value</$name>";
1382 1380
 						}
1383 1381
 					} else {
1384
-						$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
1382
+						$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\"$encodingStyle>$value</$name>";
1385 1383
 					}
1386 1384
 					$this->debug("in serializeType: returning: $xml");
1387 1385
 					return $xml;
@@ -1391,29 +1389,29 @@  discard block
 block discarded – undo
1391 1389
 				$this->debug('in serializeType: appears to be Apache SOAP type');
1392 1390
 				if ($uqType == 'Map') {
1393 1391
 					$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
1394
-					if (! $tt_prefix) {
1392
+					if (!$tt_prefix) {
1395 1393
 						$this->debug('in serializeType: Add namespace for Apache SOAP type');
1396
-						$tt_prefix = 'ns' . rand(1000, 9999);
1394
+						$tt_prefix = 'ns'.rand(1000, 9999);
1397 1395
 						$this->namespaces[$tt_prefix] = 'http://xml.apache.org/xml-soap';
1398 1396
 						// force this to be added to usedNamespaces
1399 1397
 						$tt_prefix = $this->getPrefixFromNamespace('http://xml.apache.org/xml-soap');
1400 1398
 					}
1401 1399
 					$contents = '';
1402
-					foreach($value as $k => $v) {
1400
+					foreach ($value as $k => $v) {
1403 1401
 						$this->debug("serializing map element: key $k, value $v");
1404 1402
 						$contents .= '<item>';
1405
-						$contents .= $this->serialize_val($k,'key',false,false,false,false,$use);
1406
-						$contents .= $this->serialize_val($v,'value',false,false,false,false,$use);
1403
+						$contents .= $this->serialize_val($k, 'key', false, false, false, false, $use);
1404
+						$contents .= $this->serialize_val($v, 'value', false, false, false, false, $use);
1407 1405
 						$contents .= '</item>';
1408 1406
 					}
1409 1407
 					if ($use == 'literal') {
1410 1408
 						if ($forceType) {
1411
-							$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\">$contents</$name>";
1409
+							$xml = "<$name xsi:type=\"".$tt_prefix.":$uqType\">$contents</$name>";
1412 1410
 						} else {
1413 1411
 							$xml = "<$name>$contents</$name>";
1414 1412
 						}
1415 1413
 					} else {
1416
-						$xml = "<$name xsi:type=\"" . $tt_prefix . ":$uqType\"$encodingStyle>$contents</$name>";
1414
+						$xml = "<$name xsi:type=\"".$tt_prefix.":$uqType\"$encodingStyle>$contents</$name>";
1417 1415
 					}
1418 1416
 					$this->debug("in serializeType: returning: $xml");
1419 1417
 					return $xml;
@@ -1427,13 +1425,13 @@  discard block
 block discarded – undo
1427 1425
 			$ns = '';
1428 1426
 			$uqType = $type;
1429 1427
 		}
1430
-		if(!$typeDef = $this->getTypeDef($uqType, $ns)){
1428
+		if (!$typeDef = $this->getTypeDef($uqType, $ns)) {
1431 1429
 			$this->setError("$type ($uqType) is not a supported type.");
1432 1430
 			$this->debug("in serializeType: $type ($uqType) is not a supported type.");
1433 1431
 			return false;
1434 1432
 		} else {
1435 1433
 			$this->debug("in serializeType: found typeDef");
1436
-			$this->appendDebug('typeDef=' . $this->varDump($typeDef));
1434
+			$this->appendDebug('typeDef='.$this->varDump($typeDef));
1437 1435
 			if (substr($uqType, -1) == '^') {
1438 1436
 				$uqType = substr($uqType, 0, -1);
1439 1437
 			}
@@ -1444,7 +1442,7 @@  discard block
 block discarded – undo
1444 1442
 			return false;
1445 1443
 		}
1446 1444
 		$phpType = $typeDef['phpType'];
1447
-		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') );
1445
+		$this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: ".(isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''));
1448 1446
 		// if php type == struct, map value to the <all> element names
1449 1447
 		if ($phpType == 'struct') {
1450 1448
 			if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
@@ -1467,7 +1465,7 @@  discard block
 block discarded – undo
1467 1465
 					// TODO: depends on minOccurs and nillable
1468 1466
 					$xml = "<$elementName$elementNS/>";
1469 1467
 				} else {
1470
-					$xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"/>";
1468
+					$xml = "<$elementName$elementNS xsi:nil=\"true\" xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\"/>";
1471 1469
 				}
1472 1470
 				$this->debug("in serializeType: returning: $xml");
1473 1471
 				return $xml;
@@ -1479,12 +1477,12 @@  discard block
 block discarded – undo
1479 1477
 				$elementAttrs = $this->serializeComplexTypeAttributes($typeDef, $value, $ns, $uqType);
1480 1478
 				if ($use == 'literal') {
1481 1479
 					if ($forceType) {
1482
-						$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">";
1480
+						$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\">";
1483 1481
 					} else {
1484 1482
 						$xml = "<$elementName$elementNS$elementAttrs>";
1485 1483
 					}
1486 1484
 				} else {
1487
-					$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>";
1485
+					$xml = "<$elementName$elementNS$elementAttrs xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\"$encodingStyle>";
1488 1486
 				}
1489 1487
 
1490 1488
 				if (isset($typeDef['simpleContent']) && $typeDef['simpleContent'] == 'true') {
@@ -1519,13 +1517,13 @@  discard block
 block discarded – undo
1519 1517
 					// TODO: depends on minOccurs
1520 1518
 					$xml = "<$name$elementNS/>";
1521 1519
 				} else {
1522
-					$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"" .
1523
-						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
1524
-						":Array\" " .
1525
-						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/') .
1526
-						':arrayType="' .
1527
-						$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])) .
1528
-						':' .
1520
+					$xml = "<$name$elementNS xsi:nil=\"true\" xsi:type=\"".
1521
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').
1522
+						":Array\" ".
1523
+						$this->getPrefixFromNamespace('http://schemas.xmlsoap.org/soap/encoding/').
1524
+						':arrayType="'.
1525
+						$this->getPrefixFromNamespace($this->getPrefix($typeDef['arrayType'])).
1526
+						':'.
1529 1527
 						$this->getLocalPart($typeDef['arrayType'])."[0]\"/>";
1530 1528
 				}
1531 1529
 				$this->debug("in serializeType: returning: $xml");
@@ -1533,8 +1531,8 @@  discard block
 block discarded – undo
1533 1531
 			}
1534 1532
 			if (isset($typeDef['multidimensional'])) {
1535 1533
 				$nv = array();
1536
-				foreach($value as $v) {
1537
-					$cols = ',' . sizeof($v);
1534
+				foreach ($value as $v) {
1535
+					$cols = ','.sizeof($v);
1538 1536
 					$nv = array_merge($nv, $v);
1539 1537
 				}
1540 1538
 				$value = $nv;
@@ -1544,10 +1542,10 @@  discard block
 block discarded – undo
1544 1542
 			if (is_array($value) && sizeof($value) >= 1) {
1545 1543
 				$rows = sizeof($value);
1546 1544
 				$contents = '';
1547
-				foreach($value as $k => $v) {
1545
+				foreach ($value as $k => $v) {
1548 1546
 					//$this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]");
1549 1547
 					//if (strpos($typeDef['arrayType'], ':') ) {
1550
-					if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) {
1548
+					if (!in_array($typeDef['arrayType'], $this->typemap['http://www.w3.org/2001/XMLSchema'])) {
1551 1549
 					    $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use);
1552 1550
 					} else {
1553 1551
 					    $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use);
@@ -1584,12 +1582,12 @@  discard block
 block discarded – undo
1584 1582
 			}
1585 1583
 			if ($use == 'literal') {
1586 1584
 				if ($forceType) {
1587
-					$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\">$value</$name>";
1585
+					$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\">$value</$name>";
1588 1586
 				} else {
1589 1587
 					$xml = "<$name$elementNS>$value</$name>";
1590 1588
 				}
1591 1589
 			} else {
1592
-				$xml = "<$name$elementNS xsi:type=\"" . $this->getPrefixFromNamespace($ns) . ":$uqType\"$encodingStyle>$value</$name>";
1590
+				$xml = "<$name$elementNS xsi:type=\"".$this->getPrefixFromNamespace($ns).":$uqType\"$encodingStyle>$value</$name>";
1593 1591
 			}
1594 1592
 		}
1595 1593
 		$this->debug("in serializeType: returning: $xml");
@@ -1633,22 +1631,22 @@  discard block
 block discarded – undo
1633 1631
 				$xvalue = array();
1634 1632
 			}
1635 1633
 			foreach ($typeDef['attrs'] as $aName => $attrs) {
1636
-				if (isset($xvalue['!' . $aName])) {
1637
-					$xname = '!' . $aName;
1634
+				if (isset($xvalue['!'.$aName])) {
1635
+					$xname = '!'.$aName;
1638 1636
 					$this->debug("value provided for attribute $aName with key $xname");
1639 1637
 				} elseif (isset($xvalue[$aName])) {
1640 1638
 					$xname = $aName;
1641 1639
 					$this->debug("value provided for attribute $aName with key $xname");
1642 1640
 				} elseif (isset($attrs['default'])) {
1643
-					$xname = '!' . $aName;
1641
+					$xname = '!'.$aName;
1644 1642
 					$xvalue[$xname] = $attrs['default'];
1645
-					$this->debug('use default value of ' . $xvalue[$aName] . ' for attribute ' . $aName);
1643
+					$this->debug('use default value of '.$xvalue[$aName].' for attribute '.$aName);
1646 1644
 				} else {
1647 1645
 					$xname = '';
1648 1646
 					$this->debug("no value provided for attribute $aName");
1649 1647
 				}
1650 1648
 				if ($xname) {
1651
-					$xml .=  " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\"";
1649
+					$xml .= " $aName=\"".$this->expandEntities($xvalue[$xname])."\"";
1652 1650
 				}
1653 1651
 			}
1654 1652
 		} else {
@@ -1669,7 +1667,7 @@  discard block
 block discarded – undo
1669 1667
 	 * @return string value serialized as an XML string
1670 1668
 	 * @access private
1671 1669
 	 */
1672
-	function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use='encoded', $encodingStyle=false) {
1670
+	function serializeComplexTypeElements($typeDef, $value, $ns, $uqType, $use = 'encoded', $encodingStyle = false) {
1673 1671
 		$this->debug("in serializeComplexTypeElements for XML Schema type $ns:$uqType");
1674 1672
 		$xml = '';
1675 1673
 		if (isset($typeDef['extensionBase'])) {
@@ -1696,23 +1694,23 @@  discard block
 block discarded – undo
1696 1694
 				$xvalue = array();
1697 1695
 			}
1698 1696
 			// toggle whether all elements are present - ideally should validate against schema
1699
-			if (count($typeDef['elements']) != count($xvalue)){
1697
+			if (count($typeDef['elements']) != count($xvalue)) {
1700 1698
 				$optionals = true;
1701 1699
 			}
1702 1700
 			foreach ($typeDef['elements'] as $eName => $attrs) {
1703 1701
 				if (!isset($xvalue[$eName])) {
1704 1702
 					if (isset($attrs['default'])) {
1705 1703
 						$xvalue[$eName] = $attrs['default'];
1706
-						$this->debug('use default value of ' . $xvalue[$eName] . ' for element ' . $eName);
1704
+						$this->debug('use default value of '.$xvalue[$eName].' for element '.$eName);
1707 1705
 					}
1708 1706
 				}
1709 1707
 				// if user took advantage of a minOccurs=0, then only serialize named parameters
1710 1708
 				if (isset($optionals)
1711 1709
 				    && (!isset($xvalue[$eName]))
1712
-					&& ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
1713
-					){
1710
+					&& ((!isset($attrs['nillable'])) || $attrs['nillable'] != 'true')
1711
+					) {
1714 1712
 					if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') {
1715
-						$this->debug("apparent error: no value provided for element $eName with minOccurs=" . $attrs['minOccurs']);
1713
+						$this->debug("apparent error: no value provided for element $eName with minOccurs=".$attrs['minOccurs']);
1716 1714
 					}
1717 1715
 					// do nothing
1718 1716
 					$this->debug("no value provided for complexType element $eName and element is not nillable, so serialize nothing");
@@ -1777,15 +1775,15 @@  discard block
 block discarded – undo
1777 1775
 	* @see nusoap_xmlschema
1778 1776
 	* @access public
1779 1777
 	*/
1780
-	function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType='') {
1778
+	function addComplexType($name, $typeClass = 'complexType', $phpType = 'array', $compositor = '', $restrictionBase = '', $elements = array(), $attrs = array(), $arrayType = '') {
1781 1779
 		if (count($elements) > 0) {
1782 1780
 			$eElements = array();
1783
-	    	foreach($elements as $n => $e){
1781
+	    	foreach ($elements as $n => $e) {
1784 1782
 	            // expand each element
1785 1783
 	            $ee = array();
1786 1784
 	            foreach ($e as $k => $v) {
1787
-		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
1788
-		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
1785
+		            $k = strpos($k, ':') ? $this->expandQname($k) : $k;
1786
+		            $v = strpos($v, ':') ? $this->expandQname($v) : $v;
1789 1787
 		            $ee[$k] = $v;
1790 1788
 		    	}
1791 1789
 	    		$eElements[$n] = $ee;
@@ -1794,11 +1792,11 @@  discard block
 block discarded – undo
1794 1792
 		}
1795 1793
 
1796 1794
 		if (count($attrs) > 0) {
1797
-	    	foreach($attrs as $n => $a){
1795
+	    	foreach ($attrs as $n => $a) {
1798 1796
 	            // expand each attribute
1799 1797
 	            foreach ($a as $k => $v) {
1800
-		            $k = strpos($k,':') ? $this->expandQname($k) : $k;
1801
-		            $v = strpos($v,':') ? $this->expandQname($v) : $v;
1798
+		            $k = strpos($k, ':') ? $this->expandQname($k) : $k;
1799
+		            $v = strpos($v, ':') ? $this->expandQname($v) : $v;
1802 1800
 		            $aa[$k] = $v;
1803 1801
 		    	}
1804 1802
 	    		$eAttrs[$n] = $aa;
@@ -1806,11 +1804,11 @@  discard block
 block discarded – undo
1806 1804
 	    	$attrs = $eAttrs;
1807 1805
 		}
1808 1806
 
1809
-		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1810
-		$arrayType = strpos($arrayType,':') ? $this->expandQname($arrayType) : $arrayType;
1807
+		$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1808
+		$arrayType = strpos($arrayType, ':') ? $this->expandQname($arrayType) : $arrayType;
1811 1809
 
1812 1810
 		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
1813
-		$this->schemas[$typens][0]->addComplexType($name,$typeClass,$phpType,$compositor,$restrictionBase,$elements,$attrs,$arrayType);
1811
+		$this->schemas[$typens][0]->addComplexType($name, $typeClass, $phpType, $compositor, $restrictionBase, $elements, $attrs, $arrayType);
1814 1812
 	}
1815 1813
 
1816 1814
 	/**
@@ -1824,8 +1822,8 @@  discard block
 block discarded – undo
1824 1822
 	* @see nusoap_xmlschema
1825 1823
 	* @access public
1826 1824
 	*/
1827
-	function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) {
1828
-		$restrictionBase = strpos($restrictionBase,':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1825
+	function addSimpleType($name, $restrictionBase = '', $typeClass = 'simpleType', $phpType = 'scalar', $enumeration = array()) {
1826
+		$restrictionBase = strpos($restrictionBase, ':') ? $this->expandQname($restrictionBase) : $restrictionBase;
1829 1827
 
1830 1828
 		$typens = isset($this->namespaces['types']) ? $this->namespaces['types'] : $this->namespaces['tns'];
1831 1829
 		$this->schemas[$typens][0]->addSimpleType($name, $restrictionBase, $typeClass, $phpType, $enumeration);
@@ -1857,7 +1855,7 @@  discard block
 block discarded – undo
1857 1855
 	* @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded)
1858 1856
 	* @access public
1859 1857
 	*/
1860
-	function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){
1858
+	function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = '') {
1861 1859
 		if ($use == 'encoded' && $encodingStyle == '') {
1862 1860
 			$encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/';
1863 1861
 		}
@@ -1867,24 +1865,24 @@  discard block
 block discarded – undo
1867 1865
 			foreach ($in as $n => $t) {
1868 1866
 				$elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified');
1869 1867
 			}
1870
-			$this->addComplexType($name . 'RequestType', 'complexType', 'struct', 'all', '', $elements);
1871
-			$this->addElement(array('name' => $name, 'type' => $name . 'RequestType'));
1872
-			$in = array('parameters' => 'tns:' . $name . '^');
1868
+			$this->addComplexType($name.'RequestType', 'complexType', 'struct', 'all', '', $elements);
1869
+			$this->addElement(array('name' => $name, 'type' => $name.'RequestType'));
1870
+			$in = array('parameters' => 'tns:'.$name.'^');
1873 1871
 
1874 1872
 			$elements = array();
1875 1873
 			foreach ($out as $n => $t) {
1876 1874
 				$elements[$n] = array('name' => $n, 'type' => $t, 'form' => 'unqualified');
1877 1875
 			}
1878
-			$this->addComplexType($name . 'ResponseType', 'complexType', 'struct', 'all', '', $elements);
1879
-			$this->addElement(array('name' => $name . 'Response', 'type' => $name . 'ResponseType', 'form' => 'qualified'));
1880
-			$out = array('parameters' => 'tns:' . $name . 'Response' . '^');
1876
+			$this->addComplexType($name.'ResponseType', 'complexType', 'struct', 'all', '', $elements);
1877
+			$this->addElement(array('name' => $name.'Response', 'type' => $name.'ResponseType', 'form' => 'qualified'));
1878
+			$out = array('parameters' => 'tns:'.$name.'Response'.'^');
1881 1879
 		}
1882 1880
 
1883 1881
 		// get binding
1884
-		$this->bindings[ $this->serviceName . 'Binding' ]['operations'][$name] =
1882
+		$this->bindings[$this->serviceName.'Binding']['operations'][$name] =
1885 1883
 		array(
1886 1884
 		'name' => $name,
1887
-		'binding' => $this->serviceName . 'Binding',
1885
+		'binding' => $this->serviceName.'Binding',
1888 1886
 		'endpoint' => $this->endpoint,
1889 1887
 		'soapAction' => $soapaction,
1890 1888
 		'style' => $style,
@@ -1892,42 +1890,42 @@  discard block
 block discarded – undo
1892 1890
 			'use' => $use,
1893 1891
 			'namespace' => $namespace,
1894 1892
 			'encodingStyle' => $encodingStyle,
1895
-			'message' => $name . 'Request',
1893
+			'message' => $name.'Request',
1896 1894
 			'parts' => $in),
1897 1895
 		'output' => array(
1898 1896
 			'use' => $use,
1899 1897
 			'namespace' => $namespace,
1900 1898
 			'encodingStyle' => $encodingStyle,
1901
-			'message' => $name . 'Response',
1899
+			'message' => $name.'Response',
1902 1900
 			'parts' => $out),
1903 1901
 		'namespace' => $namespace,
1904 1902
 		'transport' => 'http://schemas.xmlsoap.org/soap/http',
1905 1903
 		'documentation' => $documentation);
1906 1904
 		// add portTypes
1907 1905
 		// add messages
1908
-		if($in)
1906
+		if ($in)
1909 1907
 		{
1910
-			foreach($in as $pName => $pType)
1908
+			foreach ($in as $pName => $pType)
1911 1909
 			{
1912
-				if(strpos($pType,':')) {
1910
+				if (strpos($pType, ':')) {
1913 1911
 					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
1914 1912
 				}
1915 1913
 				$this->messages[$name.'Request'][$pName] = $pType;
1916 1914
 			}
1917 1915
 		} else {
1918
-            $this->messages[$name.'Request']= '0';
1916
+            $this->messages[$name.'Request'] = '0';
1919 1917
         }
1920
-		if($out)
1918
+		if ($out)
1921 1919
 		{
1922
-			foreach($out as $pName => $pType)
1920
+			foreach ($out as $pName => $pType)
1923 1921
 			{
1924
-				if(strpos($pType,':')) {
1922
+				if (strpos($pType, ':')) {
1925 1923
 					$pType = $this->getNamespaceFromPrefix($this->getPrefix($pType)).":".$this->getLocalPart($pType);
1926 1924
 				}
1927 1925
 				$this->messages[$name.'Response'][$pName] = $pType;
1928 1926
 			}
1929 1927
 		} else {
1930
-            $this->messages[$name.'Response']= '0';
1928
+            $this->messages[$name.'Response'] = '0';
1931 1929
         }
1932 1930
 		return true;
1933 1931
 	}
Please login to merge, or discard this patch.