Skip to content

Commit

Permalink
V405.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Oct 7, 2024
1 parent 11004ae commit 9c20b9b
Show file tree
Hide file tree
Showing 26 changed files with 240 additions and 188 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
strategy:
fail-fast: true
matrix:
php: ['8.1', '8.2']
moodle-branch: ['MOODLE_404_STABLE']
php: ['8.3']
moodle-branch: ['MOODLE_405_STABLE']
database: [mariadb]

steps:
Expand Down
7 changes: 7 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Change Log in version 405.0.1 (2024100500)
==========================================
1. Block region tidy when editing, 'Add block' button for each region and added 'blockregioneditingtitleshown' setting
under 'Block' with a default of true.
2. Impact of MDL-81920 and MDL-81960.
3. Release candidate initial release.

Change Log in version 404.1.1 (2024032803)
==========================================
1. Fix missing 'recaptcha' on login form.
Expand Down
4 changes: 2 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ This theme has been developed by the following:

Required release of Moodle
==========================
This version works with Moodle 4.4 version 2024042200.00 (Build: 20231009) and above within the MOODLE_404_STABLE branch until the
This version works with Moodle 4.5 version 2024100700.00 (Build: 20241007) and above within the MOODLE_405_STABLE branch until the
next release.

Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/404/en/Installing_Moodle)'.
Please ensure that your hardware and software complies with 'Requirements' in '[Installing Moodle](https://docs.moodle.org/405/en/Installing_Moodle)'.

Installation
============
Expand Down
5 changes: 3 additions & 2 deletions classes/admin_setting_configstoredfiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

use context_system;
use context_user;
use core\url;

defined('MOODLE_INTERNAL') || die;

Expand Down Expand Up @@ -395,10 +396,10 @@ public static function setting_file_urls($setting, $filearea, $theme) {
$syscontext->id, $component, $filearea, 0, 'sortorder,filepath,filename', false); // Item id could not be 0!
foreach ($files as $file) {
$filepath = $file->get_filepath().$file->get_filename();
$url = \moodle_url::make_file_url(
$url = url::make_file_url(
"$CFG->wwwroot/pluginfile.php", "/$syscontext->id/$component/$filearea/$itemid".$filepath);
// Now this is tricky because the we can not hardcode http or https here, lets use the relative link.
// Note: unfortunately moodle_url does not support //urls yet.
// Note: unfortunately url does not support //urls yet.
$url = preg_replace('|^https?://|i', '//', $url->out(false));
$urls[] = $url;
}
Expand Down
16 changes: 8 additions & 8 deletions classes/admin_setting_getprops.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

use context_system;
use context_user;
use html_table;
use html_writer;
use moodle_url;
use core_table\output\html_table;
use core\output\html_writer;
use core\url;

/**
* Get properties class.
Expand Down Expand Up @@ -133,7 +133,7 @@ public function output_html($data, $query = '') {
if ($saveprops) {
$props = \theme_adaptable\toolbox::get_properties($this->pluginfrankenstyle);

$returnurl = new moodle_url('/admin/settings.php', ['section' => $this->settingsectionname]);
$returnurl = new url('/admin/settings.php', ['section' => $this->settingsectionname]);
$returnbutton = '<div class="singlebutton"><a class="btn btn-secondary" href="' . $returnurl->out(true) . '">' .
$this->returnbuttonname . '</a></div>';
$return .= $returnbutton;
Expand Down Expand Up @@ -205,7 +205,7 @@ public function output_html($data, $query = '') {
}
}

$returnurl = new moodle_url('/admin/settings.php', ['section' => $this->settingsectionname]);
$returnurl = new url('/admin/settings.php', ['section' => $this->settingsectionname]);
$returnbutton = '<div class="singlebutton"><a class="btn btn-secondary" href="' . $returnurl->out(true) . '">' .
$this->returnbuttonname . '</a></div>';
$return .= $returnbutton;
Expand All @@ -223,21 +223,21 @@ public function output_html($data, $query = '') {
} else {
$props = \theme_adaptable\toolbox::get_properties($this->pluginfrankenstyle);

$propsexporturl = new moodle_url('/admin/settings.php', ['section' => $this->settingsectionname,
$propsexporturl = new url('/admin/settings.php', ['section' => $this->settingsectionname,
$this->pluginfrankenstyle . '_getprops_saveprops' => 1, ]);
$propsexportbutton = '<div class="singlebutton"><div><a class="btn btn-secondary" href="' .
$propsexporturl->out(true) . '" data-toggle="tooltip" data-placement="bottom" title="'.
get_string('propertiesexporthelp', $this->pluginfrankenstyle) . '">' .
$this->savepropsbuttonname . '</a></div></div>';

$propsexportfilestoourl = new moodle_url('/admin/settings.php', ['section' => $this->settingsectionname,
$propsexportfilestoourl = new url('/admin/settings.php', ['section' => $this->settingsectionname,
$this->pluginfrankenstyle . '_getprops_saveprops_filestoo' => 1, ]);
$propsexportfilestoobutton = '<div class="singlebutton"><div><a class="btn btn-secondary" href="' .
$propsexportfilestoourl->out(true) . '" data-toggle="tooltip" data-placement="bottom" title="'.
get_string('propertiesexportfilestoohelp', $this->pluginfrankenstyle) . '">' .
$this->savepropsfilestoobuttonname . '</a></div></div>';

$propsexportfilestoofilesurl = new moodle_url('/admin/settings.php', ['section' => $this->settingsectionname,
$propsexportfilestoofilesurl = new url('/admin/settings.php', ['section' => $this->settingsectionname,
$this->pluginfrankenstyle . '_getprops_saveprops_filestoofile' => 1, ]);
$propsexportfilestoofilebutton = '<div class="singlebutton"><div><a class="btn btn-secondary" href="' .
$propsexportfilestoofilesurl->out(true) . '" data-toggle="tooltip" data-placement="bottom" title="'.
Expand Down
6 changes: 4 additions & 2 deletions classes/hvp_toolbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*/
namespace theme_adaptable;

use core\url;

/**
* Trait theme_adaptable_core_h5p_renderer.
*
Expand Down Expand Up @@ -54,14 +56,14 @@ protected function ahvp_alter_styles(&$styles, $libraries, $embedtype) {
*
* @param string $content Content.
*
* @return moodle_url the URL.
* @return url the URL.
*/
protected function get_style_url($content) {
global $CFG;

$syscontext = \context_system::instance();
$itemid = md5($content);
return \moodle_url::make_file_url(
return url::make_file_url(
"$CFG->wwwroot/pluginfile.php",
"/$syscontext->id/theme_adaptable/hvp/$itemid/themehvp.css"
);
Expand Down
22 changes: 11 additions & 11 deletions classes/output/core/course_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@

namespace theme_adaptable\output\core;

use html_writer;
use moodle_url;
use core\output\html_writer;
use core\url;
use core_course_list_element;
use coursecat_helper;
use lang_string;
use core_course_list_element;
use stdClass;

/**
Expand Down Expand Up @@ -100,7 +100,7 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
if (($type == 1) || ($showcourses < self::COURSECAT_SHOW_COURSES_EXPANDED)) {
$content .= html_writer::start_tag('div', ['class' => 'panel-heading']);
$content .= html_writer::link(
new moodle_url('/course/view.php', ['id' => $course->id]),
new url('/course/view.php', ['id' => $course->id]),
$coursename,
['class' => $course->visible ? '' : 'dimmed', 'title' => $coursename]
);
Expand Down Expand Up @@ -145,7 +145,7 @@ protected function coursecat_coursebox(coursecat_helper $chelper, $course, $addi
$arrow, ['class' => 'get_stringlink']);

if (($type != 4) || (empty($this->page->theme->settings->covhidebutton))) {
$content .= html_writer::link(new moodle_url(
$content .= html_writer::link(new url(
'/course/view.php',
['id' => $course->id]
), $btn, ['class' => " coursebtn submit btn btn-info btn-sm"]);
Expand Down Expand Up @@ -219,7 +219,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
if ($isimage) {
if ($type == 1) {
$contentimages .= html_writer::start_tag('div', ['class' => 'courseimage']);
$link = new moodle_url('/course/view.php', ['id' => $course->id]);
$link = new url('/course/view.php', ['id' => $course->id]);
$contentimages .= html_writer::link($link, html_writer::empty_tag('img', ['src' => $url]));
$contentimages .= html_writer::end_tag('div');
} else {
Expand All @@ -229,7 +229,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
];
if ($type == 4) {
$cimtag = 'a';
$cimboxattr['href'] = new moodle_url('/course/view.php', ['id' => $course->id]);
$cimboxattr['href'] = new url('/course/view.php', ['id' => $course->id]);
} else {
$cimtag = 'div';
}
Expand All @@ -256,7 +256,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
if ($type == 2) {
$cimtag = 'div';
} else { // Type is 4.
$cimboxattr['href'] = new moodle_url('/course/view.php', ['id' => $course->id]);
$cimboxattr['href'] = new url('/course/view.php', ['id' => $course->id]);
$cimtag = 'a';
}
$contentimages .= html_writer::tag($cimtag, '', $cimboxattr);
Expand All @@ -269,7 +269,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
'class' => 'coursebox-content',
]);
$coursename = $chelper->get_course_formatted_name($course);
$content .= html_writer::start_tag('a', ['href' => new moodle_url('/course/view.php', ['id' => $course->id])]);
$content .= html_writer::start_tag('a', ['href' => new url('/course/view.php', ['id' => $course->id])]);
$content .= html_writer::tag('h3', $coursename, ['class' => $course->visible ? '' : 'dimmed']);
$content .= html_writer::end_tag('a');
}
Expand All @@ -295,7 +295,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
['class' => 'fa fa-graduation-cap']
));
$name = html_writer::link(
new moodle_url(
new url(
'/user/view.php',
['id' => $userid, 'course' => $course->id]
),
Expand All @@ -315,7 +315,7 @@ protected function coursecat_coursebox_content(coursecat_helper $chelper, $cours
$content .= html_writer::start_tag('div', ['class' => 'coursecat']);
$content .= get_string('category') . ': ' .
html_writer::link(
new moodle_url('/course/index.php', ['categoryid' => $cat->id]),
new url('/course/index.php', ['categoryid' => $cat->id]),
$cat->get_formatted_name(),
['class' => $cat->visible ? '' : 'dimmed']
);
Expand Down
15 changes: 6 additions & 9 deletions classes/output/core_renderer_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

namespace theme_adaptable\output;

use moodle_url;
use core\url;
use stdClass;

/**
Expand Down Expand Up @@ -195,7 +195,7 @@ public function yesheader($sidepostdrawer) {
'displayloginbox' => ($themesettings->displaylogin == 'box') ? true : false,
'output' => $this,
'token' => s(\core\session\manager::get_login_token()),
'url' => new moodle_url('/login/index.php'),
'url' => new url('/login/index.php'),
];
if (!$loginformcontext['displayloginbox']) {
$authsequence = get_enabled_auth_plugins(); // Get all auths.
Expand Down Expand Up @@ -415,7 +415,7 @@ protected function head($bodyclasses) {
$headcontext->output = $this;
$headcontext->sitefullname = $SITE->fullname;
$headcontext->pagetitle = $this->page_title();
$siteurl = new moodle_url('');
$siteurl = new url('');
$headcontext->siteurl = $siteurl->out();
$headcontext->maincolor = $themesettings->maincolor;

Expand Down Expand Up @@ -535,11 +535,9 @@ protected function sidepostheader() {
$sidepostopen = false;
}

// Add block button in editing mode.
$addblockbutton = $this->addblockbutton();

$sideposthtml = $this->blocks('side-post');
$hassidepost = (strpos($sideposthtml, 'data-block=') !== false || !empty($addblockbutton));
// Blocks or add block button.
$hassidepost = ((strpos($sideposthtml, 'data-block=') !== false) || (strpos($sideposthtml, 'data-key="addblock"') !== false));
if (!$hassidepost) {
$sidepostopen = false;
}
Expand All @@ -549,7 +547,6 @@ protected function sidepostheader() {
}

$sidepostcontext = [
'addblockbutton' => $addblockbutton,
'hassidepost' => $hassidepost,
'left' => $left,
'sidepostopen' => $sidepostopen,
Expand Down Expand Up @@ -815,7 +812,7 @@ public function course_layout() {
$section = optional_param('section', 0, PARAM_INT);
if ((!empty($themesettings->tabbedlayoutcoursepagelink)) &&
(($sectionid) || ($section))) {
$courseurl = new moodle_url('/course/view.php', ['id' => $COURSE->id]);
$courseurl = new url('/course/view.php', ['id' => $COURSE->id]);
echo '<div class="linktab"><a href="' . $courseurl->out(true) . '"><i class="fa fa-th-large"></i></a></div>';
}

Expand Down
2 changes: 1 addition & 1 deletion classes/output/core_renderer_maintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
/**
* The core maintenance renderer.
*/
class core_renderer_maintenance extends \core_renderer_maintenance {
class core_renderer_maintenance extends \core\output\core_renderer_maintenance {
use core_renderer_toolbox, core_renderer_layout;
}
Loading

0 comments on commit 9c20b9b

Please sign in to comment.