@@ -546,8 +546,9 @@ |
||
546 | 546 | } |
547 | 547 | } else { |
548 | 548 | $store_path = api_get_path(SYS_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; // course path |
549 | - if (file_exists($store_path)) |
|
550 | - $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
549 | + if (file_exists($store_path)) { |
|
550 | + $web_path = api_get_path(WEB_CODE_PATH).'default_course_document/images/'.api_get_current_access_url_id().'_pdf_watermark.png'; |
|
551 | + } |
|
551 | 552 | } |
552 | 553 | return $web_path; |
553 | 554 | } |
@@ -183,11 +183,14 @@ discard block |
||
183 | 183 | while ($row = multiquery_fetch_row($result)) { |
184 | 184 | echo '<tr>'; |
185 | 185 | for ($i = 0; $i < $nfields; $i++) { |
186 | - if (!$columns_islink[$i]) { // ignore links |
|
187 | - if ($columns_link[$i] != '') // link is defined |
|
186 | + if (!$columns_islink[$i]) { |
|
187 | +// ignore links |
|
188 | + if ($columns_link[$i] != '') { |
|
189 | + // link is defined |
|
188 | 190 | { |
189 | 191 | if (substr($columns_link[$i], 0, 10) == 'javascript') { |
190 | 192 | echo '<td><a href="#" onclick="'.$row[$columns_link[$i]].'">'.$row[$i].'</a></td>'; |
193 | + } |
|
191 | 194 | } else { |
192 | 195 | echo '<td><a href="'.$row[$columns_link[$i]].'">'.$row[$i].'</a></td>'; |
193 | 196 | } |
@@ -229,10 +232,12 @@ discard block |
||
229 | 232 | echo "\n"; |
230 | 233 | while ($row = multiquery_fetch_row($result)) { |
231 | 234 | for ($i = 0; $i < $nfields; $i++) { |
232 | - if (!$columns_islink[$i]) // ignore links |
|
235 | + if (!$columns_islink[$i]) { |
|
236 | + // ignore links |
|
233 | 237 | { |
234 | 238 | echo csv_escaping($row[$i]).','; |
235 | 239 | } |
240 | + } |
|
236 | 241 | } // fixme |
237 | 242 | echo "\n"; |
238 | 243 | } |
@@ -117,7 +117,8 @@ discard block |
||
117 | 117 | |
118 | 118 | //checking for extra field with filter on |
119 | 119 | |
120 | -function search_usergroup_sessions($needle, $type) { |
|
120 | +function search_usergroup_sessions($needle, $type) |
|
121 | +{ |
|
121 | 122 | global $elements_in; |
122 | 123 | $xajax_response = new xajaxResponse(); |
123 | 124 | $return = ''; |
@@ -172,7 +173,10 @@ discard block |
||
172 | 173 | echo '<div id="advancedSearch" style="display: none">'.get_lang('SearchSessions'); ?> : |
173 | 174 | <input name="SearchSession" onchange = "xajax_search_usergroup_sessions(this.value,'searchbox')" onkeyup="this.onchange()"> |
174 | 175 | </div> |
175 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
176 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) { |
|
177 | + echo '&add=true'; |
|
178 | +} |
|
179 | +?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
176 | 180 | <?php |
177 | 181 | echo '<legend>'.$data['name'].': '.$tool_name.'</legend>'; |
178 | 182 | echo Display::input('hidden', 'id', $id); |
@@ -120,7 +120,10 @@ discard block |
||
120 | 120 | <?php |
121 | 121 | foreach ($db_users as $user) { |
122 | 122 | ?> |
123 | - <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
123 | + <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) { |
|
124 | + echo 'selected="selected"'; |
|
125 | +} |
|
126 | +?>> |
|
124 | 127 | <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> |
125 | 128 | </option> |
126 | 129 | <?php |
@@ -136,7 +139,10 @@ discard block |
||
136 | 139 | <?php |
137 | 140 | foreach ($db_urls as $url_obj) { |
138 | 141 | ?> |
139 | - <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>> |
|
142 | + <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) { |
|
143 | + echo 'selected="selected"'; |
|
144 | +} |
|
145 | +?>> |
|
140 | 146 | <?php echo $url_obj['url']; ?> |
141 | 147 | </option> |
142 | 148 | <?php |
@@ -134,7 +134,8 @@ |
||
134 | 134 | $search_in_english = true, |
135 | 135 | $search_in_parent = true, |
136 | 136 | $search_in_sub_language = true |
137 | -) { |
|
137 | +) |
|
138 | +{ |
|
138 | 139 | //These the $_REQUEST['id'] and the $_REQUEST['sub_language_id'] variables are process in global.inc.php (LOAD LANGUAGE FILES SECTION) |
139 | 140 | /* |
140 | 141 | These 4 arrays are set in global.inc.php with the condition that will be load from sub_language.php or sub_language_ajax.inc.php |
@@ -195,10 +195,11 @@ discard block |
||
195 | 195 | <?php |
196 | 196 | if (!empty($rows_session_category)) { |
197 | 197 | foreach ($rows_session_category as $category) { |
198 | - if ($category['id'] == $categoryId) |
|
199 | - echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
200 | - else |
|
201 | - echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
198 | + if ($category['id'] == $categoryId) { |
|
199 | + echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; |
|
200 | + } else { |
|
201 | + echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; |
|
202 | + } |
|
202 | 203 | } |
203 | 204 | } |
204 | 205 | ?> |
@@ -222,7 +223,10 @@ discard block |
||
222 | 223 | <?php |
223 | 224 | foreach ($rows_session as $enreg) { |
224 | 225 | ?> |
225 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
226 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) { |
|
227 | + echo 'selected="selected"'; |
|
228 | +} |
|
229 | +?>><?php echo $enreg['name']; ?></option> |
|
226 | 230 | <?php } ?> |
227 | 231 | </select></div> |
228 | 232 | <?php unset($nosessionCourses); ?> |
@@ -244,7 +248,10 @@ discard block |
||
244 | 248 | <select id='destination' name="SessionCategoryList[]" multiple="multiple" size="20" style="width:320px;"> |
245 | 249 | <?php |
246 | 250 | foreach ($rows_category_session as $enreg) { ?> |
247 | - <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['name']; ?></option> |
|
251 | + <option value="<?php echo $enreg['id']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['name'], ENT_QUOTES).'"'; if (in_array($enreg['id'], $CourseList)) { |
|
252 | + echo 'selected="selected"'; |
|
253 | +} |
|
254 | +?>><?php echo $enreg['name']; ?></option> |
|
248 | 255 | <?php } ?> |
249 | 256 | </select></td> |
250 | 257 | </tr> |
@@ -62,26 +62,22 @@ discard block |
||
62 | 62 | function action_subscribe_user() |
63 | 63 | { |
64 | 64 | $action = self::get('action'); |
65 | - if ($action != self::ACTION_SUBSCRIBE) |
|
66 | - { |
|
65 | + if ($action != self::ACTION_SUBSCRIBE) { |
|
67 | 66 | return false; |
68 | 67 | } |
69 | 68 | |
70 | 69 | $course_code = self::post(self::PARAM_SUBSCRIBE); |
71 | - if (empty($course_code)) |
|
72 | - { |
|
70 | + if (empty($course_code)) { |
|
73 | 71 | return false; |
74 | 72 | } |
75 | 73 | |
76 | 74 | $registration_code = self::post(self::PARAM_PASSCODE); |
77 | 75 | |
78 | - if ($this->subscribe_user($course_code, $registration_code)) |
|
79 | - { |
|
76 | + if ($this->subscribe_user($course_code, $registration_code)) { |
|
80 | 77 | echo Display::return_message(get_lang('EnrollToCourseSuccessful'), 'confirmation'); |
81 | 78 | return; |
82 | 79 | } |
83 | - if (!empty($registration_code)) |
|
84 | - { |
|
80 | + if (!empty($registration_code)) { |
|
85 | 81 | echo Display::return_message(get_lang('CourseRegistrationCodeIncorrect'), 'error'); |
86 | 82 | } |
87 | 83 | $this->display_form($course_code); |
@@ -101,13 +97,11 @@ discard block |
||
101 | 97 | { |
102 | 98 | $course = api_get_course_info($course_code); |
103 | 99 | $course_regisration_code = $course['registration_code']; |
104 | - if (!empty($course_regisration_code) && $registration_code != $course_regisration_code) |
|
105 | - { |
|
100 | + if (!empty($course_regisration_code) && $registration_code != $course_regisration_code) { |
|
106 | 101 | return false; |
107 | 102 | } |
108 | 103 | |
109 | - if (empty($user_id)) |
|
110 | - { |
|
104 | + if (empty($user_id)) { |
|
111 | 105 | global $_user; |
112 | 106 | $user_id = $_user['user_id']; |
113 | 107 | } |
@@ -74,8 +74,14 @@ discard block |
||
74 | 74 | |
75 | 75 | $content = file($options['config']); |
76 | 76 | foreach ($content as $l) { |
77 | - if (preg_match('/^\s+$/', $l)) continue; // Empty lines. |
|
78 | - if (preg_match('/^[#\/!;]/', $l)) continue; // Comments (any form). |
|
77 | + if (preg_match('/^\s+$/', $l)) { |
|
78 | + continue; |
|
79 | + } |
|
80 | + // Empty lines. |
|
81 | + if (preg_match('/^[#\/!;]/', $l)) { |
|
82 | + continue; |
|
83 | + } |
|
84 | + // Comments (any form). |
|
79 | 85 | if (preg_match('/^(.*?)=(.*)$/', $l, $matches)) { |
80 | 86 | if (in_array($matches[1], $expectedoptions)) { |
81 | 87 | $options[trim($matches[1])] = trim($matches[2]); |
@@ -90,16 +96,22 @@ discard block |
||
90 | 96 | require_once($_configuration['root_sys'].'/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
91 | 97 | |
92 | 98 | global $DB; |
93 | -if ($options['verbose']) echo "building database manager\n"; |
|
99 | +if ($options['verbose']) { |
|
100 | + echo "building database manager\n"; |
|
101 | +} |
|
94 | 102 | $DB = new DatabaseManager(); |
95 | -if ($options['verbose']) echo "building plugin vchamilo\n"; |
|
103 | +if ($options['verbose']) { |
|
104 | + echo "building plugin vchamilo\n"; |
|
105 | +} |
|
96 | 106 | $plugin = VChamiloPlugin::create(); |
97 | 107 | |
98 | 108 | if (empty($options['nodes'])) { |
99 | 109 | cli_error('Missing node definition. Halt.'); |
100 | 110 | } |
101 | 111 | |
102 | -if ($options['verbose']) echo "parsing nodelist\n"; |
|
112 | +if ($options['verbose']) { |
|
113 | + echo "parsing nodelist\n"; |
|
114 | +} |
|
103 | 115 | $nodes = vchamilo_parse_csv_nodelist($options['nodes'], $plugin); |
104 | 116 | |
105 | 117 | if ($options['lint']) { |
@@ -40,7 +40,11 @@ |
||
40 | 40 | '</tr>'."\n"; |
41 | 41 | while (list ($key, $val) = each($nom_form)) { |
42 | 42 | $nbre = $nbre + 1; |
43 | - if ($nbre & 1) $ndiv = 2; else $ndiv = 3; |
|
43 | + if ($nbre & 1) { |
|
44 | + $ndiv = 2; |
|
45 | + } else { |
|
46 | + $ndiv = 3; |
|
47 | + } |
|
44 | 48 | echo '<tr align="center" id="header'.$ndiv.'">'; |
45 | 49 | echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
46 | 50 | echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |