@@ -376,7 +376,8 @@ |
||
376 | 376 | |
377 | 377 | $extra = array(); |
378 | 378 | foreach ($user as $key => $value) { |
379 | - if (substr($key, 0, 6) == 'extra_') { //an extra field |
|
379 | + if (substr($key, 0, 6) == 'extra_') { |
|
380 | +//an extra field |
|
380 | 381 | $extra[substr($key, 6)] = $value; |
381 | 382 | } |
382 | 383 | } |
@@ -317,7 +317,10 @@ discard block |
||
317 | 317 | <td width="40%" align="center"> |
318 | 318 | <select name="UserList[]" multiple="multiple" size="20" style="width:300px;"> |
319 | 319 | <?php foreach ($db_users as $user) { ?> |
320 | - <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> |
|
320 | + <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) { |
|
321 | + echo 'selected="selected"'; |
|
322 | +} |
|
323 | +?>> |
|
321 | 324 | <?php |
322 | 325 | $userName = $user['lastname'].' '.$user['firstname'].' ('.$user['username'].')'; |
323 | 326 | if ($showOfficialCode) { |
@@ -338,7 +341,10 @@ discard block |
||
338 | 341 | <td width="40%" align="center"> |
339 | 342 | <select name="CourseList[]" multiple="multiple" size="20" style="width:300px;"> |
340 | 343 | <?php foreach ($db_courses as $course) { ?> |
341 | - <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>> |
|
344 | + <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) { |
|
345 | + echo 'selected="selected"'; |
|
346 | +} |
|
347 | +?>> |
|
342 | 348 | <?php echo '('.$course['visual_code'].') '.$course['title']; ?> |
343 | 349 | </option> |
344 | 350 | <?php } ?> |
@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | * @author Jose Angel Ruiz <[email protected]> |
7 | 7 | * @author Julio Montoya <[email protected]> |
8 | 8 | */ |
9 | -class SepePlugin extends Plugin |
|
10 | -{ |
|
9 | +class SepePlugin extends Plugin |
|
10 | +{ |
|
11 | 11 | const TABLE_SEPE_CENTER = 'plugin_sepe_center'; |
12 | 12 | const TABLE_SEPE_ACTIONS = 'plugin_sepe_actions'; |
13 | 13 | const TABLE_SEPE_SPECIALTY = 'plugin_sepe_specialty'; |
@@ -30,14 +30,14 @@ discard block |
||
30 | 30 | * |
31 | 31 | * @return StaticPlugin |
32 | 32 | */ |
33 | - public static function create() |
|
34 | - { |
|
33 | + public static function create() |
|
34 | + { |
|
35 | 35 | static $result = null; |
36 | 36 | return $result ? $result : $result = new self(); |
37 | 37 | } |
38 | 38 | |
39 | - protected function __construct() |
|
40 | - { |
|
39 | + protected function __construct() |
|
40 | + { |
|
41 | 41 | parent::__construct( |
42 | 42 | '2.0', |
43 | 43 | ' |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | /** |
52 | 52 | * This method creates the tables required to this plugin |
53 | 53 | */ |
54 | - function install() |
|
55 | - { |
|
54 | + function install() |
|
55 | + { |
|
56 | 56 | $tablesToBeCompared = array( |
57 | 57 | self::TABLE_SEPE_CENTER, |
58 | 58 | self::TABLE_SEPE_ACTIONS, |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $sm = $cn->getSchemaManager(); |
77 | 77 | $tables = $sm->tablesExist($tablesToBeCompared); |
78 | 78 | |
79 | - if ($tables) { |
|
79 | + if ($tables) { |
|
80 | 80 | return false; |
81 | 81 | } |
82 | 82 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * This method drops the plugin tables |
88 | 88 | */ |
89 | - function uninstall() |
|
90 | - { |
|
89 | + function uninstall() |
|
90 | + { |
|
91 | 91 | $tablesToBeDeleted = array( |
92 | 92 | self::TABLE_SEPE_CENTER, |
93 | 93 | self::TABLE_SEPE_SPECIALTY_CLASSROOM, |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | self::TABLE_SEPE_LOG |
108 | 108 | ); |
109 | 109 | |
110 | - foreach ($tablesToBeDeleted as $tableToBeDeleted) { |
|
110 | + foreach ($tablesToBeDeleted as $tableToBeDeleted) { |
|
111 | 111 | $table = Database::get_main_table($tableToBeDeleted); |
112 | 112 | $sql = "DROP TABLE IF EXISTS $table"; |
113 | 113 | Database::query($sql); |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | $this->manageTab(false); |
116 | 116 | } |
117 | 117 | |
118 | - function update() |
|
119 | - { |
|
118 | + function update() |
|
119 | + { |
|
120 | 120 | $oldTableCenters = 'plugin_sepe_centros'; |
121 | 121 | $oldTableTutorsCompany = 'plugin_sepe_tutors_empresa'; |
122 | 122 | $oldTableCompetence = 'plugin_sepe_competencia_docente'; |
@@ -8,7 +8,7 @@ |
||
8 | 8 | $enable = $plugin->get('sepe_enable') == 'true'; |
9 | 9 | $title = $plugin->get_lang('AdministratorSepe'); |
10 | 10 | $pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/'; |
11 | -if (api_is_platform_admin() && $enable) { |
|
11 | +if (api_is_platform_admin() && $enable) { |
|
12 | 12 | echo '<div class="panel panel-default">'; |
13 | 13 | echo '<div class="panel-heading" role="tab">'; |
14 | 14 | echo '<h4 class="panel-title">'.$title.'</h4>'; |
@@ -5,8 +5,8 @@ |
||
5 | 5 | $enable = $plugin->get('sepe_enable') == 'true'; |
6 | 6 | $pluginPath = api_get_path(WEB_PLUGIN_PATH).'sepe/src/sepe-administration-menu.php'; |
7 | 7 | |
8 | -if ($enable && api_is_platform_admin()) { |
|
8 | +if ($enable && api_is_platform_admin()) { |
|
9 | 9 | header('Location:'.$pluginPath); |
10 | -} else { |
|
10 | +} else { |
|
11 | 11 | header('Location: ../../index.php'); |
12 | 12 | } |
13 | 13 | \ No newline at end of file |
@@ -359,9 +359,10 @@ |
||
359 | 359 | |
360 | 360 | if ($inATest) { |
361 | 361 | echo '<div class="actions">'; |
362 | - if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) |
|
363 | - echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'. |
|
362 | + if (isset($_GET['hotspotadmin']) || isset($_GET['newQuestion']) || isset($_GET['myid'])) { |
|
363 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'">'. |
|
364 | 364 | Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>'; |
365 | + } |
|
365 | 366 | |
366 | 367 | if (!isset($_GET['hotspotadmin']) && !isset($_GET['newQuestion']) && !isset($_GET['myid']) && !isset($_GET['editQuestion'])) { |
367 | 368 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'">'. |
@@ -232,8 +232,9 @@ discard block |
||
232 | 232 | $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo')); |
233 | 233 | |
234 | 234 | $setting = ini_get('default_charset'); |
235 | - if ($setting == '') |
|
236 | - $setting = null; |
|
235 | + if ($setting == '') { |
|
236 | + $setting = null; |
|
237 | + } |
|
237 | 238 | $req_setting = null; |
238 | 239 | $status = $setting == $req_setting ? self::STATUS_OK : self::STATUS_ERROR; |
239 | 240 | $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo')); |
@@ -251,22 +252,25 @@ discard block |
||
251 | 252 | $setting = ini_get('memory_limit'); |
252 | 253 | $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M'; |
253 | 254 | $status = self::STATUS_ERROR; |
254 | - if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT) |
|
255 | - $status = self::STATUS_OK; |
|
255 | + if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT) { |
|
256 | + $status = self::STATUS_OK; |
|
257 | + } |
|
256 | 258 | $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo')); |
257 | 259 | |
258 | 260 | $setting = ini_get('post_max_size'); |
259 | 261 | $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M'; |
260 | 262 | $status = self::STATUS_ERROR; |
261 | - if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE) |
|
262 | - $status = self::STATUS_OK; |
|
263 | + if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE) { |
|
264 | + $status = self::STATUS_OK; |
|
265 | + } |
|
263 | 266 | $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo')); |
264 | 267 | |
265 | 268 | $setting = ini_get('upload_max_filesize'); |
266 | 269 | $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M'; |
267 | 270 | $status = self::STATUS_ERROR; |
268 | - if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) |
|
269 | - $status = self::STATUS_OK; |
|
271 | + if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) { |
|
272 | + $status = self::STATUS_OK; |
|
273 | + } |
|
270 | 274 | $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo')); |
271 | 275 | |
272 | 276 | $setting = ini_get('variables_order'); |
@@ -106,7 +106,8 @@ discard block |
||
106 | 106 | function get_specific_field_values_list( |
107 | 107 | $conditions = array(), |
108 | 108 | $order_by = array() |
109 | -) { |
|
109 | +) |
|
110 | +{ |
|
110 | 111 | $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
111 | 112 | $return_array = array(); |
112 | 113 | $sql = "SELECT * FROM $table_sfv"; |
@@ -153,7 +154,8 @@ discard block |
||
153 | 154 | $course_code, |
154 | 155 | $tool_id, |
155 | 156 | $ref_id |
156 | -) { |
|
157 | +) |
|
158 | +{ |
|
157 | 159 | $table_sf = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD); |
158 | 160 | $table_sfv = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
159 | 161 | $sql = 'SELECT sfv.value FROM %s sf LEFT JOIN %s sfv ON sf.id = sfv.field_id'. |
@@ -189,7 +191,8 @@ discard block |
||
189 | 191 | $tool_id, |
190 | 192 | $ref_id, |
191 | 193 | $value |
192 | -) { |
|
194 | +) |
|
195 | +{ |
|
193 | 196 | $table_sf_values = Database::get_main_table( |
194 | 197 | TABLE_MAIN_SPECIFIC_FIELD_VALUES |
195 | 198 | ); |
@@ -222,7 +225,8 @@ discard block |
||
222 | 225 | * @param string $tool_id tool id, from main.api.lib |
223 | 226 | * @param int $ref_id intern id inside specific tool table |
224 | 227 | */ |
225 | -function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id) { |
|
228 | +function delete_all_specific_field_value($course_id, $id_specific_field, $tool_id, $ref_id) |
|
229 | +{ |
|
226 | 230 | $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
227 | 231 | $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s AND field_id = %s'; |
228 | 232 | $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id, $id_specific_field); |
@@ -236,7 +240,8 @@ discard block |
||
236 | 240 | * @param string Tool ID |
237 | 241 | * @param int Internal ID used in specific tool table |
238 | 242 | */ |
239 | -function delete_all_values_for_item($course_id, $tool_id, $ref_id) { |
|
243 | +function delete_all_values_for_item($course_id, $tool_id, $ref_id) |
|
244 | +{ |
|
240 | 245 | $table_sf_values = Database::get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES); |
241 | 246 | $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s'; |
242 | 247 | $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id); |
@@ -250,7 +255,8 @@ discard block |
||
250 | 255 | * @param string Name |
251 | 256 | * @return string One-letter code, upper-case |
252 | 257 | */ |
253 | -function get_specific_field_code_from_name($name) { |
|
258 | +function get_specific_field_code_from_name($name) |
|
259 | +{ |
|
254 | 260 | // Z is used internally by Xapian |
255 | 261 | // O & C already used by tool_id and course_id |
256 | 262 | $list = array( |
@@ -24,7 +24,8 @@ |
||
24 | 24 | $sql = "SELECT * from $table where username='".Database::escape_string($login)."'"; |
25 | 25 | $result = Database::query($sql); |
26 | 26 | |
27 | - if (Database::num_rows($result) == 0) { //false password |
|
27 | + if (Database::num_rows($result) == 0) { |
|
28 | +//false password |
|
28 | 29 | return false; |
29 | 30 | } |
30 | 31 | $user_info = Database::fetch_assoc($result); |