Compare commits
299 Commits
v5.1.0-beta
...
v5.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| ffb6475f6a | |||
| a237da2cd7 | |||
| 5f0de664bd | |||
| c32e894dc2 | |||
| a98bb76076 | |||
| 6d240f17ae | |||
| 5f265a8be5 | |||
| 39fb6431d0 | |||
| 94d5d89e4b | |||
| 7db7444d53 | |||
| 9d8cf5fb22 | |||
| d0a00b74d8 | |||
| 1db743ea9a | |||
| 971f1fc25f | |||
| 571990b7de | |||
| 45ed9e9127 | |||
| 1fbd0fd3ee | |||
| 22f52b9b4a | |||
| db8f7fc95a | |||
| 7ac6e421ab | |||
| 07a58bdb33 | |||
| dfec066e2e | |||
| 847a39b6d5 | |||
| 4a2d2b54b2 | |||
| 7979e44436 | |||
| e0e626f684 | |||
| 98a80ac3ca | |||
| 0f8951ce28 | |||
| f26f018876 | |||
| 637f6dc508 | |||
| 9bed548080 | |||
| 410747af21 | |||
| e20e2c044b | |||
| 03b1a727b6 | |||
| a92df9e0ee | |||
| 25f8dd9d63 | |||
| 72c71a1f89 | |||
| a52d4ed032 | |||
| c947a7c303 | |||
| 41c19a5e02 | |||
| 301ae93c4a | |||
| d207b50abf | |||
| c1552bc519 | |||
| b2f4f7ab62 | |||
| 50d9f8f70e | |||
| 9bc8fe3bc1 | |||
| a716da64af | |||
| 290104c964 | |||
| a0c88aec39 | |||
| dfd0dc28e8 | |||
| 30b08ee83a | |||
| e5da273f9a | |||
| c248e82b52 | |||
| 6d2b25f10f | |||
| 8d57b56b5a | |||
| edcff12191 | |||
| 1229c2b1ef | |||
| 7edec4866f | |||
| 5c22b04af4 | |||
| 01866455af | |||
| 1260cb24b8 | |||
| 77e0f0a889 | |||
| 9330731d93 | |||
| 8fa9939614 | |||
| 89d34beece | |||
| 325f273ca9 | |||
| c471fa4986 | |||
| b4e3dca13f | |||
| 7310e7d908 | |||
| e14e0428db | |||
| 7f756ae983 | |||
| 0e24a0400d | |||
| 1ad351d4a2 | |||
| 6c045bfefc | |||
| 47c8a3ad7e | |||
| aae09ebb6b | |||
| 5feec7a0b0 | |||
| 28cf9407dd | |||
| 06fd97cae1 | |||
| 82eecc9475 | |||
| 499715e17e | |||
| 643eaa3418 | |||
| 181c55ad1c | |||
| cb7d72d31d | |||
| 114ff5fa92 | |||
| dda97bdbfc | |||
| e5d7e554ab | |||
| 35588bca41 | |||
| e4247c79a6 | |||
| 00b809dbc5 | |||
| d21fcdee19 | |||
| a8b08ea6fc | |||
| a52fbcced6 | |||
| c957b909aa | |||
| 86990aaab5 | |||
| 3cebd0e59a | |||
| 077fbd22cf | |||
| 56a250792c | |||
| ace36dc3df | |||
| e8b3c7174a | |||
| 1edb106e9b | |||
| abae164f41 | |||
| c7912e21ba | |||
| 7df8f6e430 | |||
| 475ef128ae | |||
| 586ae425e6 | |||
| 8f6e56173e | |||
| a23635adc0 | |||
| bfdcf4b490 | |||
| 2e7c195aee | |||
| d7f7653a8e | |||
| 00652388c5 | |||
| 3c83131e34 | |||
| dff4bc87f5 | |||
| 4a1395205f | |||
| e534517f7f | |||
| f17a871f1d | |||
| ef5c806a70 | |||
| 4de4029044 | |||
| 2a2e18461f | |||
| 44d1a98e70 | |||
| 328810e933 | |||
| b6b043b147 | |||
| 1babb4f4c2 | |||
| b5bb67d1f1 | |||
| 89358f92fb | |||
| 17f6225bc4 | |||
| 77d63230a1 | |||
| 43b4e56f8b | |||
| 40add60152 | |||
| 64e07e7afb | |||
| 1c67b54aa2 | |||
| 2099b2cafb | |||
| ef4af9dd82 | |||
| 1c8d59349e | |||
| ed999bea4b | |||
| 1066601f0b | |||
| b721f37d91 | |||
| b06bcdc209 | |||
| 8e1c86a9a3 | |||
| b479e86c08 | |||
| e927264c5a | |||
| 6effd2064a | |||
| b969f89b01 | |||
| 674a4c2a5f | |||
| 549e311fee | |||
| c312a9871c | |||
| 0f244e11a0 | |||
| 7d794f8a3e | |||
| f8db554520 | |||
| 38b9eb2653 | |||
| 94233d6242 | |||
| e8580cf851 | |||
| b407011b18 | |||
| 67d2b86614 | |||
| 52e9b4cdbe | |||
| 7725baa9db | |||
| 3f534cad09 | |||
| be1e8f8887 | |||
| edd0e76bd1 | |||
| f84f671994 | |||
| 237f9bd7c0 | |||
| 3f832fda4d | |||
| fad9778f8b | |||
| 406980d1b1 | |||
| 7b472fae76 | |||
| c6253c34bb | |||
| ee9cc3b397 | |||
| bbcc5462af | |||
| 5ab4641119 | |||
| efacf36423 | |||
| ffa4c0ea3f | |||
| 6999197243 | |||
| 4345819a25 | |||
| 1540e90991 | |||
| 758a35058f | |||
| 2654ce0457 | |||
| 4220abfd22 | |||
| 62c3325c06 | |||
| cc63c27931 | |||
| b47fc4a266 | |||
| dad46b2976 | |||
| e14280bf94 | |||
| 685da75cd9 | |||
| a6ce0dc708 | |||
| 0c8e1b6256 | |||
| 5c89e91dad | |||
| 5b1761963c | |||
| ebc9254a33 | |||
| f9dc580bb9 | |||
| e1b0d8b770 | |||
| 687857ea58 | |||
| c3056486bf | |||
| 5ee54fe953 | |||
| 1c0a30495c | |||
| 69b36a36b4 | |||
| 4fb1ca66b4 | |||
| 9c31818311 | |||
| 286e5f0a7d | |||
| aab3c0722f | |||
| 536391d442 | |||
| a6a6e54862 | |||
| 9026613016 | |||
| 60fd449bc6 | |||
| 8982f5ee9e | |||
| 1b9dfd94c1 | |||
| 684a9fc34b | |||
| d26bcd0069 | |||
| f083271328 | |||
| e64903b7b2 | |||
| 6f14d54be9 | |||
| 2a131a18c3 | |||
| 2e90ab1ee8 | |||
| 89285b7efc | |||
| daa6fe8af1 | |||
| 6ad24df3d0 | |||
| 9b7ac2d4d1 | |||
| 15ab527174 | |||
| 5511a18ae5 | |||
| 9bd83512e6 | |||
| 32fa48c8c9 | |||
| 34bdcdaa00 | |||
| 20fb7a4f1a | |||
| ec4bfaf137 | |||
| 742b58fb04 | |||
| a440099d46 | |||
| 13f476b154 | |||
| 09b72f375e | |||
| 65a3bf07c4 | |||
| 03ee9f3c1d | |||
| a4f96dce4d | |||
| 62def094c8 | |||
| 01ae63ca47 | |||
| 05f009fc14 | |||
| 997122cde0 | |||
| 92a20551cf | |||
| 7582e6a677 | |||
| f3ab1afd05 | |||
| 9e34a5f4c0 | |||
| d4e9ca5712 | |||
| c5d88c2426 | |||
| 1eab163f65 | |||
| edc2b3d49c | |||
| 408adbe49a | |||
| 97752da2a8 | |||
| ba42149eb1 | |||
| ac88fe5b13 | |||
| 6d522be2cf | |||
| 6f28ea370d | |||
| 4a37e4438a | |||
| 40b6c3233c | |||
| 2a48472266 | |||
| 49eccd6af2 | |||
| 8968b682be | |||
| 388d53c3fe | |||
| a5588f890e | |||
| c06bf3b038 | |||
| 5a3e26b0f2 | |||
| 2b05496629 | |||
| e2f4f23f34 | |||
| 5a28a54627 | |||
| 1e3f359acf | |||
| 14bf5bd303 | |||
| 803b561f80 | |||
| 2bafdb41ab | |||
| 18a588063e | |||
| d5c3f2325d | |||
| afc530a43f | |||
| 1ba74349e7 | |||
| 0d9d1ff504 | |||
| fae86af494 | |||
| e1c750b49d | |||
| 11a31a6b2c | |||
| 68cdd9d50c | |||
| e5b9a12966 | |||
| 033447ee87 | |||
| 7195df2ca1 | |||
| 17f0b61b1d | |||
| bf943db69e | |||
| 3b62816190 | |||
| c9defe656a | |||
| cc73f24d4f | |||
| f098bcde4f | |||
| 80af23cdd3 | |||
| 26f7f7ef21 | |||
| 6a462b63f1 | |||
| ad48d8ee81 | |||
| 377e0b4e46 | |||
| 561842d7fe | |||
| f02a3572e2 | |||
| f721c97a19 | |||
| 6f6b960cf8 | |||
| 4e6310fbe8 | |||
| 7f708eaff9 | |||
| b41bf2f579 | |||
| d792c4916a | |||
| f846c47ecf | |||
| 0d487fd8de | |||
| edea4a41af |
@@ -6,6 +6,49 @@ More detailed information on key changes can be found in the [Developer update n
|
||||
|
||||
The format of this change log follows the advice given at [Keep a CHANGELOG](https://keepachangelog.com).
|
||||
|
||||
## 5.0.1
|
||||
|
||||
### core
|
||||
|
||||
#### Added
|
||||
|
||||
- - Added is_site_registered_in_hub method in lib/classes/hub/api.php to
|
||||
check if the site is registered or not.
|
||||
- Added get_secret method in lib/classes/hub/registration.php to get site's secret.
|
||||
|
||||
For more information see [MDL-83448](https://tracker.moodle.org/browse/MDL-83448)
|
||||
- Added a new optional param to adhoc_task_failed and scheduled_task_failed to allow skipping log finalisation when called from a separate task.
|
||||
|
||||
For more information see [MDL-84442](https://tracker.moodle.org/browse/MDL-84442)
|
||||
- There is a new `core/page_title` Javascript module for manipulating the current page title
|
||||
|
||||
For more information see [MDL-84804](https://tracker.moodle.org/browse/MDL-84804)
|
||||
|
||||
### core_auth
|
||||
|
||||
#### Added
|
||||
|
||||
- A new method called `get_additional_upgrade_token_parameters` has been added to `oauth2_client` class. This will allow custom clients to override this one and add their extra parameters for upgrade token request.
|
||||
|
||||
For more information see [MDL-80380](https://tracker.moodle.org/browse/MDL-80380)
|
||||
|
||||
### core_question
|
||||
|
||||
#### Fixed
|
||||
|
||||
- The unit test repeated\_restore\_test::test\_restore\_course\_with\_same\_stamp\_questions was passing incorrectly on 5.x for question types that use answers.
|
||||
Maintainers of third-party question types may want to re-run the test with the fix in place, or if they have copied parts of this test as the basis of a test in their own plugin, review the changes and see if they should be reflected in their own test.
|
||||
|
||||
For more information see [MDL-85556](https://tracker.moodle.org/browse/MDL-85556)
|
||||
|
||||
### core_user
|
||||
|
||||
#### Added
|
||||
|
||||
- New method `\core_user::get_dummy_fullname(...)` for returning dummy user fullname comprised of configured name fields only
|
||||
|
||||
For more information see [MDL-82132](https://tracker.moodle.org/browse/MDL-82132)
|
||||
|
||||
## 5.0
|
||||
|
||||
### core
|
||||
|
||||
@@ -118,6 +118,10 @@ foreach ($settingspage->children as $childpage) {
|
||||
}
|
||||
$outputhtml .= html_writer::tag('div', '<!-- -->', array('class' => 'clearer'));
|
||||
$outputhtml .= $setting->output_html($data);
|
||||
if ($childpage->has_dependencies()) {
|
||||
$opts = ['dependencies' => $childpage->get_dependencies_for_javascript()];
|
||||
$PAGE->requires->js_call_amd('core/showhidesettings', 'init', [$opts]);
|
||||
}
|
||||
}
|
||||
$outputhtml .= html_writer::end_tag('fieldset');
|
||||
}
|
||||
|
||||
@@ -4897,4 +4897,201 @@
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
<MOODLE version="5.1" requires="4.2.3">
|
||||
<UNICODE level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unicoderequired" />
|
||||
</FEEDBACK>
|
||||
</UNICODE>
|
||||
<DATABASE level="required">
|
||||
<VENDOR name="mariadb" version="10.11.0" />
|
||||
<VENDOR name="mysql" version="8.4" />
|
||||
<VENDOR name="postgres" version="14" />
|
||||
<VENDOR name="mssql" version="14.0" />
|
||||
</DATABASE>
|
||||
<PHP version="8.2.0" level="required">
|
||||
</PHP>
|
||||
<PCREUNICODE level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="pcreunicodewarning" />
|
||||
</FEEDBACK>
|
||||
</PCREUNICODE>
|
||||
<PHP_EXTENSIONS>
|
||||
<PHP_EXTENSION name="iconv" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="iconvrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="mbstring" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="mbstringrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="curl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="curlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="openssl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="opensslrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="tokenizer" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="tokenizerrecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="soap" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="soaprecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="ctype" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ctyperequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zip" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="ziprequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="zlib" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="gd" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="gdrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="simplexml" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="simplexmlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="spl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="splrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="pcre" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="dom" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xml" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="xmlreader" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="intl" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="intlrequired" />
|
||||
</FEEDBACK>
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="json" level="required">
|
||||
</PHP_EXTENSION>
|
||||
<PHP_EXTENSION name="hash" level="required"/>
|
||||
<PHP_EXTENSION name="fileinfo" level="required"/>
|
||||
<PHP_EXTENSION name="sodium" level="required"/>
|
||||
<PHP_EXTENSION name="exif" level="optional"/>
|
||||
</PHP_EXTENSIONS>
|
||||
<PHP_SETTINGS>
|
||||
<PHP_SETTING name="memory_limit" value="96M" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="settingmemorylimit" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="file_uploads" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingfileuploads" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="opcache.enable" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="opcacherecommended" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
<PHP_SETTING name="zend.exception_ignore_args" value="1" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="settingzendexceptionignoreargs" />
|
||||
</FEEDBACK>
|
||||
</PHP_SETTING>
|
||||
</PHP_SETTINGS>
|
||||
<CUSTOM_CHECKS>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_database_storage_engine" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbstorageengine" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="question/engine/upgrade/upgradelib.php" function="quiz_attempts_upgraded" level="required">
|
||||
<FEEDBACK>
|
||||
<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_CHECK file="lib/upgradelib.php" function="check_database_tables_row_format" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unsupporteddbtablerowformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_unoconv_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="unoconvwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_libcurl_version" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="libcurlwarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_format" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfileformat" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_file_per_table" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddbfilepertable" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_large_prefix" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="unsupporteddblargeprefix" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_is_https" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="ishttpswarning" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mysql_incomplete_unicode_support" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="incompleteunicodesupport" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_sixtyfour_bits" level="required">
|
||||
<FEEDBACK>
|
||||
<ON_ERROR message="sixtyfourbitsrequired" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_max_input_vars" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_admin_dir_usage" level="optional">
|
||||
<FEEDBACK>
|
||||
<ON_CHECK message="iscustomadminwarnings" />
|
||||
</FEEDBACK>
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_xmlrpc_usage" level="optional">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_mod_assignment" level="required">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_db_prefix_length" level="required">
|
||||
</CUSTOM_CHECK>
|
||||
<CUSTOM_CHECK file="lib/upgradelib.php" function="check_async_backup" level="recommended">
|
||||
</CUSTOM_CHECK>
|
||||
</CUSTOM_CHECKS>
|
||||
</MOODLE>
|
||||
</COMPATIBILITY_MATRIX>
|
||||
|
||||
@@ -34,8 +34,10 @@ admin_externalpage_setup('registrationmoodleorg');
|
||||
|
||||
$unregistration = optional_param('unregistration', false, PARAM_BOOL);
|
||||
$confirm = optional_param('confirm', false, PARAM_BOOL);
|
||||
// Consider the site 'registered' if records exist locally and at the hub.
|
||||
$siteisregistered = \core\hub\registration::is_registered() && core\hub\api::is_site_registered_in_hub();
|
||||
|
||||
if ($unregistration && \core\hub\registration::is_registered()) {
|
||||
if ($unregistration && $siteisregistered) {
|
||||
if ($confirm) {
|
||||
require_sesskey();
|
||||
\core\hub\registration::unregister(false, false);
|
||||
@@ -60,7 +62,7 @@ if (!$returnurl = optional_param('returnurl', null, PARAM_LOCALURL)) {
|
||||
$returnurl = $isinitialregistration ? '/admin/index.php' : '/admin/registration/index.php';
|
||||
}
|
||||
|
||||
$siteregistrationform = new \core\hub\site_registration_form();
|
||||
$siteregistrationform = new \core\hub\site_registration_form(null, ['registered' => $siteisregistered]);
|
||||
$siteregistrationform->set_data(['returnurl' => $returnurl]);
|
||||
if ($fromform = $siteregistrationform->get_data()) {
|
||||
|
||||
@@ -86,7 +88,7 @@ echo $OUTPUT->header();
|
||||
// Current status of registration.
|
||||
|
||||
$notificationtype = \core\output\notification::NOTIFY_ERROR;
|
||||
if (\core\hub\registration::is_registered()) {
|
||||
if ($siteisregistered) {
|
||||
$lastupdated = \core\hub\registration::get_last_updated();
|
||||
if ($lastupdated == 0) {
|
||||
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
|
||||
@@ -104,7 +106,7 @@ if (\core\hub\registration::is_registered()) {
|
||||
}
|
||||
|
||||
// Heading.
|
||||
if (\core\hub\registration::is_registered()) {
|
||||
if ($siteisregistered) {
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorgupdate', 'core_hub'));
|
||||
} else if ($isinitialregistration) {
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorgcomplete', 'core_hub'));
|
||||
@@ -117,7 +119,7 @@ echo $renderer->moodleorg_registration_message();
|
||||
|
||||
$siteregistrationform->display();
|
||||
|
||||
if (\core\hub\registration::is_registered()) {
|
||||
if ($siteisregistered) {
|
||||
// Unregister link.
|
||||
$unregisterhuburl = new moodle_url("/admin/registration/index.php", ['unregistration' => 1]);
|
||||
echo html_writer::div(html_writer::link($unregisterhuburl, get_string('unregister', 'hub')), 'unregister mt-2');
|
||||
|
||||
@@ -36,6 +36,10 @@ if (function_exists('opcache_reset')) {
|
||||
define('CLI_SCRIPT', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
// Basic functions.
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -31,6 +31,10 @@ define('ABORT_AFTER_CONFIG', true);
|
||||
define('CACHE_DISABLE_ALL', true);
|
||||
define('NO_OUTPUT_BUFFERING', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__ .'/../../../../config.php');
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -39,6 +39,10 @@ define('NO_OUTPUT_BUFFERING', true);
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
define('ABORT_AFTER_CONFIG', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
|
||||
// CLI options.
|
||||
|
||||
@@ -33,6 +33,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
die(); // No access from web!.
|
||||
}
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (the Behat launch scripts expect to start
|
||||
// from the normal environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
// Basic functions.
|
||||
require_once(__DIR__ . '/../../../../lib/clilib.php');
|
||||
require_once(__DIR__ . '/../../../../lib/behat/lib.php');
|
||||
|
||||
@@ -51,5 +51,8 @@ function xmldb_tool_cohortroles_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,5 +36,8 @@ function xmldb_tool_customlang_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -106,5 +106,8 @@ function xmldb_tool_dataprivacy_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_log_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,5 +35,8 @@ function xmldb_logstore_database_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,5 +35,8 @@ function xmldb_logstore_standard_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ Feature: See the competencies for an activity on the course competencies page.
|
||||
When I follow "Competencies"
|
||||
Then I should see "Test-Comp1"
|
||||
And I should see "Test-Comp2"
|
||||
And I set the field "Filter competencies by resource or activity" to "PageName1"
|
||||
And I set the competency filter "Filter competencies by resource or activity" to "PageName1"
|
||||
And I press the enter key
|
||||
And I should see "Test-Comp1"
|
||||
And I should not see "Test-Comp2"
|
||||
And I set the field "Filter competencies by resource or activity" to "PageName2"
|
||||
And I set the competency filter "Filter competencies by resource or activity" to "PageName2"
|
||||
And I press the enter key
|
||||
And I should not see "Test-Comp1"
|
||||
And I should not see "Test-Comp2"
|
||||
|
||||
@@ -169,6 +169,17 @@ switch ($action) {
|
||||
echo $OUTPUT->heading(get_string('managefactor', 'factor_' . $factorobject->name));
|
||||
echo $OUTPUT->active_factors($factor);
|
||||
echo $OUTPUT->single_button($returnurl, get_string('back'));
|
||||
|
||||
// Displays a setup additional button in case it is needed.
|
||||
if ($factorobject->show_additional_setup_button()) {
|
||||
echo $OUTPUT->single_button(
|
||||
url: new \moodle_url('action.php', ['action' => 'setup', 'factor' => $factor]),
|
||||
label: $factorobject->get_additional_setup_string(),
|
||||
method: 'post',
|
||||
options: ['type' => 'primary'],
|
||||
);
|
||||
}
|
||||
|
||||
// JS for modal confirming replace and revoke actions.
|
||||
$PAGE->requires->js_call_amd('tool_mfa/confirmation_modal', 'init', [$context->id]);
|
||||
|
||||
|
||||
@@ -433,6 +433,18 @@ abstract class object_factor_base implements object_factor {
|
||||
return $this->has_setup();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a button should be shown to add factors of the same kind on the preferences page.
|
||||
* For example, give user's the ability to set up multiple security keys.
|
||||
*
|
||||
* Override in child class if necessary.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function show_additional_setup_button(): bool {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if a factor requires input from the user to verify.
|
||||
*
|
||||
@@ -590,6 +602,18 @@ abstract class object_factor_base implements object_factor {
|
||||
return get_string('setupfactor', 'tool_mfa');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string for additional setup button on preferences page.
|
||||
* If the user has the ability to set up multiple security keys.
|
||||
*
|
||||
* Override in child class if necessary.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_additional_setup_string(): string {
|
||||
return get_string('setupfactorbuttonadditional', 'tool_mfa');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string for manage button on preferences page.
|
||||
*
|
||||
|
||||
@@ -530,6 +530,13 @@ class manager {
|
||||
}
|
||||
}
|
||||
|
||||
// Site policies from tool_policy.
|
||||
$policyviewurl = new \moodle_url('/admin/tool/policy/view.php');
|
||||
$policyindexurl = new \moodle_url('/admin/tool/policy/index.php');
|
||||
if ($policyviewurl->compare($url, URL_MATCH_BASE) || $policyindexurl->compare($url, URL_MATCH_BASE)) {
|
||||
return self::NO_REDIRECT;
|
||||
}
|
||||
|
||||
// WS/AJAX check.
|
||||
if (WS_SERVER || AJAX_SCRIPT) {
|
||||
if (isset($SESSION->mfa_pending) && !empty($SESSION->mfa_pending)) {
|
||||
|
||||
@@ -54,5 +54,8 @@ function xmldb_factor_auth_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -53,5 +53,8 @@ function xmldb_factor_email_upgrade($oldversion): bool {
|
||||
upgrade_plugin_savepoint(true, 2024122400, 'factor', 'email');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,5 +96,8 @@ function xmldb_factor_sms_upgrade(int $oldversion): bool {
|
||||
upgrade_plugin_savepoint(true, 2025040700, 'factor', 'sms');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_factor_totp_upgrade($oldversion): bool {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -111,6 +111,15 @@ class factor extends object_factor_base {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if an additional setup button should be shown on the preferences page.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function show_additional_setup_button(): bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* WebAuthn factor implementation.
|
||||
*
|
||||
@@ -151,6 +160,15 @@ class factor extends object_factor_base {
|
||||
return get_string('setupfactorbutton', 'factor_webauthn');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string for additional setup button on preferences page.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_additional_setup_string(): string {
|
||||
return get_string('setupfactorbuttonadditional', 'factor_webauthn');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the string for manage button on preferences page.
|
||||
*
|
||||
|
||||
@@ -56,6 +56,7 @@ $string['settings:userverification'] = 'User verification';
|
||||
$string['settings:userverification_help'] = 'Serves to ensure the person authenticating is in fact who they say they are. User verification can take various forms, such as password, PIN, fingerprint, etc.';
|
||||
$string['setupfactor'] = 'Set up security key';
|
||||
$string['setupfactorbutton'] = 'Set up';
|
||||
$string['setupfactorbuttonadditional'] = 'Add security key';
|
||||
$string['setupfactor:instructionsregistersecuritykey'] = '2. Register a security key.';
|
||||
$string['setupfactor:instructionssecuritykeyname'] = '1. Give your key a name.';
|
||||
$string['setupfactor:intro'] = 'A security key is a physical device that you can use to authenticate yourself. Security keys can be USB tokens, Bluetooth devices, or event built-in fingerprint scanners on your phone or computer.';
|
||||
|
||||
@@ -150,6 +150,7 @@ $string['settings:redir_exclusions_help'] = 'Each new line is a relative URL fro
|
||||
$string['settings:weight'] = 'Factor weight';
|
||||
$string['settings:weight_help'] = 'The weight of this factor if passed. A user needs at least 100 points to log in.';
|
||||
$string['setupfactor'] = 'Set up factor';
|
||||
$string['setupfactorbuttonadditional'] = 'Add additional factor';
|
||||
$string['state:fail'] = 'Fail';
|
||||
$string['state:locked'] = 'Locked';
|
||||
$string['state:neutral'] = 'Neutral';
|
||||
|
||||
@@ -32,6 +32,7 @@ Feature: Set up and manage user factors
|
||||
And I click on "Cancel" "button"
|
||||
And I click on "Manage security key" "button"
|
||||
And I should see "Manage security key"
|
||||
And I should see "Add security key"
|
||||
|
||||
@javascript
|
||||
Scenario: I can revoke a factor only when there is more than one active factor
|
||||
@@ -78,3 +79,15 @@ Feature: Set up and manage user factors
|
||||
And I click on "Replace" "button" in the "MacBook" "table_row"
|
||||
When I click on "Yes, replace" "button" in the "Replace 'MacBook' security key?" "dialogue"
|
||||
Then I should see "Replace security key"
|
||||
|
||||
Scenario: I can add a new factor instance on the manage factor page
|
||||
Given the following config values are set as admin:
|
||||
| enabled | 1 | factor_webauthn |
|
||||
And the following "tool_mfa > User factors" exist:
|
||||
| username | factor | label |
|
||||
| admin | webauthn | MacBook |
|
||||
And I follow "Preferences" in the user menu
|
||||
And I click on "Multi-factor authentication preferences" "link"
|
||||
And I click on "Manage security key" "button"
|
||||
When I click on "Add security key" "button"
|
||||
Then I should see "Set up security key"
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_mobile_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_monitor_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_tool_moodlenet_upgrade(int $oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ class issuer extends persistent {
|
||||
\core\oauth2\issuer::EVERYWHERE => get_string('issueruseineverywhere', 'tool_oauth2'),
|
||||
\core\oauth2\issuer::LOGINONLY => get_string('issueruseinloginonly', 'tool_oauth2'),
|
||||
\core\oauth2\issuer::SERVICEONLY => get_string('issueruseininternalonly', 'tool_oauth2'),
|
||||
\core\oauth2\issuer::SMTPWITHXOAUTH2 => get_string('issueruseinsmtpwithoauth', 'tool_oauth2'),
|
||||
];
|
||||
$mform->addElement('select', 'showonloginpage', get_string('issuerusein', 'tool_oauth2'), $options);
|
||||
$mform->addHelpButton('showonloginpage', 'issuerusein', 'tool_oauth2');
|
||||
@@ -138,6 +139,13 @@ class issuer extends persistent {
|
||||
$mform->addRule('loginpagename', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
||||
$mform->addHelpButton('loginpagename', 'issuerloginpagename', 'tool_oauth2');
|
||||
$mform->hideIf('loginpagename', 'showonloginpage', 'eq', \core\oauth2\issuer::SERVICEONLY);
|
||||
$mform->hideIf('loginpagename', 'showonloginpage', 'eq', \core\oauth2\issuer::SMTPWITHXOAUTH2);
|
||||
|
||||
// Connected email for XOAUTH2.
|
||||
$mform->addElement('text', 'systememail', get_string('issuersmtpsystememail', 'tool_oauth2'));
|
||||
$mform->setType('systememail', PARAM_EMAIL);
|
||||
$mform->addHelpButton('systememail', 'issuersmtpsystememail', 'tool_oauth2');
|
||||
$mform->hideIf('systememail', 'showonloginpage', 'ne', \core\oauth2\issuer::SMTPWITHXOAUTH2);
|
||||
|
||||
// Login scopes.
|
||||
$mform->addElement('text', 'loginscopes', get_string('issuerloginscopes', 'tool_oauth2'));
|
||||
|
||||
@@ -86,7 +86,8 @@ class renderer extends plugin_renderer_base {
|
||||
$namecell->header = true;
|
||||
|
||||
// Login issuer.
|
||||
if ((int)$issuer->get('showonloginpage') == issuer::SERVICEONLY) {
|
||||
if ((int)$issuer->get('showonloginpage') == issuer::SERVICEONLY ||
|
||||
(int)$issuer->get('showonloginpage') == issuer::SMTPWITHXOAUTH2) {
|
||||
$loginissuer = $this->pix_icon('no', get_string('notloginissuer', 'tool_oauth2'), 'tool_oauth2');
|
||||
$logindisplayas = '';
|
||||
} else {
|
||||
|
||||
@@ -89,13 +89,16 @@ $string['issuershowonloginpage'] = 'Show on login page';
|
||||
$string['issuerrequireconfirmation_help'] = 'Require that all users verify their email address before they can log in with OAuth. This applies to newly created accounts as part of the login process, or when an existing Moodle account is connected to an OAuth login via matching email addresses.';
|
||||
$string['issuerrequireconfirmation'] = 'Require email verification';
|
||||
$string['issuers'] = 'Issuers';
|
||||
$string['issuersmtpsystememail'] = 'SMTP email';
|
||||
$string['issuersmtpsystememail_help'] = 'If specified, this email will be used to connect a system account for sending email via SMTP. This is required for some OAuth 2 services (e.g. Microsoft). Please check the documentation for your OAuth 2 service to see if this is required.';
|
||||
$string['issuersservicesallow'] = 'Allow services';
|
||||
$string['issuersservicesnotallow'] = 'Do not allow services';
|
||||
$string['issuerusein'] = 'This service will be used';
|
||||
$string['issuerusein_help'] = 'OAuth 2 services can be used for internal services, on the login page, or both, if required.';
|
||||
$string['issuerusein_help'] = 'OAuth 2 services can be used for internal services, on the login page, SMTP with XOAUTH2, or both login page and internal services, if required.';
|
||||
$string['issueruseineverywhere'] = 'Login page and internal services';
|
||||
$string['issueruseininternalonly'] = 'Internal services only';
|
||||
$string['issueruseinloginonly'] = 'Login page only';
|
||||
$string['issueruseinsmtpwithoauth'] = 'SMTP with XOAUTH2 only';
|
||||
$string['issuerusedforlogin'] = 'Login';
|
||||
$string['issuerusedforinternal'] = 'Internal services';
|
||||
$string['linkedin_service'] = 'LinkedIn';
|
||||
|
||||
@@ -54,13 +54,17 @@ Feature: Basic OAuth2 functionality
|
||||
And I should see "Testing service"
|
||||
And "Allow login" "icon" should exist in the "Testing service" "table_row"
|
||||
And "Allow services" "icon" should exist in the "Testing service" "table_row"
|
||||
And I should see "-" in the "Testing service" "table_row"
|
||||
And "Service discovery successful" "icon" should exist in the "Testing service" "table_row"
|
||||
And I click on "Configure endpoints" "link" in the "Testing service" "table_row"
|
||||
And I should see "authorization_endpoint"
|
||||
And I should not see "discovery_endpoint"
|
||||
And I should see "discovery_endpoint"
|
||||
And I should see "device_authorization_endpoint"
|
||||
And I navigate to "Server > OAuth 2 services" in site administration
|
||||
And I click on "Configure user field mappings" "link" in the "Testing service" "table_row"
|
||||
And I should see "firstname" in the "givenName" "table_row"
|
||||
And I should see "firstname" in the "givenname" "table_row"
|
||||
And I should see "idnumber" in the "sub" "table_row"
|
||||
And I should see "email" in the "email" "table_row"
|
||||
And I should see "lang" in the "locale" "table_row"
|
||||
And I navigate to "Server > OAuth 2 services" in site administration
|
||||
And I click on "Edit" "link" in the "Testing service" "table_row"
|
||||
And I set the following fields to these values:
|
||||
|
||||
@@ -34,6 +34,10 @@ if (function_exists('opcache_reset')) {
|
||||
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
|
||||
// the Behat environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
require_once(__DIR__.'/../../../../lib/testing/lib.php');
|
||||
|
||||
@@ -30,6 +30,10 @@ if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
|
||||
define('IGNORE_COMPONENT_CACHE', true);
|
||||
|
||||
// It makes no sense to use BEHAT_CLI for this script (you cannot initialise PHPunit starting from
|
||||
// the Behat environment), so in case user has set tne environment variable, disable it.
|
||||
putenv('BEHAT_CLI=0');
|
||||
|
||||
require_once(__DIR__.'/../../../../lib/clilib.php');
|
||||
require_once(__DIR__.'/../../../../lib/phpunit/bootstraplib.php');
|
||||
require_once(__DIR__.'/../../../../lib/testing/lib.php');
|
||||
|
||||
@@ -42,5 +42,8 @@ function xmldb_tool_policy_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ $agreedocs = array_values(array_unique($agreedocs));
|
||||
$declinedocs = array_values(array_unique($declinedocs));
|
||||
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_pagelayout('standard');
|
||||
$PAGE->set_pagelayout('secure');
|
||||
$PAGE->set_url('/admin/tool/policy/index.php');
|
||||
$PAGE->set_popup_notification_allowed(false);
|
||||
|
||||
|
||||
@@ -304,3 +304,12 @@ Feature: Viewing acceptances reports and accepting on behalf of other users
|
||||
And I log out
|
||||
When I log in as "user1"
|
||||
Then I should see "Calendar"
|
||||
|
||||
Scenario: Policy acceptance is prioritised when MFA is enabled
|
||||
Given the following config values are set as admin:
|
||||
| enabled | 1 | tool_mfa |
|
||||
And I log in as "user1"
|
||||
And I press "Next"
|
||||
And I set the field "I agree to the This site policy" to "1"
|
||||
When I press "Next"
|
||||
Then I should see "2-step verification"
|
||||
|
||||
@@ -290,9 +290,6 @@ Feature: User must accept policy managed by this plugin when logging in and sign
|
||||
And I set the field "I agree to the This privacy policy." to "0"
|
||||
Then I should see "Please agree to the following policies:"
|
||||
And I should see "Before continuing you need to acknowledge all these policies."
|
||||
# Confirm that user can not browse the site (edit their profile).
|
||||
When I follow "Profile" in the user menu
|
||||
Then I should see "Please agree to the following policies:"
|
||||
|
||||
Scenario: Accept policy on login, accept all policies
|
||||
Given the following config values are set as admin:
|
||||
|
||||
@@ -47,7 +47,7 @@ $numpolicy = optional_param('numpolicy', null, PARAM_INT);
|
||||
$totalpolicies = optional_param('totalpolicies', null, PARAM_INT);
|
||||
|
||||
$PAGE->set_context(context_system::instance());
|
||||
$PAGE->set_pagelayout('standard');
|
||||
$PAGE->set_pagelayout('secure');
|
||||
|
||||
$viewpage = new page_viewdoc($policyid, $versionid, $returnurl, $behalfid, $manage, $numpolicy, $totalpolicies);
|
||||
|
||||
|
||||
@@ -58,5 +58,8 @@ function xmldb_tool_recyclebin_upgrade($oldversion) {
|
||||
upgrade_plugin_savepoint(true, 2024111500, 'tool', 'recyclebin');
|
||||
}
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -177,12 +177,7 @@ class tool_uploadcourse_helper {
|
||||
* @return enrol_plugin[]
|
||||
*/
|
||||
public static function get_enrolment_plugins() {
|
||||
$cache = cache::make('tool_uploadcourse', 'helper');
|
||||
if (($enrol = $cache->get('enrol')) === false) {
|
||||
$enrol = enrol_get_plugins(false);
|
||||
$cache->set('enrol', $enrol);
|
||||
}
|
||||
return $enrol;
|
||||
return enrol_get_plugins(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,5 +52,8 @@ function xmldb_tool_usertours_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ class aiprovider_management_table extends flexible_table implements dynamic_tabl
|
||||
'role' => 'button',
|
||||
'aria-label' => get_string('moveitemup', 'core', $row->name),
|
||||
'title' => get_string('moveitemup', 'core', $row->name),
|
||||
'class' => 'btn btn-link btn-icon',
|
||||
'class' => 'btn btn-link',
|
||||
]),
|
||||
);
|
||||
} else {
|
||||
@@ -396,7 +396,7 @@ class aiprovider_management_table extends flexible_table implements dynamic_tabl
|
||||
'role' => 'button',
|
||||
'aria-label' => get_string('moveitemdown', 'core', $row->name),
|
||||
'title' => get_string('moveitemdown', 'core', $row->name),
|
||||
'class' => 'btn btn-link btn-icon',
|
||||
'class' => 'btn btn-link',
|
||||
]),
|
||||
);
|
||||
} else {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,3 +1,3 @@
|
||||
define("aiplacement_courseassist/selectors",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;return _exports.default={ELEMENTS:{AIDRAWER:"#ai-drawer",AIDRAWER_BODY:"#ai-drawer .ai-drawer-body",PAGE:"#page",MAIN_REGION:'[role="main"]',AIDRAWER_CLOSE:"#ai-drawer-close",RESPONSE:".course-assist-response"},ACTIONS:{SUMMARY:'.course-assist-controls [data-action="summarise"]',EXPLAIN:'.course-assist-controls [data-action="explain"]',RETRY:'.course-assist-controls [data-action="retry"]',DECLINE:'.ai-policy-block [data-action="decline"]',ACCEPT:'.ai-policy-block [data-action="accept"]',REGENERATE:'.course-assist-controls [data-action="regenerate"]',CANCEL:'.course-assist-controls [data-action="cancel"]'}},_exports.default}));
|
||||
define("aiplacement_courseassist/selectors",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0;return _exports.default={ELEMENTS:{AIDRAWER:"#ai-drawer",AIDRAWER_BODY:"#ai-drawer .ai-drawer-body",PAGE:"#page",MAIN_REGION:'[role="main"]',AIDRAWER_CLOSE:"#ai-drawer-close",RESPONSE:".course-assist-response",JUMPTO:'.course-assist-controls [data-region="jumpto"]',ACTION:'.course-assist-controls [data-input-type="action"]'},ACTIONS:{SUMMARY:'.course-assist-controls [data-action="summarise"]',EXPLAIN:'.course-assist-controls [data-action="explain"]',RETRY:'.course-assist-controls [data-action="retry"]',DECLINE:'.ai-policy-block [data-action="decline"]',ACCEPT:'.ai-policy-block [data-action="accept"]',REGENERATE:'.course-assist-controls [data-action="regenerate"]',CANCEL:'.course-assist-controls [data-action="cancel"]'}},_exports.default}));
|
||||
|
||||
//# sourceMappingURL=selectors.min.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Define all of the selectors we will be using on the AI Course assistant.\n *\n * @module aiplacement_courseassist/selectors\n * @copyright 2024 Huong Nguyen <huongnv13@gmail.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nexport default {\n ELEMENTS: {\n AIDRAWER: '#ai-drawer',\n AIDRAWER_BODY: '#ai-drawer .ai-drawer-body',\n PAGE: '#page',\n MAIN_REGION: '[role=\"main\"]',\n AIDRAWER_CLOSE: '#ai-drawer-close',\n RESPONSE: '.course-assist-response',\n },\n ACTIONS: {\n SUMMARY: '.course-assist-controls [data-action=\"summarise\"]',\n EXPLAIN: '.course-assist-controls [data-action=\"explain\"]',\n RETRY: '.course-assist-controls [data-action=\"retry\"]',\n DECLINE: '.ai-policy-block [data-action=\"decline\"]',\n ACCEPT: '.ai-policy-block [data-action=\"accept\"]',\n REGENERATE: '.course-assist-controls [data-action=\"regenerate\"]',\n CANCEL: '.course-assist-controls [data-action=\"cancel\"]',\n }\n};\n"],"names":["ELEMENTS","AIDRAWER","AIDRAWER_BODY","PAGE","MAIN_REGION","AIDRAWER_CLOSE","RESPONSE","ACTIONS","SUMMARY","EXPLAIN","RETRY","DECLINE","ACCEPT","REGENERATE","CANCEL"],"mappings":"oLAsBe,CACXA,SAAU,CACNC,SAAU,aACVC,cAAe,6BACfC,KAAM,QACNC,YAAa,gBACbC,eAAgB,mBAChBC,SAAU,2BAEdC,QAAS,CACLC,QAAS,oDACTC,QAAS,kDACTC,MAAO,gDACPC,QAAS,2CACTC,OAAQ,0CACRC,WAAY,qDACZC,OAAQ"}
|
||||
{"version":3,"file":"selectors.min.js","sources":["../src/selectors.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle. If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Define all of the selectors we will be using on the AI Course assistant.\n *\n * @module aiplacement_courseassist/selectors\n * @copyright 2024 Huong Nguyen <huongnv13@gmail.com>\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\nexport default {\n ELEMENTS: {\n AIDRAWER: '#ai-drawer',\n AIDRAWER_BODY: '#ai-drawer .ai-drawer-body',\n PAGE: '#page',\n MAIN_REGION: '[role=\"main\"]',\n AIDRAWER_CLOSE: '#ai-drawer-close',\n RESPONSE: '.course-assist-response',\n JUMPTO: '.course-assist-controls [data-region=\"jumpto\"]',\n ACTION: '.course-assist-controls [data-input-type=\"action\"]',\n },\n ACTIONS: {\n SUMMARY: '.course-assist-controls [data-action=\"summarise\"]',\n EXPLAIN: '.course-assist-controls [data-action=\"explain\"]',\n RETRY: '.course-assist-controls [data-action=\"retry\"]',\n DECLINE: '.ai-policy-block [data-action=\"decline\"]',\n ACCEPT: '.ai-policy-block [data-action=\"accept\"]',\n REGENERATE: '.course-assist-controls [data-action=\"regenerate\"]',\n CANCEL: '.course-assist-controls [data-action=\"cancel\"]',\n }\n};\n"],"names":["ELEMENTS","AIDRAWER","AIDRAWER_BODY","PAGE","MAIN_REGION","AIDRAWER_CLOSE","RESPONSE","JUMPTO","ACTION","ACTIONS","SUMMARY","EXPLAIN","RETRY","DECLINE","ACCEPT","REGENERATE","CANCEL"],"mappings":"oLAsBe,CACXA,SAAU,CACNC,SAAU,aACVC,cAAe,6BACfC,KAAM,QACNC,YAAa,gBACbC,eAAgB,mBAChBC,SAAU,0BACVC,OAAQ,iDACRC,OAAQ,sDAEZC,QAAS,CACLC,QAAS,oDACTC,QAAS,kDACTC,MAAO,gDACPC,QAAS,2CACTC,OAAQ,0CACRC,WAAY,qDACZC,OAAQ"}
|
||||
@@ -58,6 +58,9 @@ const AICourseAssist = class {
|
||||
this.aiDrawerElement = document.querySelector(Selectors.ELEMENTS.AIDRAWER);
|
||||
this.aiDrawerBodyElement = document.querySelector(Selectors.ELEMENTS.AIDRAWER_BODY);
|
||||
this.pageElement = document.querySelector(Selectors.ELEMENTS.PAGE);
|
||||
this.jumpToElement = document.querySelector(Selectors.ELEMENTS.JUMPTO);
|
||||
this.actionElement = document.querySelector(Selectors.ELEMENTS.ACTION);
|
||||
this.aiDrawerCloseElement = this.aiDrawerElement.querySelector(Selectors.ELEMENTS.AIDRAWER_CLOSE);
|
||||
this.lastAction = '';
|
||||
this.responses = new Map();
|
||||
|
||||
@@ -75,6 +78,7 @@ const AICourseAssist = class {
|
||||
e.preventDefault();
|
||||
this.openAIDrawer();
|
||||
this.lastAction = 'summarise';
|
||||
this.actionElement.focus();
|
||||
const isPolicyAccepted = await this.isPolicyAccepted();
|
||||
if (!isPolicyAccepted) {
|
||||
// Display policy.
|
||||
@@ -89,6 +93,7 @@ const AICourseAssist = class {
|
||||
e.preventDefault();
|
||||
this.openAIDrawer();
|
||||
this.lastAction = 'explain';
|
||||
this.actionElement.focus();
|
||||
const isPolicyAccepted = await this.isPolicyAccepted();
|
||||
if (!isPolicyAccepted) {
|
||||
// Display policy.
|
||||
@@ -111,6 +116,21 @@ const AICourseAssist = class {
|
||||
this.closeAIDrawer();
|
||||
}
|
||||
});
|
||||
|
||||
// Focus on the AI drawer's close button when the jump-to element is focused.
|
||||
this.jumpToElement.addEventListener('focus', () => {
|
||||
this.aiDrawerCloseElement.focus();
|
||||
});
|
||||
|
||||
// Focus on the action element when the AI drawer container receives focus.
|
||||
this.aiDrawerElement.addEventListener('focus', () => {
|
||||
this.actionElement.focus();
|
||||
});
|
||||
|
||||
// Remove active from the action element when it loses focus.
|
||||
this.actionElement.addEventListener('blur', () => {
|
||||
this.actionElement.classList.remove('active');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -212,10 +232,13 @@ const AICourseAssist = class {
|
||||
// Close message drawer if it is shown.
|
||||
MessageDrawerHelper.hide();
|
||||
this.aiDrawerElement.classList.add('show');
|
||||
this.aiDrawerElement.setAttribute('tabindex', 0);
|
||||
this.aiDrawerBodyElement.setAttribute('aria-live', 'polite');
|
||||
if (!this.pageElement.classList.contains('show-drawer-right')) {
|
||||
this.addPadding();
|
||||
}
|
||||
this.jumpToElement.setAttribute('tabindex', 0);
|
||||
this.jumpToElement.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -223,10 +246,21 @@ const AICourseAssist = class {
|
||||
*/
|
||||
closeAIDrawer() {
|
||||
this.aiDrawerElement.classList.remove('show');
|
||||
this.aiDrawerElement.setAttribute('tabindex', -1);
|
||||
this.aiDrawerBodyElement.removeAttribute('aria-live');
|
||||
if (this.pageElement.classList.contains('show-drawer-right') && this.aiDrawerBodyElement.dataset.removepadding === '1') {
|
||||
this.removePadding();
|
||||
}
|
||||
this.jumpToElement.setAttribute('tabindex', -1);
|
||||
|
||||
// We can enforce a focus-visible state on the focus element using element.focus({focusVisible: true}).
|
||||
// Unfortunately, this feature isn't supported in all browsers, only Firefox provides support for it.
|
||||
// Therefore, we will apply the active class to the action element and set focus on it.
|
||||
// This action will make the action element appear focused.
|
||||
// When the action element loses focus,
|
||||
// we will remove the active class at {@see registerEventListeners()}
|
||||
this.actionElement.classList.add('active');
|
||||
this.actionElement.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,8 @@ export default {
|
||||
MAIN_REGION: '[role="main"]',
|
||||
AIDRAWER_CLOSE: '#ai-drawer-close',
|
||||
RESPONSE: '.course-assist-response',
|
||||
JUMPTO: '.course-assist-controls [data-region="jumpto"]',
|
||||
ACTION: '.course-assist-controls [data-input-type="action"]',
|
||||
},
|
||||
ACTIONS: {
|
||||
SUMMARY: '.course-assist-controls [data-action="summarise"]',
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="right"
|
||||
aria-controls="ai-drawer"
|
||||
data-input-type="action"
|
||||
data-bs-delay="200"
|
||||
>
|
||||
{{^isdropdown}}
|
||||
{{> aiplacement_courseassist/sparkles_icon }}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
]
|
||||
}
|
||||
}}
|
||||
<div {{#isdropdown}}id="#ai-features"{{/isdropdown}}
|
||||
<div {{#isdropdown}}id="ai-features"{{/isdropdown}}
|
||||
class="course-assist-controls py-3">
|
||||
{{#isdropdown}}
|
||||
{{> aiplacement_courseassist/actions_dropdown }}
|
||||
@@ -50,4 +50,5 @@
|
||||
{{> aiplacement_courseassist/action_button }}
|
||||
{{/actions}}
|
||||
{{/isdropdown}}
|
||||
{{> core_message/message_jumpto }}
|
||||
</div>
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-input-type="action"
|
||||
>
|
||||
{{> aiplacement_courseassist/sparkles_icon }}
|
||||
{{#str}} aifeatures, aiplacement_courseassist {{/str}}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"contextid": "1"
|
||||
}
|
||||
}}
|
||||
<div class="ai-drawer" id="ai-drawer">
|
||||
<div class="ai-drawer" id="ai-drawer" tabindex="-1">
|
||||
<div class="ai-drawer-header">
|
||||
<button id="ai-drawer-close" class="btn ai-drawer-button" type="button">
|
||||
{{#pix}} e/cancel, core {{/pix}}
|
||||
|
||||
@@ -103,7 +103,8 @@ class hook_listener {
|
||||
|
||||
if ($model == 'custom') {
|
||||
$mform->addElement('header', 'modelsettingsheader', get_string('settings', 'aiprovider_ollama'));
|
||||
$mform->addElement('html', get_string('settings_help', 'aiprovider_ollama'));
|
||||
$settingshelp = \html_writer::tag('p', get_string('settings_help', 'aiprovider_ollama'));
|
||||
$mform->addElement('html', $settingshelp);
|
||||
$mform->addElement(
|
||||
'textarea',
|
||||
'modelextraparams',
|
||||
@@ -117,7 +118,8 @@ class hook_listener {
|
||||
if ($targetmodel) {
|
||||
if ($targetmodel->has_model_settings()) {
|
||||
$mform->addElement('header', 'modelsettingsheader', get_string('settings', 'aiprovider_ollama'));
|
||||
$mform->addElement('html', get_string('settings_help', 'aiprovider_ollama'));
|
||||
$settingshelp = \html_writer::tag('p', get_string('settings_help', 'aiprovider_ollama'));
|
||||
$mform->addElement('html', $settingshelp);
|
||||
$targetmodel->add_model_settings($mform);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,8 @@ class hook_listener {
|
||||
|
||||
if ($model == 'custom') {
|
||||
$mform->addElement('header', 'modelsettingsheader', get_string('settings', 'aiprovider_openai'));
|
||||
$mform->addElement('html', get_string('settings_help', 'aiprovider_openai'));
|
||||
$settingshelp = \html_writer::tag('p', get_string('settings_help', 'aiprovider_openai'));
|
||||
$mform->addElement('html', $settingshelp);
|
||||
$mform->addElement(
|
||||
'textarea',
|
||||
'modelextraparams',
|
||||
@@ -96,7 +97,8 @@ class hook_listener {
|
||||
if ($targetmodel) {
|
||||
if ($targetmodel->has_model_settings()) {
|
||||
$mform->addElement('header', 'modelsettingsheader', get_string('settings', 'aiprovider_openai'));
|
||||
$mform->addElement('html', get_string('settings_help', 'aiprovider_openai'));
|
||||
$settingshelp = \html_writer::tag('p', get_string('settings_help', 'aiprovider_openai'));
|
||||
$mform->addElement('html', $settingshelp);
|
||||
$targetmodel->add_model_settings($mform);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ $string['settings_frequency_penalty'] = 'frequency_penalty';
|
||||
$string['settings_frequency_penalty_help'] = 'The frequency penalty adjusts how often words are repeated. The higher the penalty, the less repetitions in the generated text.';
|
||||
$string['settings_help'] = 'Adjust the settings below to customise how requests are sent to OpenAI.';
|
||||
$string['settings_max_tokens'] = 'max_tokens';
|
||||
$string['settings_max_tokens_help'] = 'The maximum number of tokens to generate in the response';
|
||||
$string['settings_max_tokens_help'] = 'The maximum number of tokens used in the generated text.';
|
||||
$string['settings_presence_penalty'] = 'presence_penalty';
|
||||
$string['settings_presence_penalty_help'] = 'The presence penalty encourages the model to use new words by increasing the likelihood of choosing words it hasn\'t used before. A higher value makes the generated text more diverse, while a lower value allows more repetition.';
|
||||
$string['settings_top_p'] = 'top_p';
|
||||
|
||||
@@ -1925,6 +1925,7 @@ class model {
|
||||
$uniqueid = $this->get_time_splitting()->append_rangeindex($dbprediction->sampleid, $dbprediction->rangeindex);
|
||||
$predictionrecords[$uniqueid]->id = $dbprediction->id;
|
||||
}
|
||||
$dbpredictions->close();
|
||||
}
|
||||
|
||||
return $predictionrecords;
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
# core_auth (subsystem / plugintype) Upgrade notes
|
||||
|
||||
## 5.0.1
|
||||
|
||||
### Added
|
||||
|
||||
- A new method called `get_additional_upgrade_token_parameters` has been added to `oauth2_client` class. This will allow custom clients to override this one and add their extra parameters for upgrade token request.
|
||||
|
||||
For more information see [MDL-80380](https://tracker.moodle.org/browse/MDL-80380)
|
||||
|
||||
## 5.0
|
||||
|
||||
### Removed
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_db_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_email_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_ldap_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_auth_lti_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_manual_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_none_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_auth_oauth2_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,5 +40,8 @@ function xmldb_auth_shibboleth_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -117,6 +117,11 @@ abstract class frontend {
|
||||
foreach ($enabled as $plugin => $info) {
|
||||
// Create plugin front-end object.
|
||||
$class = '\availability_' . $plugin . '\frontend';
|
||||
if (!class_exists($class)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/** @var \core_availability\frontend $frontend */
|
||||
$frontend = new $class();
|
||||
|
||||
// Add to array of required YUI modules.
|
||||
|
||||
@@ -792,11 +792,10 @@ abstract class info {
|
||||
// plugin could also rely on the completion plugin.
|
||||
$pluginmanager = \core_plugin_manager::instance();
|
||||
$enabled = $pluginmanager->get_enabled_plugins('availability');
|
||||
$componentparams = new \stdClass();
|
||||
foreach ($enabled as $plugin => $info) {
|
||||
// Use the static method.
|
||||
/** @var \core_availability\condition $class */
|
||||
$class = '\availability_' . $plugin . '\condition';
|
||||
if ($class::completion_value_used($course, $cmid)) {
|
||||
if (class_exists($class) && $class::completion_value_used($course, $cmid)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,9 +220,9 @@ class tree extends tree_node {
|
||||
|
||||
// First see if it's a condition. These have a defined type.
|
||||
if (isset($child->type)) {
|
||||
// Look for a plugin of this type.
|
||||
/** @var \core_availability\condition $classname */
|
||||
$classname = '\availability_' . $child->type . '\condition';
|
||||
if (!array_key_exists($child->type, $enabled)) {
|
||||
if (!array_key_exists($child->type, $enabled) || !class_exists($classname)) {
|
||||
if ($lax) {
|
||||
// On load of existing settings, ignore if class
|
||||
// doesn't exist.
|
||||
|
||||
@@ -5487,18 +5487,39 @@ class restore_move_module_questions_categories extends restore_execution_step {
|
||||
$originalcontext = context::instance_by_id($contextid, IGNORE_MISSING);
|
||||
if ($originalcontext && has_capability('mod/qbank:view', $originalcontext)) {
|
||||
$originalquestions = get_questions_category(question_get_top_category($contextid), false);
|
||||
$targetcoursecontext = context_course::instance($this->get_courseid());
|
||||
foreach ($originalquestions as $originalquestion) {
|
||||
$backupids = restore_dbops::get_backup_ids_record(
|
||||
$this->get_restoreid(),
|
||||
'question',
|
||||
$originalquestion->id,
|
||||
);
|
||||
// Restored question references will point to the restored copy of the question. Select question references
|
||||
// that point to that restored copy, only if they are within the target course's context, so we can update
|
||||
// them to point to the original question.
|
||||
$conpathlike = $DB->sql_like('con.path', '?');
|
||||
$references = $DB->get_records_sql(
|
||||
"SELECT qr.id, qr.questionbankentryid
|
||||
FROM {question_references} qr
|
||||
JOIN {context} con ON qr.usingcontextid = con.id
|
||||
JOIN {question_versions} qv ON qv.questionbankentryid = qr.questionbankentryid
|
||||
WHERE qv.questionid = ?
|
||||
AND {$conpathlike}",
|
||||
[
|
||||
$backupids->newitemid,
|
||||
$targetcoursecontext->path . '/%',
|
||||
],
|
||||
);
|
||||
if (empty($references)) {
|
||||
continue;
|
||||
}
|
||||
[$refin, $refparams] = $DB->get_in_or_equal(array_keys($references));
|
||||
$DB->set_field_select(
|
||||
'question_references',
|
||||
'questionbankentryid',
|
||||
$DB->get_field('question_versions', 'questionbankentryid', ['questionid' => $backupids->itemid]),
|
||||
'questionbankentryid = (SELECT questionbankentryid FROM {question_versions} WHERE questionid = ?)',
|
||||
[$backupids->newitemid],
|
||||
'id ' . $refin,
|
||||
$refparams,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
|
||||
@@ -1104,8 +1104,9 @@ class core_backup_renderer extends plugin_renderer_base {
|
||||
$sourceurl = new \moodle_url('/course/view.php', array('id' => $copy->sourceid));
|
||||
|
||||
$tablerow = array(
|
||||
html_writer::link($sourceurl, $copy->source),
|
||||
$copy->destination,
|
||||
html_writer::link($sourceurl, format_string($copy->source, true,
|
||||
['context' => context_course::instance($copy->sourceid)])),
|
||||
format_string($copy->destination, true, ['context' => context_course::instance($copy->sourceid)]),
|
||||
userdate($copy->timecreated),
|
||||
get_string($copy->operation),
|
||||
$this->get_status_display($copy->status, $copy->backupid, $copy->restoreid, $copy->operation)
|
||||
|
||||
@@ -40,6 +40,7 @@ if (empty($CFG->enablebadges)) {
|
||||
}
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$title = [get_string('alignment', 'badges'), $badge->name];
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type]);
|
||||
require_capability('moodle/badges:configuredetails', $context);
|
||||
|
||||
@@ -50,6 +51,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type, 'id' => $badge->courseid]);
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -63,7 +65,7 @@ $currenturl = new moodle_url('/badges/alignment.php', ['id' => $badge->id]);
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
@@ -56,7 +56,7 @@ if ($action == 'delete' && $confirm && confirm_sesskey()) {
|
||||
} else {
|
||||
$msg = get_string('sitebackpacknotdeleted', 'badges');
|
||||
}
|
||||
} else if ($action == 'moveup' || $action == 'movedown') {
|
||||
} else if (($action == 'moveup' || $action == 'movedown') && confirm_sesskey()) {
|
||||
// If no backpack has been selected, there isn't anything to move.
|
||||
if (empty($id)) {
|
||||
redirect($url);
|
||||
|
||||
+3
-1
@@ -38,6 +38,7 @@ if (empty($CFG->enablebadges)) {
|
||||
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$title = [get_string('bcriteria', 'badges'), $badge->name];
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
||||
|
||||
require_capability('moodle/badges:configurecriteria', $context);
|
||||
@@ -49,6 +50,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -63,7 +65,7 @@ $currenturl = new moodle_url('/badges/criteria.php', array('id' => $badge->id));
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name, $currenturl);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
@@ -41,6 +41,7 @@ require_login();
|
||||
|
||||
$return = new moodle_url('/badges/criteria.php', array('id' => $badgeid));
|
||||
$badge = new badge($badgeid);
|
||||
$title = [get_string('addcriterion', 'badges'), $badge->name];
|
||||
$context = $badge->get_context();
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
||||
|
||||
@@ -65,6 +66,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -78,7 +80,7 @@ $urlparams = array('badgeid' => $badgeid, 'edit' => $edit, 'type' => $type, 'cri
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url('/badges/criteria_settings.php', $urlparams);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name, new moodle_url('overview.php', array('id' => $badge->id)))
|
||||
->add(get_string('bcriteria', 'badges'), new moodle_url('criteria.php', ['id' => $badge->id]))
|
||||
->add(get_string('criteria_' . $type, 'badges'));
|
||||
@@ -119,4 +121,4 @@ if (!empty($addcourse)) {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
$mform->display();
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+5
-1
@@ -56,8 +56,10 @@ if (!empty($badgeid)) {
|
||||
// Check capabilities.
|
||||
$context = $badge->get_context();
|
||||
if ($action == 'message') {
|
||||
$title = [get_string('configuremessage', 'badges'), $badge->name];
|
||||
require_capability('moodle/badges:configuremessages', $context);
|
||||
} else {
|
||||
$title = [get_string('badgedetails', 'badges'), $badge->name];
|
||||
require_capability('moodle/badges:configuredetails', $context);
|
||||
}
|
||||
|
||||
@@ -78,6 +80,7 @@ if (!empty($badgeid)) {
|
||||
|
||||
$params = ['courseid' => $courseid];
|
||||
$badgename = get_string('create', 'badges');
|
||||
$title = [$badgename];
|
||||
|
||||
// Check capabilities.
|
||||
require_capability('moodle/badges:createbadge', $context);
|
||||
@@ -94,6 +97,7 @@ $navurl = new moodle_url('/badges/index.php', ['type' => $badge->type]);
|
||||
if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type, 'id' => $badge->courseid]);
|
||||
$PAGE->set_pagelayout('incourse');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -108,7 +112,7 @@ $currenturl = new moodle_url('/badges/edit.php', $params);
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badgename);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->add_body_class('limitedwidth');
|
||||
$PAGE->navbar->add($badgename);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ if (empty($CFG->enablebadges)) {
|
||||
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$title = [get_string('bendorsement', 'badges'), $badge->name];
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type]);
|
||||
require_capability('moodle/badges:configuredetails', $context);
|
||||
|
||||
@@ -49,6 +50,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type, 'id' => $badge->courseid]);
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -62,7 +64,7 @@ $currenturl = new moodle_url('/badges/endorsement.php', ['id' => $badgeid]);
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
|
||||
+3
-1
@@ -39,6 +39,7 @@ if (empty($CFG->enablebadges)) {
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
||||
$title = [$badge->name];
|
||||
|
||||
if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
if (empty($CFG->badges_allowcoursebadges)) {
|
||||
@@ -47,6 +48,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
@@ -62,7 +64,7 @@ $currenturl = new moodle_url('/badges/overview.php', array('id' => $badge->id));
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
require_capability('moodle/badges:viewbadges', $context);
|
||||
|
||||
@@ -40,6 +40,7 @@ if (empty($CFG->enablebadges)) {
|
||||
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$title = [get_string('awards', 'badges'), $badge->name];
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type));
|
||||
|
||||
require_capability('moodle/badges:viewawarded', $context);
|
||||
@@ -51,6 +52,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
$navurl = new moodle_url('/badges/index.php', array('type' => $badge->type, 'id' => $badge->courseid));
|
||||
$PAGE->set_pagelayout('standard');
|
||||
navigation_node::override_active_url($navurl);
|
||||
@@ -63,7 +65,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url('/badges/recipients.php', ['id' => $badgeid]);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name);
|
||||
|
||||
/** @var core_badges_renderer $output */
|
||||
|
||||
+3
-1
@@ -41,6 +41,7 @@ if (empty($CFG->enablebadges)) {
|
||||
|
||||
$badge = new badge($badgeid);
|
||||
$context = $badge->get_context();
|
||||
$title = [get_string('relatedbages', 'badges'), $badge->name];
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type]);
|
||||
require_capability('moodle/badges:configuredetails', $context);
|
||||
|
||||
@@ -51,6 +52,7 @@ if ($badge->type == BADGE_TYPE_COURSE) {
|
||||
require_login($badge->courseid);
|
||||
$course = get_course($badge->courseid);
|
||||
$heading = format_string($course->fullname, true, ['context' => $context]);
|
||||
$title[] = $heading;
|
||||
|
||||
$navurl = new moodle_url('/badges/index.php', ['type' => $badge->type, 'id' => $badge->courseid]);
|
||||
$PAGE->set_pagelayout('standard');
|
||||
@@ -65,7 +67,7 @@ $currenturl = new moodle_url('/badges/related.php', ['id' => $badge->id]);
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_url($currenturl);
|
||||
$PAGE->set_heading($heading);
|
||||
$PAGE->set_title($badge->name);
|
||||
$PAGE->set_title(implode(\moodle_page::TITLE_SEPARATOR, $title));
|
||||
$PAGE->navbar->add($badge->name);
|
||||
$output = $PAGE->get_renderer('core', 'badges');
|
||||
$msg = optional_param('msg', '', PARAM_TEXT);
|
||||
|
||||
@@ -56,13 +56,13 @@
|
||||
<td> {{{backpackweburl}}} </td>
|
||||
<td>
|
||||
{{#canmoveup}}
|
||||
<a href="{{baseurl}}?id={{id}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
|
||||
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=moveup">{{#pix}}t/up, core,{{#str}}moveup{{/str}}{{/pix}}</a>
|
||||
{{/canmoveup}}
|
||||
{{^canmoveup}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
{{/canmoveup}}
|
||||
{{#canmovedown}}
|
||||
<a href="{{baseurl}}?id={{id}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
|
||||
<a href="{{baseurl}}?id={{id}}&sesskey={{sesskey}}&action=movedown">{{#pix}}t/down, core,{{#str}}movedown{{/str}}{{/pix}}</a>
|
||||
{{/canmovedown}}
|
||||
{{^canmovedown}}
|
||||
{{#pix}}spacer, moodle{{/pix}}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_badges_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_calendar_month_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_calendar_upcoming_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ class fetch_addable_blocks extends external_api {
|
||||
}
|
||||
|
||||
// Firstly, we need to load all currently existing page blocks to later determine which blocks are addable.
|
||||
$page->blocks->load_blocks(false);
|
||||
$page->blocks->load_blocks(true);
|
||||
$page->blocks->create_all_block_instances();
|
||||
|
||||
$addableblocks = $page->blocks->get_addable_blocks();
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_block_completionstatus_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,5 +56,8 @@ function xmldb_block_course_summary_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -441,6 +441,11 @@ class block_edit_form extends \core_form\dynamic_form {
|
||||
$blockregion = $this->optional_param('blockregion', null, PARAM_TEXT);
|
||||
$newblock = $this->page->blocks->add_block_at_end_of_default_region($this->block->name(),
|
||||
empty($blockregion) ? null : $blockregion);
|
||||
|
||||
if (empty($newblock)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->page->blocks->load_blocks();
|
||||
$newblock = $this->page->blocks->find_instance($newblock->instance->id);
|
||||
$newdata = $this->prepare_defaults($newblock->instance);
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_feedback_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_block_html_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -591,7 +591,7 @@ class main implements renderable, templatable {
|
||||
if ($CFG->coursecreationguide) {
|
||||
// Add quickstart guide link.
|
||||
$quickstart = new \moodle_url($CFG->coursecreationguide, ['lang' => current_language()]);
|
||||
$docparams = [
|
||||
$docparams += [
|
||||
'quickhref' => $quickstart->out(),
|
||||
'quicktitle' => get_string('viewquickstart', 'block_myoverview'),
|
||||
'quicktarget' => '_blank',
|
||||
|
||||
@@ -41,5 +41,8 @@ function xmldb_block_myoverview_upgrade($oldversion) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
}
|
||||
.block_myoverview .whitebutton .btn-secondary {
|
||||
background: white;
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
border-color: var(--bs-primary);
|
||||
color: var(--bs-primary);
|
||||
}
|
||||
|
||||
.page-mycourses .block_myoverview .block-controls {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
}
|
||||
}}
|
||||
<div class="ms-auto dropdown">
|
||||
<button class="btn btn-link btn-icon coursemenubtn"
|
||||
<button class="btn btn-icon coursemenubtn aabtn"
|
||||
type="button"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
{{< core_course/coursecards }}
|
||||
{{$menu}}
|
||||
<div class="card-footer menu border-0 bg-white ms-auto">
|
||||
<div class="card-footer menu border-0 bg-white ms-auto p-2">
|
||||
{{> block_myoverview/course-action-menu }}
|
||||
</div>
|
||||
{{/menu}}
|
||||
|
||||
@@ -63,5 +63,8 @@ function xmldb_block_navigation_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_recent_activity_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,5 +55,8 @@ function xmldb_block_recentlyaccesseditems_upgrade($oldversion, $block) {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
// Automatically generated Moodle v5.0.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
{{{icon}}}
|
||||
</div>
|
||||
<div class="w-100 line-height-3 text-truncate ms-2">
|
||||
<h6 class="mb-0 text-truncate"><span class="clickable">{{{name}}}</span></h6>
|
||||
<h4 class="mb-0 text-truncate h6"><span class="clickable">{{{name}}}</span></h4>
|
||||
<small class="text-truncate mb-0">{{{coursename}}}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user