From e22f5c6d87dd3eb4fe7bb43c0118e1487c62ede9 Mon Sep 17 00:00:00 2001 From: Simey Lameze Date: Mon, 16 Mar 2015 14:49:59 +0800 Subject: [PATCH] MDL-49114 environment: add slasharguments warning message --- admin/environment.xml | 10 ++++++++++ lang/en/admin.php | 1 + lib/upgradelib.php | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index 27a0b5a3e2f..753e37badff 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -1257,6 +1257,11 @@ + + + + + @@ -1385,6 +1390,11 @@ + + + + + diff --git a/lang/en/admin.php b/lang/en/admin.php index c17070b0c4a..1bdc8685853 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -970,6 +970,7 @@ $string['sitepolicyguest'] = 'Site policy URL for guests'; $string['sitepolicyguest_help'] = 'If you have a site policy that all guests must see and agree to before using this site, then specify the URL to it here, otherwise leave this field blank. This setting can contain any public URL. Note: access of not-logged-in users may be prevented with forcelogin setting.'; $string['sitesectionhelp'] = 'If selected, a topic section will be displayed on the site\'s front page.'; $string['slasharguments'] = 'Use slash arguments'; +$string['slashargumentswarning'] = 'It is recommended that the use of slash arguments is enabled. In future it will be required. For more details, see the documentation Using slash arguments.'; $string['smartpix'] = 'Smart pix search'; $string['soaprecommended'] = 'Installing the optional SOAP extension is useful for web services and some plugins.'; $string['sort_fullname'] = 'Course full name'; diff --git a/lib/upgradelib.php b/lib/upgradelib.php index 237b0633f12..9cd41a018a4 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -2227,3 +2227,21 @@ function check_database_storage_engine(environment_results $result) { return null; } + +/** + * Method used to check the usage of slasharguments config and display a warning message. + * + * @param environment_results $result object to update, if relevant. + * @return environment_results|null updated results or null if slasharguments is disabled. + */ +function check_slasharguments(environment_results $result){ + global $CFG; + + if (empty($CFG->slasharguments)) { + $result->setInfo('slasharguments'); + $result->setStatus(false); + return $result; + } + + return null; +}