@@ -228,36 +228,51 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | if (isset ($user_id)) { |
| 231 | - if ($paramcount != 0) $sql .= ' AND'; |
|
| 232 | - else $sql .= ' WHERE'; |
|
| 231 | + if ($paramcount != 0) { |
|
| 232 | + $sql .= ' AND'; |
|
| 233 | + } else { |
|
| 234 | + $sql .= ' WHERE'; |
|
| 235 | + } |
|
| 233 | 236 | $sql .= ' user_id = '.intval($user_id); |
| 234 | 237 | $paramcount ++; |
| 235 | 238 | } |
| 236 | 239 | |
| 237 | 240 | if (isset ($course_code) && $course_code <> '-1') { |
| 238 | - if ($paramcount != 0) $sql .= ' AND'; |
|
| 239 | - else $sql .= ' WHERE'; |
|
| 241 | + if ($paramcount != 0) { |
|
| 242 | + $sql .= ' AND'; |
|
| 243 | + } else { |
|
| 244 | + $sql .= ' WHERE'; |
|
| 245 | + } |
|
| 240 | 246 | $sql .= " course_code = '".Database::escape_string($course_code)."'"; |
| 241 | 247 | $paramcount ++; |
| 242 | 248 | } |
| 243 | 249 | |
| 244 | 250 | if (isset ($category_id)) { |
| 245 | - if ($paramcount != 0) $sql .= ' AND'; |
|
| 246 | - else $sql .= ' WHERE'; |
|
| 251 | + if ($paramcount != 0) { |
|
| 252 | + $sql .= ' AND'; |
|
| 253 | + } else { |
|
| 254 | + $sql .= ' WHERE'; |
|
| 255 | + } |
|
| 247 | 256 | $sql .= ' category_id = '.intval($category_id); |
| 248 | 257 | $paramcount ++; |
| 249 | 258 | } |
| 250 | 259 | |
| 251 | 260 | if (isset ($visible)) { |
| 252 | - if ($paramcount != 0) $sql .= ' AND'; |
|
| 253 | - else $sql .= ' WHERE'; |
|
| 261 | + if ($paramcount != 0) { |
|
| 262 | + $sql .= ' AND'; |
|
| 263 | + } else { |
|
| 264 | + $sql .= ' WHERE'; |
|
| 265 | + } |
|
| 254 | 266 | $sql .= ' visible = '.intval($visible); |
| 255 | 267 | $paramcount ++; |
| 256 | 268 | } |
| 257 | 269 | |
| 258 | 270 | if (isset ($locked)) { |
| 259 | - if ($paramcount != 0) $sql .= ' AND'; |
|
| 260 | - else $sql .= ' WHERE'; |
|
| 271 | + if ($paramcount != 0) { |
|
| 272 | + $sql .= ' AND'; |
|
| 273 | + } else { |
|
| 274 | + $sql .= ' WHERE'; |
|
| 275 | + } |
|
| 261 | 276 | $sql .= ' locked = '.intval($locked); |
| 262 | 277 | } |
| 263 | 278 | |
@@ -397,7 +412,7 @@ discard block |
||
| 397 | 412 | .', description = '; |
| 398 | 413 | if (isset($this->description)) { |
| 399 | 414 | $sql .= "'".Database::escape_string($this->get_description())."'"; |
| 400 | - }else { |
|
| 415 | + } else { |
|
| 401 | 416 | $sql .= 'null'; |
| 402 | 417 | } |
| 403 | 418 | $sql .= ', user_id = '.intval($this->get_user_id()) |
@@ -468,7 +483,7 @@ discard block |
||
| 468 | 483 | $sql .= ' AND user_id = '.api_get_user_id(); |
| 469 | 484 | } |
| 470 | 485 | |
| 471 | - }else { |
|
| 486 | + } else { |
|
| 472 | 487 | $sql .= ' AND user_id = '.api_get_user_id(); |
| 473 | 488 | } |
| 474 | 489 | |
@@ -269,8 +269,7 @@ |
||
| 269 | 269 | echo '<br /><br />'; |
| 270 | 270 | echo '</div>'; |
| 271 | 271 | |
| 272 | -} |
|
| 273 | -elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes')) |
|
| 272 | +} elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes')) |
|
| 274 | 273 | { |
| 275 | 274 | $id=$_POST['username_form']; |
| 276 | 275 | $UserList=array(); |
@@ -99,7 +99,10 @@ discard block |
||
| 99 | 99 | <td width="40%" align="center"> |
| 100 | 100 | <select name="user_group_list[]" multiple="multiple" size="20" style="width:400px;"> |
| 101 | 101 | <?php foreach ($dbUserGroups as $item) { ?> |
| 102 | - <option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) echo 'selected="selected"'; ?>><?php echo $item['name']; ?> |
|
| 102 | + <option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) { |
|
| 103 | + echo 'selected="selected"'; |
|
| 104 | +} |
|
| 105 | +?>><?php echo $item['name']; ?> |
|
| 103 | 106 | </option> |
| 104 | 107 | <?php } ?> |
| 105 | 108 | </select> |
@@ -110,7 +113,10 @@ discard block |
||
| 110 | 113 | <td width="40%" align="center"> |
| 111 | 114 | <select name="url_list[]" multiple="multiple" size="20" style="width:300px;"> |
| 112 | 115 | <?php foreach ($db_urls as $url_obj) { ?> |
| 113 | - <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?> |
|
| 116 | + <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) { |
|
| 117 | + echo 'selected="selected"'; |
|
| 118 | +} |
|
| 119 | +?>><?php echo $url_obj['url']; ?> |
|
| 114 | 120 | </option> |
| 115 | 121 | <?php } ?> |
| 116 | 122 | </select> |
@@ -46,14 +46,15 @@ discard block |
||
| 46 | 46 | if (count($classes) == 0 || count($courses) == 0) |
| 47 | 47 | { |
| 48 | 48 | Display::display_error_message(get_lang('AtLeastOneClassAndOneCourse')); |
| 49 | - } |
|
| 50 | - elseif (api_substr($_POST['formSubmit'], -2) == '>>') // add classes to courses |
|
| 49 | + } elseif (api_substr($_POST['formSubmit'], -2) == '>>') { |
|
| 50 | + // add classes to courses |
|
| 51 | 51 | { |
| 52 | 52 | foreach ($courses as $course_code) |
| 53 | 53 | { |
| 54 | 54 | foreach ($classes as $class_id) |
| 55 | 55 | { |
| 56 | 56 | ClassManager :: subscribe_to_course($class_id, $course_code); |
| 57 | + } |
|
| 57 | 58 | } |
| 58 | 59 | } |
| 59 | 60 | Display::display_normal_message(get_lang('ClassesSubscribed')); |
@@ -114,7 +115,10 @@ discard block |
||
| 114 | 115 | foreach ($db_classes as $class) |
| 115 | 116 | { |
| 116 | 117 | ?> |
| 117 | - <option value="<?php echo $class['id']; ?>" <?php if(in_array($class['id'],$classes)) echo 'selected="selected"'; ?>><?php echo $class['name']; ?></option> |
|
| 118 | + <option value="<?php echo $class['id']; ?>" <?php if(in_array($class['id'],$classes)) { |
|
| 119 | + echo 'selected="selected"'; |
|
| 120 | +} |
|
| 121 | +?>><?php echo $class['name']; ?></option> |
|
| 118 | 122 | <?php |
| 119 | 123 | } |
| 120 | 124 | ?> |
@@ -131,7 +135,10 @@ discard block |
||
| 131 | 135 | foreach ($db_courses as $course) |
| 132 | 136 | { |
| 133 | 137 | ?> |
| 134 | - <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>><?php echo '('.$course['visual_code'].') '.$course['title']; ?></option> |
|
| 138 | + <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) { |
|
| 139 | + echo 'selected="selected"'; |
|
| 140 | +} |
|
| 141 | +?>><?php echo '('.$course['visual_code'].') '.$course['title']; ?></option> |
|
| 135 | 142 | <?php |
| 136 | 143 | } |
| 137 | 144 | ?> |
@@ -14,16 +14,14 @@ discard block |
||
| 14 | 14 | if($statut==1) |
| 15 | 15 | { |
| 16 | 16 | echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>'; |
| 17 | - } |
|
| 18 | - else |
|
| 17 | + } else |
|
| 19 | 18 | { |
| 20 | 19 | echo '<input type="hidden" name="mailling" value="1">'; |
| 21 | 20 | } |
| 22 | 21 | if(!empty($course)) |
| 23 | 22 | { |
| 24 | 23 | echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">'; |
| 25 | -} |
|
| 26 | -elseif(!empty($id_session)) |
|
| 24 | +} elseif(!empty($id_session)) |
|
| 27 | 25 | { |
| 28 | 26 | echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">'; |
| 29 | 27 | } |
@@ -42,7 +40,11 @@ discard block |
||
| 42 | 40 | '</tr>'."\n"; |
| 43 | 41 | while (list ($key, $val) = each($nom_form)) { |
| 44 | 42 | $nbre=$nbre+1; |
| 45 | - if($nbre & 1) $ndiv=2; else $ndiv=3; |
|
| 43 | + if($nbre & 1) { |
|
| 44 | + $ndiv=2; |
|
| 45 | + } else { |
|
| 46 | + $ndiv=3; |
|
| 47 | + } |
|
| 46 | 48 | echo '<tr align="center" id="header'.$ndiv.'">'; |
| 47 | 49 | echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
| 48 | 50 | echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |
@@ -50,8 +52,7 @@ discard block |
||
| 50 | 52 | { |
| 51 | 53 | echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
| 52 | 54 | echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
| 53 | - } |
|
| 54 | - else |
|
| 55 | + } else |
|
| 55 | 56 | { |
| 56 | 57 | echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
| 57 | 58 | echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
@@ -200,8 +200,9 @@ |
||
| 200 | 200 | continue; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | - if (is_array($variable_value)) |
|
| 204 | - echo $lang_file; |
|
| 203 | + if (is_array($variable_value)) { |
|
| 204 | + echo $lang_file; |
|
| 205 | + } |
|
| 205 | 206 | $founded = false; |
| 206 | 207 | if ($search_in_english && $search_in_variable) { |
| 207 | 208 | // searching the item in the parent tool |
@@ -533,8 +533,9 @@ |
||
| 533 | 533 | } |
| 534 | 534 | break; |
| 535 | 535 | default: |
| 536 | - if (isset($form)) |
|
| 537 | - $form->display(); |
|
| 536 | + if (isset($form)) { |
|
| 537 | + $form->display(); |
|
| 538 | + } |
|
| 538 | 539 | } |
| 539 | 540 | } |
| 540 | 541 | |
@@ -109,8 +109,7 @@ |
||
| 109 | 109 | $picture_uri = $group_data['picture_uri']; |
| 110 | 110 | if ($group['delete_picture']) { |
| 111 | 111 | $picture_uri = GroupPortalManager::delete_group_picture($group_id); |
| 112 | - } |
|
| 113 | - elseif (!empty($picture['name'])) { |
|
| 112 | + } elseif (!empty($picture['name'])) { |
|
| 114 | 113 | $picture_uri = GroupPortalManager::update_group_picture( |
| 115 | 114 | $group_id, |
| 116 | 115 | $_FILES['picture']['name'], |
@@ -108,8 +108,9 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | api_display_tool_title($tool_name); |
| 110 | 110 | |
| 111 | -if (isset($_GET['action']) && $_GET['action'] == 'show_message') |
|
| 111 | +if (isset($_GET['action']) && $_GET['action'] == 'show_message') { |
|
| 112 | 112 | Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message']))); |
| 113 | +} |
|
| 113 | 114 | |
| 114 | 115 | $no_course_list = $course_list = array(); |
| 115 | 116 | $ajax_search = $add_type == 'unique' ? true : false; |
@@ -261,10 +262,11 @@ discard block |
||
| 261 | 262 | <td colspan="3" align="center"> |
| 262 | 263 | <br /> |
| 263 | 264 | <?php |
| 264 | - if(isset($_GET['add'])) |
|
| 265 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
| 266 | - else |
|
| 267 | - echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
| 265 | + if(isset($_GET['add'])) { |
|
| 266 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('AddCoursesToURL').'</button>'; |
|
| 267 | + } else { |
|
| 268 | + echo '<button class="btn btn-default" onclick="valide()" >'.get_lang('EditCoursesToURL').'</button>'; |
|
| 269 | + } |
|
| 268 | 270 | ?> |
| 269 | 271 | </td> |
| 270 | 272 | </tr> |