@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $course_title = null; |
22 | 22 | $xajax_response = new xajaxResponse(); |
23 | 23 | $return = ''; |
24 | - if(!empty($needle) && !empty($type)) { |
|
24 | + if (!empty($needle) && !empty($type)) { |
|
25 | 25 | // xajax send utf8 datas... datas in db can be non-utf8 datas |
26 | 26 | $charset = api_get_system_encoding(); |
27 | 27 | $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | while ($row = Database::fetch_row($res)) { |
39 | 39 | $course_codes .= '\''.$row[0].'\','; |
40 | 40 | } |
41 | - $course_codes = substr($course_codes,0,(strlen($course_codes)-1)); |
|
41 | + $course_codes = substr($course_codes, 0, (strlen($course_codes) - 1)); |
|
42 | 42 | |
43 | 43 | $cond_course_code = ' AND course.id NOT IN('.$course_codes.') '; |
44 | 44 | } |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | if (api_is_multiple_url_enabled()) { |
70 | 70 | $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
71 | 71 | $access_url_id = api_get_current_access_url_id(); |
72 | - if ($access_url_id != -1){ |
|
72 | + if ($access_url_id != -1) { |
|
73 | 73 | |
74 | - if ($type=='single') { |
|
74 | + if ($type == 'single') { |
|
75 | 75 | $sql = 'SELECT |
76 | 76 | course.id, |
77 | 77 | course.visual_code, |
@@ -104,19 +104,19 @@ discard block |
||
104 | 104 | if ($type == 'single') { |
105 | 105 | while ($course = Database :: fetch_array($rs)) { |
106 | 106 | $course_list[] = $course['code']; |
107 | - $course_title=str_replace("'","\'",$course_title); |
|
107 | + $course_title = str_replace("'", "\'", $course_title); |
|
108 | 108 | $return .= '<a href="javascript: void(0);" onclick="javascript: add_course_to_session(\''.$course['id'].'\',\''.$course_title.' ('.$course['visual_code'].')'.'\')">'.$course['title'].' ('.$course['visual_code'].')</a><br />'; |
109 | 109 | } |
110 | - $xajax_response -> addAssign('ajax_list_courses_single','innerHTML',api_utf8_encode($return)); |
|
110 | + $xajax_response -> addAssign('ajax_list_courses_single', 'innerHTML', api_utf8_encode($return)); |
|
111 | 111 | } else { |
112 | 112 | $return .= '<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:340px;">'; |
113 | - while($course = Database :: fetch_array($rs)) { |
|
113 | + while ($course = Database :: fetch_array($rs)) { |
|
114 | 114 | $course_list[] = $course['code']; |
115 | - $course_title=str_replace("'","\'",$course_title); |
|
116 | - $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')',ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>'; |
|
115 | + $course_title = str_replace("'", "\'", $course_title); |
|
116 | + $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['title'].' ('.$course['visual_code'].')', ENT_QUOTES).'">'.$course['title'].' ('.$course['visual_code'].')</option>'; |
|
117 | 117 | } |
118 | 118 | $return .= '</select>'; |
119 | - $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
119 | + $xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return)); |
|
120 | 120 | } |
121 | 121 | } |
122 | 122 | $_SESSION['course_list'] = $course_list; |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | // the form |
74 | 74 | if (api_is_platform_admin() || api_is_course_admin() || api_is_course_tutor() || api_is_course_coach()) { |
75 | 75 | $actions .= '<a id="export_opener" href="'.api_get_self().'?export_report=1&path='.$hotpotatoes_path.' ">'. |
76 | - Display::return_icon('save.png', get_lang('Export'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
76 | + Display::return_icon('save.png', get_lang('Export'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
77 | 77 | } |
78 | 78 | } else { |
79 | - $actions .= '<a href="exercise.php">' . |
|
80 | - Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
79 | + $actions .= '<a href="exercise.php">'. |
|
80 | + Display :: return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if ($is_allowedToEdit) { |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | |
100 | 100 | if ($is_allowedToEdit || $is_tutor) { |
101 | 101 | $nameTools = get_lang('StudentScore'); |
102 | - $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
102 | + $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
103 | 103 | $objExerciseTmp = new Exercise(); |
104 | 104 | /*if ($objExerciseTmp->read($exercise_id)) { |
105 | 105 | $interbreadcrumb[] = array("url" => "admin.php?exerciseId=".$exercise_id, "name" => $objExerciseTmp->name); |
106 | 106 | }*/ |
107 | 107 | } else { |
108 | - $interbreadcrumb[] = array("url" => "exercise.php","name" => get_lang('Exercises')); |
|
108 | + $interbreadcrumb[] = array("url" => "exercise.php", "name" => get_lang('Exercises')); |
|
109 | 109 | $objExerciseTmp = new Exercise(); |
110 | 110 | /*if ($objExerciseTmp->read($exercise_id)) { |
111 | 111 | $nameTools = get_lang('Results').': '.$objExerciseTmp->name; |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | // Generating group list |
169 | 169 | |
170 | 170 | $group_list = GroupManager::get_group_list(); |
171 | -$group_parameters = array('group_all:'.get_lang('All'),'group_none:'.get_lang('None')); |
|
171 | +$group_parameters = array('group_all:'.get_lang('All'), 'group_none:'.get_lang('None')); |
|
172 | 172 | |
173 | 173 | foreach ($group_list as $group) { |
174 | 174 | $group_parameters[] = $group['id'].':'.$group['name']; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | $userId = api_get_user_id(); |
23 | 23 | |
24 | 24 | $this_section = SECTION_COURSES; |
25 | -$current_course_tool = TOOL_GROUP; |
|
25 | +$current_course_tool = TOOL_GROUP; |
|
26 | 26 | |
27 | 27 | // Notice for unauthorized people. |
28 | 28 | api_protect_course_script(true); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | Display::return_icon('add-groups.png', get_lang('NewGroupCreate'), '', ICON_SIZE_MEDIUM).'</a>'; |
171 | 171 | |
172 | 172 | if (api_get_setting('allow_group_categories') === 'true') { |
173 | - $actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'. |
|
173 | + $actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&action=add_category">'. |
|
174 | 174 | Display::return_icon('new_folder.png', get_lang('AddCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
175 | 175 | } else { |
176 | 176 | $actionsLeft .= '<a href="group_category.php?'.api_get_cidreq().'&id=2">'. |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $actions = null; |
226 | 226 | if (api_is_allowed_to_edit(false, true) && !empty($categoryId)) { |
227 | 227 | $actions .= '<a href="group_category.php?'.api_get_cidreq().'&id='.$categoryId.'" title="'.get_lang('Edit').'">'. |
228 | - Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>'; |
|
228 | + Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>'; |
|
229 | 229 | $actions .= |
230 | 230 | Display::url( |
231 | 231 | Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL), |
@@ -235,17 +235,17 @@ discard block |
||
235 | 235 | ) |
236 | 236 | ); |
237 | 237 | if ($index != 0) { |
238 | - $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index -1]['id'].'">'. |
|
239 | - Display::return_icon('up.png',' ','',ICON_SIZE_SMALL).'</a>'; |
|
238 | + $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index - 1]['id'].'">'. |
|
239 | + Display::return_icon('up.png', ' ', '', ICON_SIZE_SMALL).'</a>'; |
|
240 | 240 | } |
241 | 241 | if ($index != count($group_cats) - 1) { |
242 | - $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index +1]['id'].'">'. |
|
243 | - Display::return_icon('down.png',' ','',ICON_SIZE_SMALL).'</a>'; |
|
242 | + $actions .= ' <a href="group.php?'.api_get_cidreq().'&action=swap_cat_order&id1='.$categoryId.'&id2='.$group_cats[$index + 1]['id'].'">'. |
|
243 | + Display::return_icon('down.png', ' ', '', ICON_SIZE_SMALL).'</a>'; |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
247 | 247 | echo Display::page_header( |
248 | - Security::remove_XSS($category['title'].' '. $label.' ').$actions, |
|
248 | + Security::remove_XSS($category['title'].' '.$label.' ').$actions, |
|
249 | 249 | null, |
250 | 250 | 'h4', |
251 | 251 | false |
@@ -16,7 +16,7 @@ |
||
16 | 16 | api_protect_admin_script(true); |
17 | 17 | |
18 | 18 | // setting breadcrumbs |
19 | -$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
19 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
20 | 20 | |
21 | 21 | $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX); |
22 | 22 | $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton')); |
@@ -36,22 +36,22 @@ discard block |
||
36 | 36 | if (substr($url, strlen($url) - 1, strlen($url)) == '/') { |
37 | 37 | UrlManager::update($url_id, $url, $description, $active); |
38 | 38 | } else { |
39 | - UrlManager::update($url_id, $url . '/', $description, $active); |
|
39 | + UrlManager::update($url_id, $url.'/', $description, $active); |
|
40 | 40 | } |
41 | 41 | // URL Images |
42 | - $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; |
|
42 | + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; |
|
43 | 43 | $image_fields = array("url_image_1", "url_image_2", "url_image_3"); |
44 | 44 | foreach ($image_fields as $image_field) { |
45 | 45 | if ($_FILES[$image_field]['error'] == 0) { |
46 | 46 | // Hardcoded: only PNG files allowed |
47 | 47 | $fileFields = explode('.', $_FILES[$image_field]['name']); |
48 | 48 | if (end($fileFields) == 'png') { |
49 | - if (file_exists($url_images_dir . $url_id . '_' . $image_field . '.png')) { |
|
49 | + if (file_exists($url_images_dir.$url_id.'_'.$image_field.'.png')) { |
|
50 | 50 | // if the file exists, we have to remove it before move_uploaded_file |
51 | - unlink($url_images_dir . $url_id . '_' . $image_field . '.png'); |
|
51 | + unlink($url_images_dir.$url_id.'_'.$image_field.'.png'); |
|
52 | 52 | } |
53 | 53 | move_uploaded_file( |
54 | - $_FILES[$image_field]['tmp_name'], $url_images_dir . $url_id . '_' . $image_field . '.png' |
|
54 | + $_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png' |
|
55 | 55 | ); |
56 | 56 | } |
57 | 57 | // else fail silently |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | UrlManager::add($url, $description, $active); |
69 | 69 | } else { |
70 | 70 | //create |
71 | - UrlManager::add($url . '/', $description, $active); |
|
71 | + UrlManager::add($url.'/', $description, $active); |
|
72 | 72 | } |
73 | 73 | $message = get_lang('URLAdded'); |
74 | 74 | $url_to_go = 'access_urls.php'; |
@@ -79,14 +79,14 @@ discard block |
||
79 | 79 | // URL Images |
80 | 80 | $url .= (substr($url, strlen($url) - 1, strlen($url)) == '/') ? '' : '/'; |
81 | 81 | $url_id = UrlManager::get_url_id($url); |
82 | - $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; |
|
82 | + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; |
|
83 | 83 | $image_fields = array("url_image_1", "url_image_2", "url_image_3"); |
84 | 84 | foreach ($image_fields as $image_field) { |
85 | 85 | if ($_FILES[$image_field]['error'] == 0) { |
86 | 86 | // Hardcoded: only PNG files allowed |
87 | 87 | $fileFields = explode('.', $_FILES[$image_field]['name']); |
88 | 88 | if (end($fileFields) == 'png') { |
89 | - move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir . $url_id . '_' . $image_field . '.png'); |
|
89 | + move_uploaded_file($_FILES[$image_field]['tmp_name'], $url_images_dir.$url_id.'_'.$image_field.'.png'); |
|
90 | 90 | } |
91 | 91 | // else fail silently |
92 | 92 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | Security::clear_token(); |
97 | 97 | $tok = Security::get_token(); |
98 | 98 | Display::addFlash(Display::return_message($message)); |
99 | - header('Location: ' . $url_to_go . '?sec_token=' . $tok); |
|
99 | + header('Location: '.$url_to_go.'?sec_token='.$tok); |
|
100 | 100 | exit(); |
101 | 101 | } |
102 | 102 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | function send() { |
60 | 60 | if (document.formulaire.access_url_id.value!=0) { |
61 | 61 | document.formulaire.form_sent.value=0; |
62 | - document.formulaire.add_type.value=\'' . $add_type . '\'; |
|
62 | + document.formulaire.add_type.value=\'' . $add_type.'\'; |
|
63 | 63 | document.formulaire.submit(); |
64 | 64 | } |
65 | 65 | } |
@@ -95,17 +95,17 @@ discard block |
||
95 | 95 | $result = UrlManager::update_urls_rel_user($UserList, $access_url_id); |
96 | 96 | $url_info = UrlManager::get_url_data_from_id($access_url_id); |
97 | 97 | if (!empty($result)) { |
98 | - $message .= 'URL: ' . $url_info['url'] . '<br />'; |
|
98 | + $message .= 'URL: '.$url_info['url'].'<br />'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if (!empty($result['users_added'])) { |
102 | - $message .= '<h4>' . get_lang('UsersAdded') . ':</h4>'; |
|
102 | + $message .= '<h4>'.get_lang('UsersAdded').':</h4>'; |
|
103 | 103 | $i = 1; |
104 | 104 | $user_added_list = array(); |
105 | 105 | foreach ($result['users_added'] as $user) { |
106 | 106 | $user_info = api_get_user_info($user); |
107 | 107 | if (!empty($user_info)) { |
108 | - $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
108 | + $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']); |
|
109 | 109 | $i++; |
110 | 110 | } |
111 | 111 | } |
@@ -115,13 +115,13 @@ discard block |
||
115 | 115 | } |
116 | 116 | |
117 | 117 | if (!empty($result['users_deleted'])) { |
118 | - $message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>'; |
|
118 | + $message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>'; |
|
119 | 119 | $user_deleted_list = array(); |
120 | 120 | $i = 1; |
121 | 121 | foreach ($result['users_deleted'] as $user) { |
122 | 122 | $user_info = api_get_user_info($user); |
123 | 123 | if (!empty($user_info)) { |
124 | - $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
124 | + $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']); |
|
125 | 125 | $i++; |
126 | 126 | } |
127 | 127 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | echo '<div class="actions">'; |
143 | 143 | echo Display::url( |
144 | 144 | Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), |
145 | - api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php' |
|
145 | + api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php' |
|
146 | 146 | ); |
147 | 147 | echo '</div>'; |
148 | 148 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | } |
168 | 168 | |
169 | 169 | $sql = "SELECT u.user_id, lastname, firstname, username |
170 | - FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " . |
|
170 | + FROM $tbl_user u WHERE status <> ".ANONYMOUS." ". |
|
171 | 171 | $order_clause; |
172 | 172 | $result = Database::query($sql); |
173 | 173 | $Users = Database::store_result($result); |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | if ($add_type == 'multiple') { |
183 | - $link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>'; |
|
183 | + $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>'; |
|
184 | 184 | $link_add_type_multiple = get_lang('SessionAddTypeMultiple'); |
185 | 185 | } else { |
186 | 186 | $link_add_type_unique = get_lang('SessionAddTypeUnique'); |
187 | - $link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>'; |
|
187 | + $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>'; |
|
188 | 188 | } |
189 | 189 | $url_list = UrlManager::get_url_data(); |
190 | 190 | ?> |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) { |
197 | 197 | echo ' onsubmit="valide();"'; |
198 | 198 | } ?> > |
199 | - <?php echo get_lang('SelectUrl') . ' : '; ?> |
|
199 | + <?php echo get_lang('SelectUrl').' : '; ?> |
|
200 | 200 | <select name="access_url_id" onchange="javascript:send();"> |
201 | 201 | <option value="0"> <?php echo get_lang('SelectUrl') ?></option> |
202 | 202 | <?php |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | <td> |
233 | 233 | <h3> |
234 | 234 | <?php |
235 | - $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
235 | + $total_users = count($nosessionUsersList) + count($sessionUsersList); |
|
236 | 236 | echo get_lang('TotalAvailableUsers').' '.$total_users; |
237 | 237 | ?> |
238 | 238 | </h3> |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b> |
243 | 243 | </td> |
244 | 244 | <td></td> |
245 | - <td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
245 | + <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td> |
|
246 | 246 | </tr> |
247 | 247 | <tr> |
248 | 248 | <td align="center"> |
@@ -302,9 +302,9 @@ discard block |
||
302 | 302 | <br /> |
303 | 303 | <?php |
304 | 304 | if (isset($_GET['add'])) { |
305 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>'; |
|
305 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>'; |
|
306 | 306 | } else { |
307 | - echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>'; |
|
307 | + echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>'; |
|
308 | 308 | } |
309 | 309 | ?> |
310 | 310 | </td> |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | WHERE |
43 | 43 | course_user.status='1' AND |
44 | 44 | course_user.user_id=user.user_id AND |
45 | - course_user.c_id ='" . $courseId . "'" . |
|
45 | + course_user.c_id ='".$courseId."'". |
|
46 | 46 | $order_clause; |
47 | 47 | $res = Database::query($sql); |
48 | 48 | $course_teachers = array(); |
@@ -58,18 +58,18 @@ discard block |
||
58 | 58 | INNER JOIN $access_url_rel_user_table url_rel_user |
59 | 59 | ON (u.user_id=url_rel_user.user_id) |
60 | 60 | WHERE |
61 | - url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND |
|
61 | + url_rel_user.access_url_id=".api_get_current_access_url_id()." AND |
|
62 | 62 | status=1" . $order_clause; |
63 | 63 | } else { |
64 | 64 | $sql = "SELECT user_id, lastname, firstname |
65 | - FROM $table_user WHERE status='1'" . $order_clause; |
|
65 | + FROM $table_user WHERE status='1'".$order_clause; |
|
66 | 66 | } |
67 | 67 | $courseInfo['tutor_name'] = null; |
68 | 68 | |
69 | 69 | $res = Database::query($sql); |
70 | 70 | $teachers = array(); |
71 | 71 | $allTeachers = array(); |
72 | -$platform_teachers[0] = '-- ' . get_lang('NoManager') . ' --'; |
|
72 | +$platform_teachers[0] = '-- '.get_lang('NoManager').' --'; |
|
73 | 73 | while ($obj = Database::fetch_object($res)) { |
74 | 74 | $allTeachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname); |
75 | 75 | if (!array_key_exists($obj->user_id, $course_teachers)) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | // Case where there is no teacher in the course |
89 | 89 | if (count($course_teachers) == 0) { |
90 | - $sql = 'SELECT tutor_name FROM ' . $course_table . ' WHERE code="' . $course_code . '"'; |
|
90 | + $sql = 'SELECT tutor_name FROM '.$course_table.' WHERE code="'.$course_code.'"'; |
|
91 | 91 | $res = Database::query($sql); |
92 | 92 | $tutor_name = Database::result($res, 0, 0); |
93 | 93 | $courseInfo['tutor_name'] = array_search($tutor_name, $platform_teachers); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | // Build the form |
97 | 97 | $form = new FormValidator('update_course', 'post', api_get_self().'?id='.$courseId); |
98 | -$form->addElement('header', get_lang('Course') . ' #' . $courseInfo['real_id'] . ' ' . $course_code); |
|
98 | +$form->addElement('header', get_lang('Course').' #'.$courseInfo['real_id'].' '.$course_code); |
|
99 | 99 | $form->addElement('hidden', 'code', $course_code); |
100 | 100 | |
101 | 101 | //title |
@@ -151,14 +151,14 @@ discard block |
||
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | - $groupName = 'session_coaches[' . $sessionId . ']'; |
|
155 | - $platformTeacherId = 'platform_teachers_by_session_' . $sessionId; |
|
156 | - $coachId = 'coaches_by_session_' . $sessionId; |
|
154 | + $groupName = 'session_coaches['.$sessionId.']'; |
|
155 | + $platformTeacherId = 'platform_teachers_by_session_'.$sessionId; |
|
156 | + $coachId = 'coaches_by_session_'.$sessionId; |
|
157 | 157 | |
158 | 158 | $platformTeacherName = 'platform_teachers_by_session'; |
159 | 159 | $coachName = 'coaches_by_session'; |
160 | 160 | |
161 | - $sessionUrl = api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $sessionId; |
|
161 | + $sessionUrl = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId; |
|
162 | 162 | $form->addElement( |
163 | 163 | 'advmultiselect', |
164 | 164 | $groupName, |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $session['name'], |
167 | 167 | $sessionUrl, |
168 | 168 | array('target' => '_blank') |
169 | - ) . ' - ' . get_lang('Coaches'), |
|
169 | + ).' - '.get_lang('Coaches'), |
|
170 | 170 | $allTeachers |
171 | 171 | ); |
172 | 172 | $courseInfo[$groupName] = $sessionTeachers; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | |
176 | 176 | // Category code |
177 | -$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category'; |
|
177 | +$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category'; |
|
178 | 178 | |
179 | 179 | $categorySelect = $form->addElement( |
180 | 180 | 'select_ajax', |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | $form->applyFilter('select_language', 'html_filter'); |
202 | 202 | |
203 | 203 | $group = array(); |
204 | -$group[]= $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); |
|
205 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); |
|
206 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); |
|
207 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); |
|
208 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN); |
|
204 | +$group[] = $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); |
|
205 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); |
|
206 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); |
|
207 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); |
|
208 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN); |
|
209 | 209 | $form->addGroup($group, '', get_lang('CourseAccess')); |
210 | 210 | |
211 | 211 | $group = array(); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | $htmlHeadXtra[] = ' |
230 | 230 | <script> |
231 | 231 | $(function() { |
232 | - ' . $extra['jquery_ready_content'] . ' |
|
232 | + ' . $extra['jquery_ready_content'].' |
|
233 | 233 | }); |
234 | 234 | </script>'; |
235 | 235 | |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | foreach ($list as $course_temp) { |
285 | 285 | if ($course_temp['code'] != $course_code) { |
286 | 286 | $visual_code_is_used = true; |
287 | - $warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),'; |
|
287 | + $warn .= ' '.$course_temp['title'].' ('.$course_temp['code'].'),'; |
|
288 | 288 | } |
289 | 289 | } |
290 | 290 | $warn = substr($warn, 0, -1); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $course['course_code'] = $course_code; |
304 | 304 | |
305 | 305 | if (!stristr($department_url, 'http://')) { |
306 | - $department_url = 'http://' . $department_url; |
|
306 | + $department_url = 'http://'.$department_url; |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | Database::query($sql); |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) { |
369 | 369 | $sql = "UPDATE $course_table SET |
370 | 370 | add_teachers_to_sessions_courses = '$addTeacherToSessionCourses' |
371 | - WHERE id = " . $courseInfo['real_id']; |
|
371 | + WHERE id = ".$courseInfo['real_id']; |
|
372 | 372 | Database::query($sql); |
373 | 373 | } |
374 | 374 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | WHERE status=1".$order_clause; |
24 | 24 | // Filtering teachers when creating a course. |
25 | 25 | if (api_is_multiple_url_enabled()) { |
26 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
26 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
27 | 27 | $sql = "SELECT u.user_id,lastname,firstname |
28 | 28 | FROM $table_user as u |
29 | 29 | INNER JOIN $access_url_rel_user_table url_rel_user |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | ); |
93 | 93 | |
94 | 94 | // Course department |
95 | -$form->addText('department_name', get_lang('CourseDepartment'), false, array ('size' => '60')); |
|
95 | +$form->addText('department_name', get_lang('CourseDepartment'), false, array('size' => '60')); |
|
96 | 96 | $form->applyFilter('department_name', 'html_filter'); |
97 | 97 | $form->applyFilter('department_name', 'trim'); |
98 | 98 | |
99 | 99 | // Department URL |
100 | -$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array ('size' => '60')); |
|
100 | +$form->addText('department_url', get_lang('CourseDepartmentURL'), false, array('size' => '60')); |
|
101 | 101 | $form->applyFilter('department_url', 'html_filter'); |
102 | 102 | |
103 | 103 | // Course language. |
@@ -125,32 +125,32 @@ discard block |
||
125 | 125 | get_lang('PickACourseAsATemplateForThisNewCourse'), |
126 | 126 | ], |
127 | 127 | null, |
128 | - ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course'] |
|
128 | + ['url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course'] |
|
129 | 129 | ); |
130 | 130 | } |
131 | 131 | |
132 | 132 | $form->addElement('checkbox', 'exemplary_content', '', get_lang('FillWithExemplaryContent')); |
133 | 133 | |
134 | 134 | $group = array(); |
135 | -$group[]= $form->createElement('radio', 'visibility', get_lang('CourseAccess'), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); |
|
136 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); |
|
137 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); |
|
138 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); |
|
139 | -$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN); |
|
135 | +$group[] = $form->createElement('radio', 'visibility', get_lang('CourseAccess'), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD); |
|
136 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM); |
|
137 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED); |
|
138 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED); |
|
139 | +$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN); |
|
140 | 140 | |
141 | -$form->addGroup($group,'', get_lang('CourseAccess')); |
|
141 | +$form->addGroup($group, '', get_lang('CourseAccess')); |
|
142 | 142 | |
143 | 143 | $group = array(); |
144 | -$group[]= $form->createElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1); |
|
145 | -$group[]= $form->createElement('radio', 'subscribe', null, get_lang('Denied'), 0); |
|
146 | -$form->addGroup($group,'', get_lang('Subscription')); |
|
144 | +$group[] = $form->createElement('radio', 'subscribe', get_lang('Subscription'), get_lang('Allowed'), 1); |
|
145 | +$group[] = $form->createElement('radio', 'subscribe', null, get_lang('Denied'), 0); |
|
146 | +$form->addGroup($group, '', get_lang('Subscription')); |
|
147 | 147 | |
148 | 148 | $group = array(); |
149 | -$group[]= $form->createElement('radio', 'unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1); |
|
150 | -$group[]= $form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0); |
|
149 | +$group[] = $form->createElement('radio', 'unsubscribe', get_lang('Unsubscription'), get_lang('AllowedToUnsubscribe'), 1); |
|
150 | +$group[] = $form->createElement('radio', 'unsubscribe', null, get_lang('NotAllowedToUnsubscribe'), 0); |
|
151 | 151 | $form->addGroup($group, '', get_lang('Unsubscription')); |
152 | 152 | |
153 | -$form->addElement('text','disk_quota',array(get_lang('CourseQuota'), null, get_lang('MB'))); |
|
153 | +$form->addElement('text', 'disk_quota', array(get_lang('CourseQuota'), null, get_lang('MB'))); |
|
154 | 154 | $form->addRule('disk_quota', get_lang('ThisFieldShouldBeNumeric'), 'numeric'); |
155 | 155 | |
156 | 156 | $obj = new GradeModel(); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $extra_field = new ExtraField('course'); |
161 | 161 | $extra = $extra_field->addElements($form); |
162 | 162 | |
163 | -$htmlHeadXtra[] =' |
|
163 | +$htmlHeadXtra[] = ' |
|
164 | 164 | <script> |
165 | 165 | |
166 | 166 | $(function() { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | // Set some default values. |
175 | 175 | $values['course_language'] = api_get_setting('platformLanguage'); |
176 | -$values['disk_quota'] = round(api_get_setting('default_document_quotum')/1024/1024, 1); |
|
176 | +$values['disk_quota'] = round(api_get_setting('default_document_quotum') / 1024 / 1024, 1); |
|
177 | 177 | |
178 | 178 | $default_course_visibility = api_get_setting('courses_default_creation_visibility'); |
179 | 179 | |
@@ -193,16 +193,16 @@ discard block |
||
193 | 193 | $course = $form->exportValues(); |
194 | 194 | |
195 | 195 | $course_teachers = isset($course['course_teachers']) ? $course['course_teachers'] : null; |
196 | - $course['disk_quota'] = $course['disk_quota']*1024*1024; |
|
196 | + $course['disk_quota'] = $course['disk_quota'] * 1024 * 1024; |
|
197 | 197 | $course['exemplary_content'] = empty($course['exemplary_content']) ? false : true; |
198 | 198 | $course['teachers'] = $course_teachers; |
199 | 199 | $course['wanted_code'] = $course['visual_code']; |
200 | - $course['gradebook_model_id'] = isset($course['gradebook_model_id']) ? $course['gradebook_model_id'] : null; |
|
200 | + $course['gradebook_model_id'] = isset($course['gradebook_model_id']) ? $course['gradebook_model_id'] : null; |
|
201 | 201 | // Fixing category code |
202 | - $course['course_category'] = isset($course['category_code']) ? $course['category_code'] : ''; |
|
202 | + $course['course_category'] = isset($course['category_code']) ? $course['category_code'] : ''; |
|
203 | 203 | |
204 | - include_once api_get_path(SYS_CODE_PATH) . 'lang/english/trad4all.inc.php'; |
|
205 | - $file_to_include = api_get_path(SYS_CODE_PATH) . 'lang/' . $course['course_language'] . '/trad4all.inc.php'; |
|
204 | + include_once api_get_path(SYS_CODE_PATH).'lang/english/trad4all.inc.php'; |
|
205 | + $file_to_include = api_get_path(SYS_CODE_PATH).'lang/'.$course['course_language'].'/trad4all.inc.php'; |
|
206 | 206 | |
207 | 207 | if (file_exists($file_to_include)) { |
208 | 208 | include $file_to_include; |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | */ |
21 | 21 | protected function changeUserActiveState($user_id_field_name, $user_id_value, $state) { |
22 | 22 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
23 | - if($user_id instanceof WSError) { |
|
23 | + if ($user_id instanceof WSError) { |
|
24 | 24 | return $user_id; |
25 | 25 | } else { |
26 | - if($state == 0) { |
|
26 | + if ($state == 0) { |
|
27 | 27 | UserManager::disable($user_id); |
28 | - } else if($state == 1) { |
|
28 | + } else if ($state == 1) { |
|
29 | 29 | UserManager::enable($user_id); |
30 | 30 | } |
31 | 31 | } |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function changeUsersActiveState($users, $state) { |
42 | 42 | $results = array(); |
43 | - foreach($users as $user) { |
|
43 | + foreach ($users as $user) { |
|
44 | 44 | $result_tmp = array(); |
45 | 45 | $result_op = $this->changeUserActiveState($user['user_id_field_name'], $user['user_id_value'], $state); |
46 | 46 | $result_tmp['user_id_value'] = $user['user_id_value']; |
47 | - if($result_op instanceof WSError) { |
|
47 | + if ($result_op instanceof WSError) { |
|
48 | 48 | // Return the error in the results |
49 | 49 | $result_tmp['result'] = $result_op->toArray(); |
50 | 50 | } else { |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function DisableUser($secret_key, $user_id_field_name, $user_id_value) { |
66 | 66 | $verifKey = $this->verifyKey($secret_key); |
67 | - if($verifKey instanceof WSError) { |
|
67 | + if ($verifKey instanceof WSError) { |
|
68 | 68 | // Let the implementation handle it |
69 | 69 | $this->handleError($verifKey); |
70 | 70 | } else { |
71 | 71 | $result = $this->changeUserActiveState($user_id_field_name, $user_id_value, 0); |
72 | - if($result instanceof WSError) { |
|
72 | + if ($result instanceof WSError) { |
|
73 | 73 | $this->handleError($result); |
74 | 74 | } |
75 | 75 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function DisableUsers($secret_key, $users) { |
87 | 87 | $verifKey = $this->verifyKey($secret_key); |
88 | - if($verifKey instanceof WSError) { |
|
88 | + if ($verifKey instanceof WSError) { |
|
89 | 89 | // Let the implementation handle it |
90 | 90 | $this->handleError($verifKey); |
91 | 91 | } else { |
@@ -102,11 +102,11 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function EnableUser($secret_key, $user_id_field_name, $user_id_value) { |
104 | 104 | $verifKey = $this->verifyKey($secret_key); |
105 | - if($verifKey instanceof WSError) { |
|
105 | + if ($verifKey instanceof WSError) { |
|
106 | 106 | $this->handleError($verifKey); |
107 | 107 | } else { |
108 | 108 | $result = $this->changeUserActiveState($user_id_field_name, $user_id_value, 1); |
109 | - if($result instanceof WSError) { |
|
109 | + if ($result instanceof WSError) { |
|
110 | 110 | $this->handleError($result); |
111 | 111 | } |
112 | 112 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function EnableUsers($secret_key, $users) { |
124 | 124 | $verifKey = $this->verifyKey($secret_key); |
125 | - if($verifKey instanceof WSError) { |
|
125 | + if ($verifKey instanceof WSError) { |
|
126 | 126 | // Let the implementation handle it |
127 | 127 | $this->handleError($verifKey); |
128 | 128 | } else { |
@@ -139,10 +139,10 @@ discard block |
||
139 | 139 | */ |
140 | 140 | protected function deleteUserHelper($user_id_field_name, $user_id_value) { |
141 | 141 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
142 | - if($user_id instanceof WSError) { |
|
142 | + if ($user_id instanceof WSError) { |
|
143 | 143 | return $user_id; |
144 | 144 | } else { |
145 | - if(!UserManager::delete_user($user_id)) { |
|
145 | + if (!UserManager::delete_user($user_id)) { |
|
146 | 146 | return new WSError(101, "There was a problem while deleting this user"); |
147 | 147 | } else { |
148 | 148 | return true; |
@@ -159,11 +159,11 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function DeleteUser($secret_key, $user_id_field_name, $user_id_value) { |
161 | 161 | $verifKey = $this->verifyKey($secret_key); |
162 | - if($verifKey instanceof WSError) { |
|
162 | + if ($verifKey instanceof WSError) { |
|
163 | 163 | $this->handleError($verifKey); |
164 | 164 | } else { |
165 | 165 | $result = $this->deleteUserHelper($user_id_field_name, $user_id_value); |
166 | - if($result instanceof WSError) { |
|
166 | + if ($result instanceof WSError) { |
|
167 | 167 | $this->handleError($result); |
168 | 168 | } |
169 | 169 | } |
@@ -179,15 +179,15 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function DeleteUsers($secret_key, $users) { |
181 | 181 | $verifKey = $this->verifyKey($secret_key); |
182 | - if($verifKey instanceof WSError) { |
|
182 | + if ($verifKey instanceof WSError) { |
|
183 | 183 | $this->handleError($verifKey); |
184 | 184 | } else { |
185 | 185 | $results = array(); |
186 | - foreach($users as $user) { |
|
186 | + foreach ($users as $user) { |
|
187 | 187 | $result_tmp = array(); |
188 | 188 | $result_op = $this->deleteUserHelper($user['user_id_field_name'], $user['user_id_value']); |
189 | 189 | $result_tmp['user_id_value'] = $user['user_id_value']; |
190 | - if($result_op instanceof WSError) { |
|
190 | + if ($result_op instanceof WSError) { |
|
191 | 191 | // Return the error in the results |
192 | 192 | $result_tmp['result'] = $result_op->toArray(); |
193 | 193 | } else { |
@@ -223,11 +223,11 @@ discard block |
||
223 | 223 | |
224 | 224 | // Add the original user id field name and value to the extra fields if needed |
225 | 225 | $extras_associative = array(); |
226 | - if($user_id_field_name != "chamilo_user_id") { |
|
226 | + if ($user_id_field_name != "chamilo_user_id") { |
|
227 | 227 | $extras_associative[$user_id_field_name] = $user_id_value; |
228 | 228 | } |
229 | 229 | if (!empty($extras)) { |
230 | - foreach($extras as $extra) { |
|
230 | + foreach ($extras as $extra) { |
|
231 | 231 | $extras_associative[$extra['field_name']] = $extra['field_value']; |
232 | 232 | } |
233 | 233 | } |
@@ -273,11 +273,11 @@ discard block |
||
273 | 273 | public function CreateUser($secret_key, $firstname, $lastname, $status, $login, $password, $encrypt_method, $user_id_field_name, $user_id_value, $visibility = 1, $email = '', $language = 'english', $phone = '', $expiration_date = '0000-00-00 00:00:00', $extras = array()) { |
274 | 274 | // First, verify the secret key |
275 | 275 | $verifKey = $this->verifyKey($secret_key); |
276 | - if($verifKey instanceof WSError) { |
|
276 | + if ($verifKey instanceof WSError) { |
|
277 | 277 | $this->handleError($verifKey); |
278 | 278 | } else { |
279 | 279 | $result = $this->createUserHelper($firstname, $lastname, $status, $login, $password, $encrypt_method, $user_id_field_name, $user_id_value, $visibility, $email, $language, $phone, $expiration_date, $extras); |
280 | - if($result instanceof WSError) { |
|
280 | + if ($result instanceof WSError) { |
|
281 | 281 | $this->handleError($result); |
282 | 282 | } else { |
283 | 283 | return $result; |
@@ -294,17 +294,17 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function CreateUsers($secret_key, $users) { |
296 | 296 | $verifKey = $this->verifyKey($secret_key); |
297 | - if($verifKey instanceof WSError) { |
|
297 | + if ($verifKey instanceof WSError) { |
|
298 | 298 | $this->handleError($verifKey); |
299 | 299 | } else { |
300 | 300 | $results = array(); |
301 | - foreach($users as $user) { |
|
301 | + foreach ($users as $user) { |
|
302 | 302 | $result_tmp = array(); |
303 | 303 | // re-initialize variables just in case |
304 | 304 | $firstname = $lastname = $status = $login = $password = $encrypt_method = $user_id_field_name = $user_id_value = $visibility = $email = $language = $phone = $expiration_date = $extras = null; |
305 | 305 | extract($user); |
306 | 306 | $result = $this->createUserHelper($firstname, $lastname, $status, $login, $password, $encrypt_method, $user_id_field_name, $user_id_value, $visibility, $email, $language, $phone, $expiration_date, $extras); |
307 | - if($result instanceof WSError) { |
|
307 | + if ($result instanceof WSError) { |
|
308 | 308 | $result_tmp['result'] = $result->toArray(); |
309 | 309 | $result_tmp['user_id_value'] = $user_id_value; |
310 | 310 | $result_tmp['user_id_generated'] = 0; |
@@ -353,10 +353,10 @@ discard block |
||
353 | 353 | $extras |
354 | 354 | ) { |
355 | 355 | $user_id = $this->getUserId($user_id_field_name, $user_id_value); |
356 | - if($user_id instanceof WSError) { |
|
356 | + if ($user_id instanceof WSError) { |
|
357 | 357 | return $user_id; |
358 | 358 | } else { |
359 | - if($password == '') { |
|
359 | + if ($password == '') { |
|
360 | 360 | $password = null; |
361 | 361 | } |
362 | 362 | $user_info = api_get_user_info($user_id); |
@@ -417,19 +417,19 @@ discard block |
||
417 | 417 | public function EditUser($secret_key, $user_id_field_name, $user_id_value, $firstname, $lastname, $status, $loginname, $password, $encrypt_method, $email, $language, $phone, $expiration_date, $extras) { |
418 | 418 | // First, verify the secret key |
419 | 419 | $verifKey = $this->verifyKey($secret_key); |
420 | - if($verifKey instanceof WSError) { |
|
420 | + if ($verifKey instanceof WSError) { |
|
421 | 421 | $this->handleError($verifKey); |
422 | 422 | } else { |
423 | 423 | |
424 | 424 | $extras_associative = array(); |
425 | 425 | if (!empty($extras)) { |
426 | - foreach($extras as $extra) { |
|
426 | + foreach ($extras as $extra) { |
|
427 | 427 | $extras_associative[$extra['field_name']] = $extra['field_value']; |
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | 431 | $result = $this->editUserHelper($user_id_field_name, $user_id_value, $firstname, $lastname, $status, $loginname, $password, $encrypt_method, $email, $language, $phone, $expiration_date, $extras_associative); |
432 | - if($result instanceof WSError) { |
|
432 | + if ($result instanceof WSError) { |
|
433 | 433 | $this->handleError($result); |
434 | 434 | } |
435 | 435 | } |
@@ -445,18 +445,18 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public function EditUsers($secret_key, $users) { |
447 | 447 | $verifKey = $this->verifyKey($secret_key); |
448 | - if($verifKey instanceof WSError) { |
|
448 | + if ($verifKey instanceof WSError) { |
|
449 | 449 | $this->handleError($verifKey); |
450 | 450 | } else { |
451 | 451 | $results = array(); |
452 | - foreach($users as $user) { |
|
452 | + foreach ($users as $user) { |
|
453 | 453 | $result_tmp = array(); |
454 | 454 | // re-initialize variables just in case |
455 | 455 | $user_id_field_name = $user_id_value = $firstname = $lastname = $status = $loginname = $password = $encrypt_method = $email = $language = $phone = $expiration_date = $extras = null; |
456 | 456 | extract($user); |
457 | 457 | $result_op = $this->editUserHelper($user_id_field_name, $user_id_value, $firstname, $lastname, $status, $loginname, $password, $encrypt_method, $email, $language, $phone, $expiration_date, $extras); |
458 | 458 | $result_tmp['user_id_value'] = $user['user_id_value']; |
459 | - if($result_op instanceof WSError) { |
|
459 | + if ($result_op instanceof WSError) { |
|
460 | 460 | // Return the error in the results |
461 | 461 | $result_tmp['result'] = $result_op->toArray(); |
462 | 462 | } else { |