Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: customscripts.

customscripts: Difference between revisions

From MoodleDocs
No edit summary
m (Add note about SSL/https + fix $CFG property name (missing a pluralizing s))
 
(5 intermediate revisions by 3 users not shown)
Line 8: Line 8:


* this is for people making short term changes to VISIBLE web pages in the moodle source code
* this is for people making short term changes to VISIBLE web pages in the moodle source code
** need to check relative links ; for example: never require ../config.php
** cannot add new files to customscripts folder because they are not accessible directly via web.
** better to use cvs or cogito for long term management of customisations to moodle code
** better to use cvs or cogito for long term management of customisations to moodle code
* This does not work if $CFG->wwwroot is set to https:// -- see http://tracker.moodle.org/browse/MDL-21992


* it seems to have been used extensively only by the [[Moodle_for_Mobiles]] project
* it seems to have been used extensively only by the [[Moodle_for_Mobiles]] project


* to enable Custom Scripts, add $CFG->customscript=path/to/customscript/folder (see [[Configuration_file]])
* to enable Custom Scripts, add $CFG->customscripts=path/to/customscript/folder (see [[Configuration_file]])


==reference==
==References==
* http://moodle.org/mod/forum/discuss.php?d=31895
* http://moodle.org/mod/forum/discuss.php?d=31895
* http://tracker.moodle.org/secure/QuickSearch.jspa and type "customscripts"
* http://tracker.moodle.org/secure/QuickSearch.jspa and type "customscripts"


[[category:developper]]
[[Category:Developer|Customscripts]]

Latest revision as of 06:47, 8 June 2012

Custom Scripts Mechanism

Any scripts that are called directly via a url (eg index.php, user/view.php) 
can now be customised by placing a file with the same name (including directories) in 
my_moodle_data_dir/customscripts
For example:
my_moodle_data_dir/customscripts/index.php; my_moodle_data_dir/customscripts/user/view.php
  • this is for people making short term changes to VISIBLE web pages in the moodle source code
    • need to check relative links ; for example: never require ../config.php
    • cannot add new files to customscripts folder because they are not accessible directly via web.
    • better to use cvs or cogito for long term management of customisations to moodle code
  • to enable Custom Scripts, add $CFG->customscripts=path/to/customscript/folder (see Configuration_file)

References