MDL-49114 environment: add slasharguments warning message

This commit is contained in:
Simey Lameze
2015-03-30 10:15:04 +08:00
parent 20d38830ae
commit 1bd4b9fcb4
3 changed files with 24 additions and 0 deletions
+5
View File
@@ -1385,6 +1385,11 @@
<ON_ERROR message="quizattemptsupgradedmessage" />
</FEEDBACK>
</CUSTOM_CHECK>
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_slasharguments" level="optional">
<FEEDBACK>
<ON_CHECK message="slashargumentswarning" />
</FEEDBACK>
</CUSTOM_CHECK>
</CUSTOM_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
+1
View File
@@ -974,6 +974,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 <a href="https://docs.moodle.org/en/admin/environment/slasharguments">Using slash arguments</a>.';
$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';
+18
View File
@@ -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;
}