@@ -5,7 +5,7 @@ |
||
5 | 5 | * @package chamilo.plugin.ims_lti |
6 | 6 | */ |
7 | 7 | |
8 | -if (!api_is_platform_admin()) { |
|
8 | +if (!api_is_platform_admin()) { |
|
9 | 9 | die ('You must have admin permissions to uninstall plugins'); |
10 | 10 | } |
11 | 11 |
@@ -19,12 +19,14 @@ discard block |
||
19 | 19 | public $course_settings_callback = true; |
20 | 20 | public $error = ''; |
21 | 21 | |
22 | - static function create() { |
|
22 | + static function create() |
|
23 | + { |
|
23 | 24 | static $result = null; |
24 | 25 | return $result ? $result : $result = new self(); |
25 | 26 | } |
26 | 27 | |
27 | - protected function __construct() { |
|
28 | + protected function __construct() |
|
29 | + { |
|
28 | 30 | parent::__construct('0.1', 'Yannick Warnier, Aliosh Neira', array('tool_enable' => 'boolean')); |
29 | 31 | |
30 | 32 | $this->course_settings = array(); |
@@ -42,12 +44,14 @@ discard block |
||
42 | 44 | } |
43 | 45 | } |
44 | 46 | |
45 | - function install() { |
|
47 | + function install() |
|
48 | + { |
|
46 | 49 | //Installing course settings |
47 | 50 | $this->install_course_fields_in_all_courses(false); |
48 | 51 | } |
49 | 52 | |
50 | - function uninstall() { |
|
53 | + function uninstall() |
|
54 | + { |
|
51 | 55 | //Deleting course settings |
52 | 56 | $this->uninstall_course_fields_in_all_courses($this->course_settings); |
53 | 57 | } |
@@ -57,12 +61,14 @@ discard block |
||
57 | 61 | * @param boolean Whether to add a tool link on the course homepage |
58 | 62 | * @return void |
59 | 63 | */ |
60 | - function course_install($course_id, $add_tool_link = true) { |
|
64 | + function course_install($course_id, $add_tool_link = true) |
|
65 | + { |
|
61 | 66 | //force ignoring the tools table insertion for this plugin |
62 | 67 | $this->install_course_fields($course_id, false); |
63 | 68 | } |
64 | 69 | |
65 | - function course_settings_updated($values = array()) { |
|
70 | + function course_settings_updated($values = array()) |
|
71 | + { |
|
66 | 72 | if (!is_array($values) or count($values)==0) { |
67 | 73 | return false; |
68 | 74 | } |
@@ -72,7 +78,8 @@ discard block |
||
72 | 78 | * Get a list of options (checked and unchecked) for blacklists as coming |
73 | 79 | * from the Squid files |
74 | 80 | */ |
75 | - function get_blacklist_options() { |
|
81 | + function get_blacklist_options() |
|
82 | + { |
|
76 | 83 | $categories = $blacklists = array(); |
77 | 84 | if (!is_dir($this->blacklists_dir)) { |
78 | 85 | $this->error = 'Could not find blacklists dir '.$this->blacklists_dir; |
@@ -110,7 +117,8 @@ discard block |
||
110 | 117 | * @param array Array of blacklists names |
111 | 118 | * @return boolean False on error, True on success |
112 | 119 | */ |
113 | - function set_blacklist_options($values) { |
|
120 | + function set_blacklist_options($values) |
|
121 | + { |
|
114 | 122 | if (!is_array($values)) { return false; } |
115 | 123 | if (!is_writeable($this->blacklist_enabled_file)) { return false; } |
116 | 124 | $new_blacklist = ''; |
@@ -13,7 +13,8 @@ |
||
13 | 13 | * @package Chamilo\CoreBundle\Entity\Repository |
14 | 14 | * @author Angel Fernando Quiroz Campos <[email protected]> |
15 | 15 | */ |
16 | -class TrackECourseAccessRepository extends EntityRepository { |
|
16 | +class TrackECourseAccessRepository extends EntityRepository |
|
17 | +{ |
|
17 | 18 | |
18 | 19 | /** |
19 | 20 | * Get the last registered access by an user |
@@ -108,7 +108,8 @@ discard block |
||
108 | 108 | * @return void |
109 | 109 | * @author Dmitry (dio) Levashov |
110 | 110 | **/ |
111 | - protected function configure() { |
|
111 | + protected function configure() |
|
112 | + { |
|
112 | 113 | parent::configure(); |
113 | 114 | |
114 | 115 | if (($tmp = $this->options['tmpPath'])) { |
@@ -136,7 +137,8 @@ discard block |
||
136 | 137 | * @return void |
137 | 138 | * @author Dmitry (dio) Levashov |
138 | 139 | **/ |
139 | - public function umount() { |
|
140 | + public function umount() |
|
141 | + { |
|
140 | 142 | return true; |
141 | 143 | } |
142 | 144 | |
@@ -277,7 +279,8 @@ discard block |
||
277 | 279 | * @return array |
278 | 280 | * @author Dmitry (dio) Levashov |
279 | 281 | **/ |
280 | - protected function getParents($path) { |
|
282 | + protected function getParents($path) |
|
283 | + { |
|
281 | 284 | $parents = array(); |
282 | 285 | |
283 | 286 | while ($path) { |
@@ -300,9 +303,11 @@ discard block |
||
300 | 303 | * @return string |
301 | 304 | * @author Troex Nevelin |
302 | 305 | **/ |
303 | - protected function loadFilePath($path) { |
|
306 | + protected function loadFilePath($path) |
|
307 | + { |
|
304 | 308 | $realPath = realpath($path); |
305 | - if (DIRECTORY_SEPARATOR == '\\') { // windows |
|
309 | + if (DIRECTORY_SEPARATOR == '\\') { |
|
310 | +// windows |
|
306 | 311 | $realPath = str_replace('\\', '\\\\', $realPath); |
307 | 312 | } |
308 | 313 | return $this->db->real_escape_string($realPath); |
@@ -317,7 +322,8 @@ discard block |
||
317 | 322 | * @return array |
318 | 323 | * @author Dmitry (dio) Levashov |
319 | 324 | **/ |
320 | - protected function doSearch($path, $q, $mimes) { |
|
325 | + protected function doSearch($path, $q, $mimes) |
|
326 | + { |
|
321 | 327 | return array(); |
322 | 328 | } |
323 | 329 | |
@@ -331,7 +337,8 @@ discard block |
||
331 | 337 | * @return string |
332 | 338 | * @author Dmitry (dio) Levashov |
333 | 339 | **/ |
334 | - protected function _dirname($path) { |
|
340 | + protected function _dirname($path) |
|
341 | + { |
|
335 | 342 | return ($stat = $this->stat($path)) ? ($stat['phash'] ? $this->decode($stat['phash']) : $this->root) : false; |
336 | 343 | } |
337 | 344 | |
@@ -342,7 +349,8 @@ discard block |
||
342 | 349 | * @return string |
343 | 350 | * @author Dmitry (dio) Levashov |
344 | 351 | **/ |
345 | - protected function _basename($path) { |
|
352 | + protected function _basename($path) |
|
353 | + { |
|
346 | 354 | return ($stat = $this->stat($path)) ? $stat['name'] : false; |
347 | 355 | } |
348 | 356 | |
@@ -354,7 +362,8 @@ discard block |
||
354 | 362 | * @return string |
355 | 363 | * @author Troex Nevelin |
356 | 364 | **/ |
357 | - protected function _normpath($path) { |
|
365 | + protected function _normpath($path) |
|
366 | + { |
|
358 | 367 | return $path; |
359 | 368 | } |
360 | 369 | |
@@ -365,7 +374,8 @@ discard block |
||
365 | 374 | * @return string |
366 | 375 | * @author Dmitry (dio) Levashov |
367 | 376 | **/ |
368 | - protected function _relpath($path) { |
|
377 | + protected function _relpath($path) |
|
378 | + { |
|
369 | 379 | return $path; |
370 | 380 | } |
371 | 381 | |
@@ -376,7 +386,8 @@ discard block |
||
376 | 386 | * @return string |
377 | 387 | * @author Dmitry (dio) Levashov |
378 | 388 | **/ |
379 | - protected function _abspath($path) { |
|
389 | + protected function _abspath($path) |
|
390 | + { |
|
380 | 391 | return $path; |
381 | 392 | } |
382 | 393 | |
@@ -387,7 +398,8 @@ discard block |
||
387 | 398 | * @return string |
388 | 399 | * @author Dmitry (dio) Levashov |
389 | 400 | **/ |
390 | - protected function _path($path) { |
|
401 | + protected function _path($path) |
|
402 | + { |
|
391 | 403 | if (($file = $this->stat($path)) == false) { |
392 | 404 | return ''; |
393 | 405 | } |
@@ -409,7 +421,8 @@ discard block |
||
409 | 421 | * @return bool |
410 | 422 | * @author Dmitry (dio) Levashov |
411 | 423 | **/ |
412 | - protected function _inpath($path, $parent) { |
|
424 | + protected function _inpath($path, $parent) |
|
425 | + { |
|
413 | 426 | return $path == $parent |
414 | 427 | ? true |
415 | 428 | : in_array($parent, $this->getParents($path)); |
@@ -424,7 +437,8 @@ discard block |
||
424 | 437 | * @return bool |
425 | 438 | * @author Dmitry (dio) Levashov |
426 | 439 | **/ |
427 | - protected function _subdirs($path) { |
|
440 | + protected function _subdirs($path) |
|
441 | + { |
|
428 | 442 | return ($stat = $this->stat($path)) && isset($stat['dirs']) ? $stat['dirs'] : false; |
429 | 443 | } |
430 | 444 | |
@@ -437,7 +451,8 @@ discard block |
||
437 | 451 | * @return string |
438 | 452 | * @author Dmitry (dio) Levashov |
439 | 453 | **/ |
440 | - protected function _dimensions($path, $mime) { |
|
454 | + protected function _dimensions($path, $mime) |
|
455 | + { |
|
441 | 456 | return ($stat = $this->stat($path)) && isset($stat['width']) && isset($stat['height']) ? $stat['width'].'x'.$stat['height'] : ''; |
442 | 457 | } |
443 | 458 | |
@@ -450,7 +465,8 @@ discard block |
||
450 | 465 | * @return array |
451 | 466 | * @author Dmitry (dio) Levashov |
452 | 467 | **/ |
453 | - protected function _scandir($path) { |
|
468 | + protected function _scandir($path) |
|
469 | + { |
|
454 | 470 | return isset($this->dirsCache[$path]) |
455 | 471 | ? $this->dirsCache[$path] |
456 | 472 | : $this->cacheDir($path); |
@@ -464,7 +480,8 @@ discard block |
||
464 | 480 | * @return resource|false |
465 | 481 | * @author Dmitry (dio) Levashov |
466 | 482 | **/ |
467 | - protected function _fopen($path, $mode = 'rb') { |
|
483 | + protected function _fopen($path, $mode = 'rb') |
|
484 | + { |
|
468 | 485 | $fp = $this->tmbPath |
469 | 486 | ? @fopen($this->tmpname($path), 'w+') |
470 | 487 | : @tmpfile(); |
@@ -491,7 +508,8 @@ discard block |
||
491 | 508 | * @return bool |
492 | 509 | * @author Dmitry (dio) Levashov |
493 | 510 | **/ |
494 | - protected function _fclose($fp, $path = '') { |
|
511 | + protected function _fclose($fp, $path = '') |
|
512 | + { |
|
495 | 513 | @fclose($fp); |
496 | 514 | if ($path) { |
497 | 515 | @unlink($this->tmpname($path)); |
@@ -508,35 +526,40 @@ discard block |
||
508 | 526 | * @return string|bool |
509 | 527 | * @author Dmitry (dio) Levashov |
510 | 528 | **/ |
511 | - protected function _mkdir($path, $name) { |
|
529 | + protected function _mkdir($path, $name) |
|
530 | + { |
|
512 | 531 | return $this->make($path, $name, 'directory') ? $this->_joinPath($path, $name) : false; |
513 | 532 | } |
514 | 533 | |
515 | 534 | /** |
516 | 535 | * {@inheritdoc} |
517 | 536 | */ |
518 | - protected function _mkfile($path, $name) { |
|
537 | + protected function _mkfile($path, $name) |
|
538 | + { |
|
519 | 539 | return false; |
520 | 540 | } |
521 | 541 | |
522 | 542 | /** |
523 | 543 | * {@inheritdoc} |
524 | 544 | */ |
525 | - protected function _symlink($target, $path, $name) { |
|
545 | + protected function _symlink($target, $path, $name) |
|
546 | + { |
|
526 | 547 | return false; |
527 | 548 | } |
528 | 549 | |
529 | 550 | /** |
530 | 551 | * {@inheritdoc} |
531 | 552 | */ |
532 | - protected function _copy($source, $targetDir, $name) { |
|
553 | + protected function _copy($source, $targetDir, $name) |
|
554 | + { |
|
533 | 555 | return false; |
534 | 556 | } |
535 | 557 | |
536 | 558 | /** |
537 | 559 | * {@inheritdoc} |
538 | 560 | */ |
539 | - protected function _move($source, $targetDir, $name) { |
|
561 | + protected function _move($source, $targetDir, $name) |
|
562 | + { |
|
540 | 563 | return false; |
541 | 564 | } |
542 | 565 | |
@@ -547,7 +570,8 @@ discard block |
||
547 | 570 | * @return bool |
548 | 571 | * @author Dmitry (dio) Levashov |
549 | 572 | **/ |
550 | - protected function _unlink($path) { |
|
573 | + protected function _unlink($path) |
|
574 | + { |
|
551 | 575 | return false; |
552 | 576 | return $this->query(sprintf('DELETE FROM %s WHERE id=%d AND mime!="directory" LIMIT 1', $this->tbf, $path)) && $this->db->affected_rows; |
553 | 577 | } |
@@ -559,7 +583,8 @@ discard block |
||
559 | 583 | * @return bool |
560 | 584 | * @author Dmitry (dio) Levashov |
561 | 585 | **/ |
562 | - protected function _rmdir($path) { |
|
586 | + protected function _rmdir($path) |
|
587 | + { |
|
563 | 588 | return false; |
564 | 589 | return $this->query(sprintf('DELETE FROM %s WHERE id=%d AND mime="directory" LIMIT 1', $this->tbf, $path)) && $this->db->affected_rows; |
565 | 590 | } |
@@ -570,7 +595,8 @@ discard block |
||
570 | 595 | * @return void |
571 | 596 | * @author Dmitry Levashov |
572 | 597 | **/ |
573 | - protected function _setContent($path, $fp) { |
|
598 | + protected function _setContent($path, $fp) |
|
599 | + { |
|
574 | 600 | rewind($fp); |
575 | 601 | $fstat = fstat($fp); |
576 | 602 | $size = $fstat['size']; |
@@ -579,14 +605,16 @@ discard block |
||
579 | 605 | /** |
580 | 606 | * {@inheritdoc} |
581 | 607 | */ |
582 | - protected function _save($fp, $dir, $name, $stat) { |
|
608 | + protected function _save($fp, $dir, $name, $stat) |
|
609 | + { |
|
583 | 610 | return false; |
584 | 611 | } |
585 | 612 | |
586 | 613 | /** |
587 | 614 | * {@inheritdoc} |
588 | 615 | */ |
589 | - protected function _getContents($path) { |
|
616 | + protected function _getContents($path) |
|
617 | + { |
|
590 | 618 | return false; |
591 | 619 | //return ($res = $this->query(sprintf('SELECT content FROM %s WHERE id=%d', $this->tbf, $path))) && ($r = $res->fetch_assoc()) ? $r['content'] : false; |
592 | 620 | } |
@@ -599,7 +627,8 @@ discard block |
||
599 | 627 | * @return bool |
600 | 628 | * @author Dmitry (dio) Levashov |
601 | 629 | **/ |
602 | - protected function _filePutContents($path, $content) { |
|
630 | + protected function _filePutContents($path, $content) |
|
631 | + { |
|
603 | 632 | return false; |
604 | 633 | //return $this->query(sprintf('UPDATE %s SET content="%s", size=%d, mtime=%d WHERE id=%d LIMIT 1', $this->tbf, $this->db->real_escape_string($content), strlen($content), time(), $path)); |
605 | 634 | } |
@@ -607,35 +636,40 @@ discard block |
||
607 | 636 | /** |
608 | 637 | * {@inheritdoc} |
609 | 638 | */ |
610 | - protected function _checkArchivers() { |
|
639 | + protected function _checkArchivers() |
|
640 | + { |
|
611 | 641 | return; |
612 | 642 | } |
613 | 643 | |
614 | 644 | /** |
615 | 645 | * {@inheritdoc} |
616 | 646 | */ |
617 | - protected function _unpack($path, $arc) { |
|
647 | + protected function _unpack($path, $arc) |
|
648 | + { |
|
618 | 649 | return; |
619 | 650 | } |
620 | 651 | |
621 | 652 | /** |
622 | 653 | * {@inheritdoc} |
623 | 654 | */ |
624 | - protected function _findSymlinks($path) { |
|
655 | + protected function _findSymlinks($path) |
|
656 | + { |
|
625 | 657 | return false; |
626 | 658 | } |
627 | 659 | |
628 | 660 | /** |
629 | 661 | * {@inheritdoc} |
630 | 662 | */ |
631 | - protected function _extract($path, $arc) { |
|
663 | + protected function _extract($path, $arc) |
|
664 | + { |
|
632 | 665 | return false; |
633 | 666 | } |
634 | 667 | |
635 | 668 | /** |
636 | 669 | * {@inheritdoc} |
637 | 670 | */ |
638 | - protected function _archive($dir, $files, $name, $arc) { |
|
671 | + protected function _archive($dir, $files, $name, $arc) |
|
672 | + { |
|
639 | 673 | return false; |
640 | 674 | } |
641 | 675 |
@@ -8,7 +8,8 @@ |
||
8 | 8 | namespace Chamilo\ThemeBundle\Model; |
9 | 9 | |
10 | 10 | |
11 | -interface TaskInterface { |
|
11 | +interface TaskInterface |
|
12 | +{ |
|
12 | 13 | |
13 | 14 | public function getColor(); |
14 | 15 | public function getProgress(); |
@@ -13,7 +13,8 @@ |
||
13 | 13 | * |
14 | 14 | * @package Chamilo\ThemeBundle\Model |
15 | 15 | */ |
16 | -interface MenuItemInterface { |
|
16 | +interface MenuItemInterface |
|
17 | +{ |
|
17 | 18 | /** |
18 | 19 | * @return mixed |
19 | 20 | */ |
@@ -11,7 +11,8 @@ |
||
11 | 11 | |
12 | 12 | use Symfony\Component\HttpFoundation\Request; |
13 | 13 | |
14 | -class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController { |
|
14 | +class ExceptionController extends \Symfony\Bundle\TwigBundle\Controller\ExceptionController |
|
15 | +{ |
|
15 | 16 | |
16 | 17 | |
17 | 18 | /** |
@@ -11,9 +11,11 @@ |
||
11 | 11 | use Chamilo\ThemeBundle\Event\ShowUserEvent; |
12 | 12 | use Chamilo\ThemeBundle\Model\UserModel; |
13 | 13 | |
14 | -class NavbarShowUserDemoListener { |
|
14 | +class NavbarShowUserDemoListener |
|
15 | +{ |
|
15 | 16 | |
16 | - public function onShowUser(ShowUserEvent $event) { |
|
17 | + public function onShowUser(ShowUserEvent $event) |
|
18 | + { |
|
17 | 19 | |
18 | 20 | $user = new UserModel(); |
19 | 21 | $user->setAvatar('')->setIsOnline(true)->setMemberSince(new \DateTime())->setUsername('Demo User'); |
@@ -11,7 +11,8 @@ discard block |
||
11 | 11 | use Chamilo\ThemeBundle\Theme\ThemeManager; |
12 | 12 | use Symfony\Component\HttpKernel\Event\FilterControllerEvent; |
13 | 13 | |
14 | -class SetupThemeListener { |
|
14 | +class SetupThemeListener |
|
15 | +{ |
|
15 | 16 | |
16 | 17 | /** |
17 | 18 | * @var ThemeManager |
@@ -30,7 +31,8 @@ discard block |
||
30 | 31 | } |
31 | 32 | |
32 | 33 | |
33 | - public function onKernelController(FilterControllerEvent $event) { |
|
34 | + public function onKernelController(FilterControllerEvent $event) |
|
35 | + { |
|
34 | 36 | |
35 | 37 | $css = rtrim($this->cssBase, '/').'/'.trim($this->lteAdmin, '/'); |
36 | 38 | $mng = $this->manager; |