Adding api_get_path() in URLs, replacing global values, format code.
Fixing PHP warnings.
Merge branch '1.9.x' of ssh://github.com/chamilo/chamilo-lms into chamilo19