Skip to content

Commit

Permalink
Merge remote-tracking branch 'moodlehq/MOODLE_402_STABLE' into IOMAD_…
Browse files Browse the repository at this point in the history
…402_STABLE
  • Loading branch information
turf212 committed Oct 9, 2023
2 parents 05b1dd1 + 9713039 commit da31b03
Show file tree
Hide file tree
Showing 481 changed files with 6,445 additions and 2,675 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- v[0-9]+.[0-9]+.[0-9]+*

env:
php: 8.1
php: 8.2

jobs:
Grunt:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
db: mysqli
# PostgreSQL builds always run with the highest PHP supported version.
- os: ubuntu-22.04
php: 8.1
php: 8.2
db: pgsql

steps:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Windows Testing
on:
workflow_dispatch
env:
php: 8.1
php: 8.2

jobs:
Grunt:
Expand Down Expand Up @@ -46,13 +46,13 @@ jobs:
matrix:
include:
- os: windows-latest
php: 8.1
php: 8.2
# Ideally we should use mysql/mariadb, but they are 4x slower without tweaks and configuration
# so let's run only postgres (1.5h vs 6h) only, If some day we want to improve the mysql runs,
# this is the place to enable them.
# db: mysqli
db: pgsql
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium
extensions: exif, fileinfo, gd, intl, pgsql, mysql, redis, soap, sodium, zip
- os: windows-latest
php: 8.0
db: pgsql
Expand Down
2 changes: 1 addition & 1 deletion .grunt/jsdoc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ Moodle - the world's open source learning platform
This generated documentation includes API documentation for JavaScript written in the AMD and ES2015 module formats within Moodle.

## Related information
See [https://docs.moodle.org/dev](https://docs.moodle.org/dev) for other related Developer Documentation.
See [https://moodledev.io](https://moodledev.io) for other related Developer Documentation.
2 changes: 1 addition & 1 deletion .grunt/jsdoc/jsdoc.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ module.exports = {
],
"menu": {
"Developer Docs": {
href: "https://docs.moodle.org/dev",
href: "https://moodledev.io",
target: "_blank",
"class": "menu-item",
id: "devdocs"
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ of developers, designers, teachers, testers, translators and other users. We
work in universities, schools, companies and other places. You are very welcome
to join us and contribute to the project.

See <https://docs.moodle.org/dev/Contributing_to_Moodle> for the many ways you
See <https://moodledev.io/general/community/contribute> for the many ways you
can help, not only with coding.

Moodle is open to community contributions to core, though all code must go
Expand Down Expand Up @@ -35,7 +35,7 @@ submitted patches has evolved.
* New features are developed on the master branch. Bug fixes are also
backported to currently supported maintenance (stable) branches.

For further details, see <https://docs.moodle.org/dev/Process>.
For further details, see <https://moodledev.io/general/development/process>.

Moodle plugins
--------------
Expand All @@ -53,4 +53,4 @@ be easily installed and updated via the Moodle administration interface.
the plugins directory. We do not pull from your code repository; you must do
it explicitly.

For further details, see <https://docs.moodle.org/dev/Plugin_contribution>.
For further details, see <https://moodledev.io/general/community/plugincontribution>.
2 changes: 1 addition & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Moodle is widely used around the world by universities, schools, companies and
all manner of organisations and individuals.

Moodle is provided freely as open source software, under the GNU General Public
License <https://docs.moodle.org/dev/License>.
License <https://moodledev.io/general/license>.

Moodle is written in PHP and JavaScript and uses an SQL database for storing
the data.
Expand Down
3 changes: 1 addition & 2 deletions admin/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@
$outputhtml .= html_writer::end_tag('div');
}

$visiblepathtosection = array_reverse($settingspage->visiblepath);
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$PAGE->set_heading($SITE->fullname);
if ($buttons) {
$PAGE->set_button($buttons);
Expand Down
2 changes: 2 additions & 0 deletions admin/environment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4301,6 +4301,8 @@
</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_CHECKS>
</MOODLE>
</COMPATIBILITY_MATRIX>
6 changes: 3 additions & 3 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
$strlicense = get_string('license');

$PAGE->navbar->add($strlicense);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . 'Moodle ' . $CFG->target_release, false);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);

Expand Down Expand Up @@ -267,7 +267,7 @@
upgrade_init_javascript();

$PAGE->navbar->add($strdatabasesetup);
$PAGE->set_title($strinstallation.' - Moodle '.$CFG->target_release);
$PAGE->set_title($strinstallation . moodle_page::TITLE_SEPARATOR . $CFG->target_release, false);
$PAGE->set_heading($strinstallation);
$PAGE->set_cacheable(false);

Expand Down Expand Up @@ -818,7 +818,7 @@

if (!has_capability('moodle/site:config', $context)) {
// Do not throw exception display an empty page with administration menu if visible for current user.
$PAGE->set_title($SITE->fullname);
$PAGE->set_title(get_string('home'));
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();
echo $OUTPUT->footer();
Expand Down
2 changes: 1 addition & 1 deletion admin/localplugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Displays the list of found local plugins, their version (if found) and
* a link to delete the local plugin.
*
* @see http://docs.moodle.org/dev/Local_customisation
* @see https://moodledev.io/docs/apis/plugintypes/local
* @package admin
* @copyright 2010 David Mudrak <david.mudrak@gmail.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
2 changes: 1 addition & 1 deletion admin/plagiarism.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* Displays the list of found plagiarism plugins, their version (if found) and
* a link to uninstall the plagiarism plugin.
*
* @see http://docs.moodle.org/dev/Plagiarism_API
* @see https://moodledev.io/docs/apis/subsystems/plagiarism
* @package admin
* @copyright 2012 Dan Marsden <dan@danmarsden.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,14 @@ class adminpresets_admin_setting_configmultiselect extends adminpresets_setting
/** @var \admin_setting_configmultiselect $settingdata */
protected $settingdata;

/**
* Ensure that the $value values are setting choices.
*
* @param mixed $value Setting value
* @return mixed Returns false if wrong param value
*/
protected function set_value($value) {
if ($value) {
$options = explode(',', $value);
foreach ($options as $option) {

foreach ($this->settingdata->choices as $key => $choice) {

if ($key == $option) {
$this->value = $option;
$this->set_visiblevalue();
return true;
}
}
}

$value = implode(',', $options);
}
$this->value = $value;
$this->set_visiblevalue();

return true;
}

protected function set_visiblevalue() {
$values = explode(',', $this->value);
$visiblevalues = [];

foreach ($values as $value) {

if (!empty($this->settingdata->choices[$value])) {
// Ensure that each value exists as a setting choice.
if (array_key_exists($value, $this->settingdata->choices)) {
$visiblevalues[] = $this->settingdata->choices[$value];
}
}
Expand Down
14 changes: 8 additions & 6 deletions admin/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function install_licence_page() {
$output .= $this->heading(get_string('copyrightnotice'));
$output .= $this->box($copyrightnotice, 'copyrightnotice');
$output .= html_writer::empty_tag('br');
$output .= $this->confirm(get_string('doyouagree'), $continue, "http://docs.moodle.org/dev/License");
$output .= $this->confirm(get_string('doyouagree'), $continue, "https://moodledev.io/general/license");
$output .= $this->footer();

return $output;
Expand Down Expand Up @@ -745,10 +745,10 @@ protected function moodle_copyright() {
//////////////////////////////////////////////////////////////////////////////////////////////////
//// IT IS ILLEGAL AND A VIOLATION OF THE GPL TO HIDE, REMOVE OR MODIFY THIS COPYRIGHT NOTICE ///
$copyrighttext = '<a href="http://moodle.org/">Moodle</a> '.
'<a href="http://docs.moodle.org/dev/Releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'<a href="https://moodledev.io/general/releases" title="'.$CFG->version.'">'.$CFG->release.'</a><br />'.
'Copyright &copy; 1999 onwards, Martin Dougiamas<br />'.
'and <a href="http://moodle.org/dev">many other contributors</a>.<br />'.
'<a href="http://docs.moodle.org/dev/License">GNU Public License</a>';
'<a href="https://moodledev.io/general/license">GNU Public License</a>';
//////////////////////////////////////////////////////////////////////////////////////////////////

return $this->box($copyrighttext, 'copyright');
Expand Down Expand Up @@ -897,7 +897,8 @@ protected function campaign_content(bool $showcampaigncontent): string {
$url = "https://campaign.moodle.org/current/lms/{$lang}/install/";
$params = [
'url' => $url,
'iframeid' => 'campaign-content'
'iframeid' => 'campaign-content',
'title' => get_string('campaign', 'admin'),
];

return $this->render_from_template('core/external_content_banner', $params);
Expand All @@ -918,7 +919,8 @@ protected function services_and_support_content(bool $showservicesandsupport): s
$url = "https://campaign.moodle.org/current/lms/{$lang}/servicesandsupport/";
$params = [
'url' => $url,
'iframeid' => 'services-support-content'
'iframeid' => 'services-support-content',
'title' => get_string('supportandservices', 'admin'),
];

return $this->render_from_template('core/external_content_banner', $params);
Expand Down Expand Up @@ -990,7 +992,7 @@ protected function moodle_available_update_info(\core\update\info $updateinfo) {
* @return string HTML to output.
*/
protected function release_notes_link() {
$releasenoteslink = get_string('releasenoteslink', 'admin', 'http://docs.moodle.org/dev/Releases');
$releasenoteslink = get_string('releasenoteslink', 'admin', 'https://moodledev.io/general/releases');
$releasenoteslink = str_replace('target="_blank"', 'onclick="this.target=\'_blank\'"', $releasenoteslink); // extremely ugly validation hack
return $this->box($releasenoteslink, 'generalbox alert alert-info');
}
Expand Down
4 changes: 2 additions & 2 deletions admin/searchreindex.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
admin_externalpage_setup('searchareas', '', null, (new moodle_url('/admin/searchreindex.php'))->out(false));

// Get area parameter and check it exists.
$areaid = required_param('areaid', PARAM_ALPHAEXT);
$areaid = required_param('areaid', PARAM_ALPHANUMEXT);
$area = \core_search\manager::get_search_area($areaid);
if ($area === false) {
throw new moodle_exception('invalidrequest');
Expand All @@ -44,7 +44,7 @@

// Start page output.
$heading = get_string('gradualreindex', 'search', '');
$PAGE->set_title($PAGE->title . ': ' . $heading);
$PAGE->set_title($areaname . ' - ' . get_string('gradualreindex', 'search', ''));
$PAGE->navbar->add($heading);
echo $OUTPUT->header();
echo $OUTPUT->heading($heading);
Expand Down
4 changes: 1 addition & 3 deletions admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@
$PAGE->set_button($buttons);
}

$visiblepathtosection = array_reverse($settingspage->visiblepath);

$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $settingspage->visiblepath));
$PAGE->set_heading($SITE->fullname);
echo $OUTPUT->header();

Expand Down
12 changes: 12 additions & 0 deletions admin/settings/appearance.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@

// "htmlsettings" settingpage
$temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
$sitenameintitleoptions = [
'shortname' => new lang_string('shortname'),
'fullname' => new lang_string('fullname'),
];
$sitenameintitleconfig = new admin_setting_configselect(
'sitenameintitle',
new lang_string('sitenameintitle', 'admin'),
new lang_string('sitenameintitle_help', 'admin'),
'shortname',
$sitenameintitleoptions
);
$temp->add($sitenameintitleconfig);
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
$temp->add(new admin_setting_emoticons());
$ADMIN->add('appearance', $temp);
Expand Down
2 changes: 1 addition & 1 deletion admin/settings/security.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
$temp->add(new admin_setting_heading('adminpresets', new lang_string('siteadminpresetspluginname', 'core_adminpresets'), ''));
$sensiblesettingsdefault = 'recaptchapublickey@@none, recaptchaprivatekey@@none, googlemapkey3@@none, ';
$sensiblesettingsdefault .= 'secretphrase@@url, cronremotepassword@@none, smtpuser@@none, ';
$sensiblesettingsdefault .= 'smtppass@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'smtppass@@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'dbpass@@logstore_database, messageinbound_hostpass@@none, ';
$sensiblesettingsdefault .= 'bind_pw@@auth_cas, pass@@auth_db, bind_pw@@auth_ldap, ';
$sensiblesettingsdefault .= 'dbpass@@enrol_database, bind_pw@@enrol_ldap, ';
Expand Down
30 changes: 18 additions & 12 deletions admin/tests/external/set_plugin_order_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,51 +73,57 @@ public function test_execute_editors(
* @return array
*/
public function execute_editor_provider(): array {
$pluginmanager = \core_plugin_manager::instance();
$allplugins = array_keys($pluginmanager->get_plugins_of_type('editor'));

// Disabled editors are listed alphabetically at the end.
$getorder = function (array $plugins) use ($allplugins) {
return array_merge(
$plugins,
array_diff($allplugins, array_values($plugins)),
);
};
return [
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_textarea',
'direction' => 1, // DOWN.
'expected' => [
'expected' => $getorder([
'tiny',
'textarea',
'atto',
],
]),
'newtexteditors' => 'tiny,textarea',
],
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_textarea',
'direction' => -1, // UP.
'expected' => [
'expected' => $getorder([
'textarea',
'tiny',
'atto',
],
]),
'newtexteditors' => 'textarea,tiny',
],
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_tiny',
'direction' => 1, // DOWN.
// Tiny is already at the bottom of the list of enabled plugins.
'expected' => [
'expected' => $getorder([
'textarea',
'tiny',
'atto',
],
]),
'newtexteditors' => 'textarea,tiny',
],
[
'initialstate' => 'textarea,tiny',
'pluginname' => 'editor_atto',
'direction' => 1, // DOWN.
// Atto is not enabled. Disabled editors are listed lexically after enabled editors.
'expected' => [
'expected' => $getorder([
'textarea',
'tiny',
'atto',
],
]),
'newtexteditors' => 'textarea,tiny',
],
];
Expand Down
4 changes: 2 additions & 2 deletions admin/tool/admin_presets/classes/form/import_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public function definition(): void {
$mform->setType('name', PARAM_TEXT);

// File upload.
$mform->addElement('filepicker', 'xmlfile',
get_string('selectfile', 'tool_admin_presets'));
$mform->addElement('filepicker', 'xmlfile', get_string('selectfile', 'tool_admin_presets'), null,
['accepted_types' => ['.xml']]);
$mform->addRule('xmlfile', null, 'required');

$this->add_action_buttons(true, get_string('import', 'tool_admin_presets'));
Expand Down
Loading

0 comments on commit da31b03

Please sign in to comment.