@@ -4,7 +4,7 @@ |
||
4 | 4 | use ChamiloSession as Session; |
5 | 5 | |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
8 | 8 | |
9 | 9 | api_protect_course_script(true); |
10 | 10 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use ChamiloSession as Session; |
5 | 5 | |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
8 | 8 | |
9 | 9 | api_protect_course_script(true); |
10 | 10 |
@@ -4,7 +4,7 @@ |
||
4 | 4 | use ChamiloSession as Session; |
5 | 5 | |
6 | 6 | require_once '../inc/global.inc.php'; |
7 | -$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
7 | +$current_course_tool = TOOL_STUDENTPUBLICATION; |
|
8 | 8 | |
9 | 9 | api_protect_course_script(true); |
10 | 10 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public static function getAllLanguages() |
22 | 22 | { |
23 | 23 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
24 | - $sql = 'SELECT * FROM ' . $table; |
|
24 | + $sql = 'SELECT * FROM '.$table; |
|
25 | 25 | $rs = Database::query($sql); |
26 | 26 | $all_languages = []; |
27 | 27 | while ($row = Database::fetch_array($rs, 'ASSOC')) { |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | public static function get_all_information_of_sub_language($parent_id, $sub_language_id) |
71 | 71 | { |
72 | 72 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
73 | - $sql = 'SELECT * FROM ' . $table . ' |
|
73 | + $sql = 'SELECT * FROM '.$table.' |
|
74 | 74 | WHERE |
75 | 75 | parent_id= ' . intval($parent_id).' AND |
76 | - id= ' . intval($sub_language_id) . ''; |
|
76 | + id= ' . intval($sub_language_id).''; |
|
77 | 77 | $rs = Database::query($sql); |
78 | 78 | $all_information = array(); |
79 | 79 | while ($row = Database::fetch_array($rs, 'ASSOC')) { |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | public static function get_all_information_of_language($parent_id) |
92 | 92 | { |
93 | 93 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
94 | - $sql = 'SELECT * FROM ' . $table . ' WHERE id = "' . intval($parent_id) . '"'; |
|
94 | + $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"'; |
|
95 | 95 | $rs = Database::query($sql); |
96 | 96 | $all_information = array(); |
97 | 97 | while ($row = Database::fetch_array($rs, 'ASSOC')) { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | public static function add_file_in_language_directory($system_path_file) |
139 | 139 | { |
140 | - $return_value = @file_put_contents($system_path_file, '<?php' . PHP_EOL); |
|
140 | + $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL); |
|
141 | 141 | |
142 | 142 | return $return_value; |
143 | 143 | } |
@@ -152,10 +152,10 @@ discard block |
||
152 | 152 | public static function write_data_in_file($path_file, $new_term, $new_variable) |
153 | 153 | { |
154 | 154 | $return_value = false; |
155 | - $new_data = $new_variable . '=' . $new_term; |
|
155 | + $new_data = $new_variable.'='.$new_term; |
|
156 | 156 | $resource = @fopen($path_file, "a"); |
157 | 157 | if (file_exists($path_file) && $resource) { |
158 | - if (fwrite($resource, $new_data . PHP_EOL) === false) { |
|
158 | + if (fwrite($resource, $new_data.PHP_EOL) === false) { |
|
159 | 159 | //not allow to write |
160 | 160 | $return_value = false; |
161 | 161 | } else { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if (empty($sub_language_dir)) { |
178 | 178 | return false; |
179 | 179 | } |
180 | - $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir; |
|
180 | + $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir; |
|
181 | 181 | if (is_dir($dir)) { |
182 | 182 | return true; |
183 | 183 | } //even if the dir already exists, we reach the objective of having the directory there |
@@ -201,8 +201,8 @@ discard block |
||
201 | 201 | return false; |
202 | 202 | } |
203 | 203 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
204 | - $sql = 'SELECT dokeos_folder FROM ' . $table . ' |
|
205 | - WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id; |
|
204 | + $sql = 'SELECT dokeos_folder FROM '.$table.' |
|
205 | + WHERE parent_id = ' . $parent_id.' and id = '.$sub_language_id; |
|
206 | 206 | $res = Database::query($sql); |
207 | 207 | if ($res === false or Database::num_rows($res) < 1) { |
208 | 208 | return false; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | if ($res === false) { |
213 | 213 | return false; |
214 | 214 | } //can't delete dir, so do not delete language record |
215 | - $sql = 'DELETE FROM ' . $table . ' |
|
215 | + $sql = 'DELETE FROM '.$table.' |
|
216 | 216 | WHERE id= ' . intval($sub_language_id); |
217 | 217 | $res = Database::query($sql); |
218 | 218 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | if (empty($sub_language_dir)) { |
230 | 230 | return false; |
231 | 231 | } |
232 | - $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir; |
|
232 | + $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir; |
|
233 | 233 | if (!is_dir($dir)) { |
234 | 234 | return true; |
235 | 235 | } //even if the dir does not exist, we reach the objective of not having the directory there |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | if (count($content) > 0) { |
239 | 239 | foreach ($content as $value_content) { |
240 | - $path_file = $dir . '/' . $value_content; |
|
240 | + $path_file = $dir.'/'.$value_content; |
|
241 | 241 | unlink($path_file); |
242 | 242 | } |
243 | 243 | return @rmdir($dir); |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | { |
256 | 256 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
257 | 257 | $sql = 'SELECT count(*) as count |
258 | - FROM ' . $table . ' |
|
259 | - WHERE id="' . intval($language_id) . '"'; |
|
258 | + FROM ' . $table.' |
|
259 | + WHERE id="' . intval($language_id).'"'; |
|
260 | 260 | $rs = Database::query($sql); |
261 | 261 | if (Database::num_rows($rs) > 0) { |
262 | 262 | if (Database::result($rs, 0, 'count') == 1) { |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | { |
279 | 279 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
280 | 280 | $sql = 'SELECT original_name |
281 | - FROM ' . $table . ' |
|
282 | - WHERE id= ' . intval($language_id) . ''; |
|
281 | + FROM ' . $table.' |
|
282 | + WHERE id= ' . intval($language_id).''; |
|
283 | 283 | $rs = Database::query($sql); |
284 | 284 | if (Database::num_rows($rs) > 0) { |
285 | 285 | return Database::result($rs, 0, 'original_name'); |
@@ -297,8 +297,8 @@ discard block |
||
297 | 297 | public static function check_if_language_is_sub_language($language_id) |
298 | 298 | { |
299 | 299 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
300 | - $sql = 'SELECT count(*) AS count FROM ' . $table . ' |
|
301 | - WHERE id = ' . intval($language_id) . ' AND NOT ISNULL(parent_id)'; |
|
300 | + $sql = 'SELECT count(*) AS count FROM '.$table.' |
|
301 | + WHERE id = ' . intval($language_id).' AND NOT ISNULL(parent_id)'; |
|
302 | 302 | $rs = Database::query($sql); |
303 | 303 | |
304 | 304 | if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) { |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | { |
317 | 317 | $language_info = self::get_all_information_of_language($language_id); |
318 | 318 | $table = Database :: get_main_table(TABLE_MAIN_USER); |
319 | - $sql = 'SELECT count(*) AS count FROM ' . $table . ' |
|
319 | + $sql = 'SELECT count(*) AS count FROM '.$table.' |
|
320 | 320 | WHERE language ="' . Database::escape_string($language_info['english_name']).'"'; |
321 | 321 | $rs = Database::query($sql); |
322 | 322 | if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') >= 1) { |
@@ -334,8 +334,8 @@ discard block |
||
334 | 334 | public static function check_if_language_is_father($language_id) |
335 | 335 | { |
336 | 336 | $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
337 | - $sql = 'SELECT count(*) AS count FROM ' . $table . ' |
|
338 | - WHERE parent_id= ' . intval($language_id) . ' AND NOT ISNULL(parent_id);'; |
|
337 | + $sql = 'SELECT count(*) AS count FROM '.$table.' |
|
338 | + WHERE parent_id= ' . intval($language_id).' AND NOT ISNULL(parent_id);'; |
|
339 | 339 | $rs = Database::query($sql); |
340 | 340 | |
341 | 341 | if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | { |
355 | 355 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
356 | 356 | $sql = "UPDATE $tbl_admin_languages SET available='0' |
357 | - WHERE id = " . intval($language_id) . ""; |
|
357 | + WHERE id = ".intval($language_id).""; |
|
358 | 358 | $result = Database::query($sql); |
359 | 359 | |
360 | 360 | return $result !== false; //only return false on sql error |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | { |
370 | 370 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
371 | 371 | $sql = "UPDATE $tbl_admin_languages SET available='1' |
372 | - WHERE id = " . intval($language_id) . ""; |
|
372 | + WHERE id = ".intval($language_id).""; |
|
373 | 373 | $result = Database::query($sql); |
374 | 374 | |
375 | 375 | return $result !== false; //only return false on sql error |
@@ -387,11 +387,11 @@ discard block |
||
387 | 387 | } |
388 | 388 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
389 | 389 | $tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT); |
390 | - $sql = "SELECT english_name FROM " . $tbl_admin_languages . " |
|
391 | - WHERE id= " . intval($language_id) . ""; |
|
390 | + $sql = "SELECT english_name FROM ".$tbl_admin_languages." |
|
391 | + WHERE id= " . intval($language_id).""; |
|
392 | 392 | $result = Database::query($sql); |
393 | 393 | $lang = Database::fetch_array($result); |
394 | - $sql_update_2 = "UPDATE " . $tbl_settings_current . " SET selected_value='" . $lang['english_name'] . "' |
|
394 | + $sql_update_2 = "UPDATE ".$tbl_settings_current." SET selected_value='".$lang['english_name']."' |
|
395 | 395 | WHERE variable='platformLanguage'"; |
396 | 396 | $result_2 = Database::query($sql_update_2); |
397 | 397 | Event::addEvent( |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | { |
412 | 412 | $name = api_get_setting('platformLanguage'); |
413 | 413 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
414 | - $sql = "SELECT id FROM " . $tbl_admin_languages . " WHERE english_name ='$name'"; |
|
414 | + $sql = "SELECT id FROM ".$tbl_admin_languages." WHERE english_name ='$name'"; |
|
415 | 415 | $res = Database::query($sql); |
416 | 416 | if (Database::num_rows($res) < 1) { |
417 | 417 | return false; |
@@ -430,10 +430,10 @@ discard block |
||
430 | 430 | { |
431 | 431 | $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
432 | 432 | $sql = "SELECT dokeos_folder |
433 | - FROM " . $tbl_admin_languages . " |
|
433 | + FROM " . $tbl_admin_languages." |
|
434 | 434 | WHERE id = ( |
435 | - SELECT parent_id FROM " . $tbl_admin_languages . " |
|
436 | - WHERE dokeos_folder = '" . Database::escape_string($language_path) . "' |
|
435 | + SELECT parent_id FROM " . $tbl_admin_languages." |
|
436 | + WHERE dokeos_folder = '" . Database::escape_string($language_path)."' |
|
437 | 437 | ) |
438 | 438 | "; |
439 | 439 | $result = Database::query($sql); |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | $adminLanguagesTable = Database :: get_main_table(TABLE_MAIN_LANGUAGE); |
456 | 456 | // select language - if case several languages match, get the last (more recent) one |
457 | 457 | $sql = "SELECT english_name |
458 | - FROM " . $adminLanguagesTable . " |
|
458 | + FROM " . $adminLanguagesTable." |
|
459 | 459 | WHERE |
460 | 460 | isocode ='$isocode' AND |
461 | 461 | available = 1 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use Symfony\Component\Form\FormBuilderInterface; |
12 | 12 | use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
13 | 13 | |
14 | -class FormDemoModelType extends AbstractType{ |
|
14 | +class FormDemoModelType extends AbstractType { |
|
15 | 15 | |
16 | 16 | public function buildForm(FormBuilderInterface $builder, array $options) |
17 | 17 | { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | ->add('someChoices', 'choice', array('choices' => $choices, 'expanded' => true, 'multiple' => true)) |
34 | 34 | ->add('username') |
35 | 35 | ->add('email') |
36 | - ->add('termsAccepted','checkbox') |
|
36 | + ->add('termsAccepted', 'checkbox') |
|
37 | 37 | ->add('message', 'textarea') |
38 | 38 | ->add('price') |
39 | 39 | ->add('date', 'date', array('widget' => 'single_text')) |
@@ -30,8 +30,8 @@ |
||
30 | 30 | * |
31 | 31 | * @return $this |
32 | 32 | */ |
33 | - public function addTask(TaskInterface $taskInterface){ |
|
34 | - $this->tasks[] = $taskInterface; |
|
33 | + public function addTask(TaskInterface $taskInterface) { |
|
34 | + $this->tasks[] = $taskInterface; |
|
35 | 35 | return $this; |
36 | 36 | } |
37 | 37 |
@@ -19,40 +19,40 @@ |
||
19 | 19 | /** |
20 | 20 | * Used to receive notification data |
21 | 21 | */ |
22 | - const THEME_NOTIFICATIONS = 'theme.notifications'; |
|
22 | + const THEME_NOTIFICATIONS = 'theme.notifications'; |
|
23 | 23 | /** |
24 | 24 | * Used to receive message data |
25 | 25 | */ |
26 | - const THEME_MESSAGES = 'theme.messages'; |
|
26 | + const THEME_MESSAGES = 'theme.messages'; |
|
27 | 27 | /** |
28 | 28 | * Used to receive task data |
29 | 29 | */ |
30 | - const THEME_TASKS = 'theme.tasks'; |
|
30 | + const THEME_TASKS = 'theme.tasks'; |
|
31 | 31 | /** |
32 | 32 | * |
33 | 33 | */ |
34 | - const THEME_NAVBAR_USER = 'theme.navbar_user'; |
|
34 | + const THEME_NAVBAR_USER = 'theme.navbar_user'; |
|
35 | 35 | /** |
36 | 36 | * used to receive breadcrumb data |
37 | 37 | */ |
38 | - const THEME_BREADCRUMB = 'theme.breadcrumb'; |
|
38 | + const THEME_BREADCRUMB = 'theme.breadcrumb'; |
|
39 | 39 | /** |
40 | 40 | * used to receive the current user for the sidebar |
41 | 41 | */ |
42 | - const THEME_SIDEBAR_USER = 'theme.sidebar_user'; |
|
42 | + const THEME_SIDEBAR_USER = 'theme.sidebar_user'; |
|
43 | 43 | /** |
44 | 44 | * Used for searching |
45 | 45 | * @unused |
46 | 46 | */ |
47 | - const THEME_SIDEBAR_SEARCH = 'theme.sidebar_search'; |
|
47 | + const THEME_SIDEBAR_SEARCH = 'theme.sidebar_search'; |
|
48 | 48 | /** |
49 | 49 | * Used to receive the sidebar menu data |
50 | 50 | */ |
51 | - const THEME_SIDEBAR_SETUP_MENU = 'theme.sidebar_setup_menu'; |
|
51 | + const THEME_SIDEBAR_SETUP_MENU = 'theme.sidebar_setup_menu'; |
|
52 | 52 | /** |
53 | 53 | * Used to receive the sidebar menu data |
54 | 54 | */ |
55 | - const THEME_SIDEBAR_SETUP_MENU_KNP = 'theme.sidebar_setup_menu_knp'; |
|
55 | + const THEME_SIDEBAR_SETUP_MENU_KNP = 'theme.sidebar_setup_menu_knp'; |
|
56 | 56 | /** |
57 | 57 | * |
58 | 58 | */ |
@@ -74,9 +74,9 @@ |
||
74 | 74 | */ |
75 | 75 | public function getActive() { |
76 | 76 | |
77 | - foreach($this->getItems() as $item) { |
|
77 | + foreach ($this->getItems() as $item) { |
|
78 | 78 | /** @var $item MenuItemInterface */ |
79 | - if($item->isActive()) return $item; |
|
79 | + if ($item->isActive()) return $item; |
|
80 | 80 | } |
81 | 81 | return null; |
82 | 82 | } |
@@ -30,11 +30,11 @@ |
||
30 | 30 | */ |
31 | 31 | protected $isOnline = false; |
32 | 32 | |
33 | - function __construct($username='', $avatar = '', $memberSince = null, $isOnline = true) |
|
33 | + function __construct($username = '', $avatar = '', $memberSince = null, $isOnline = true) |
|
34 | 34 | { |
35 | 35 | $this->avatar = $avatar; |
36 | 36 | $this->isOnline = $isOnline; |
37 | - $this->memberSince = $memberSince ?:new \DateTime(); |
|
37 | + $this->memberSince = $memberSince ?: new \DateTime(); |
|
38 | 38 | $this->username = $username; |
39 | 39 | } |
40 | 40 |