diff --git a/CHANGES.md b/CHANGES.md index eaf623d..dba7bd9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -6,6 +6,7 @@ Changes ### Unreleased +* 2024-10-14 - Upgrade: Adopt changes from MDL-82183 and use new \core\output\html_writer * 2024-10-14 - Upgrade: Adopt changes from MDL-81960 and use new \core\url class * 2024-10-14 - Upgrade: Adopt changes from MDL-81818 to remove old bootstrap classes * 2024-10-14 - Upgrade: Adopt changes from MDL-81920 and use new \core\lang_string class. diff --git a/classes/cohort_form.php b/classes/cohort_form.php index 4681f18..2d09b69 100644 --- a/classes/cohort_form.php +++ b/classes/cohort_form.php @@ -24,6 +24,8 @@ namespace local_profilecohort; +use core\output\html_writer; + defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir.'/formslib.php'); @@ -43,14 +45,14 @@ protected function definition() { $mform = $this->_form; $cohorts = $this->_customdata['cohorts']; - $mform->addElement('html', \html_writer::tag('div', get_string('cohortsintro', 'local_profilecohort').'
'. + $mform->addElement('html', html_writer::tag('div', get_string('cohortsintro', 'local_profilecohort').'
'. get_string('invisiblecohortsnote', 'local_profilecohort'), ['id' => 'intro', 'class' => 'box generalbox'])); if (!$cohorts) { $cohorturl = new \core\url('/cohort/index.php'); - $link = \html_writer::link($cohorturl, get_string('cohorts', 'core_cohort')); - $mform->addElement('html', \html_writer::tag('div', get_string('nocohorts', 'local_profilecohort', $link), + $link = html_writer::link($cohorturl, get_string('cohorts', 'core_cohort')); + $mform->addElement('html', html_writer::tag('div', get_string('nocohorts', 'local_profilecohort', $link), ['class' => 'alert alert-warning'])); } else { foreach ($cohorts as $cohort) { diff --git a/classes/field_base.php b/classes/field_base.php index 510a0c4..3fe329e 100644 --- a/classes/field_base.php +++ b/classes/field_base.php @@ -24,7 +24,7 @@ namespace local_profilecohort; -use html_writer; +use core\output\html_writer; use MoodleQuickForm; use stdClass; diff --git a/classes/profilecohort.php b/classes/profilecohort.php index 9b040ea..a55818f 100644 --- a/classes/profilecohort.php +++ b/classes/profilecohort.php @@ -24,7 +24,7 @@ namespace local_profilecohort; -use html_writer; +use core\output\html_writer; /** * Class profilecohort @@ -101,7 +101,7 @@ protected function output_members() { $tabs = $this->get_tabs(); $out .= $OUTPUT->render($tabs); - $out .= \html_writer::tag('div', get_string('membersintro', 'local_profilecohort').'
'. + $out .= html_writer::tag('div', get_string('membersintro', 'local_profilecohort').'
'. get_string('invisiblecohortsnote', 'local_profilecohort'), ['id' => 'intro', 'class' => 'box generalbox']); diff --git a/classes/profilefields.php b/classes/profilefields.php index 224234d..7d0b301 100644 --- a/classes/profilefields.php +++ b/classes/profilefields.php @@ -25,6 +25,7 @@ namespace local_profilecohort; use moodleform; +use core\output\html_writer; /** * Class profilefields @@ -204,18 +205,18 @@ public function output_form() { $out .= $OUTPUT->render($tabs); if ($this->action == 'view') { - $out .= \html_writer::tag('div', get_string('viewintro', 'local_profilecohort').'
'. + $out .= html_writer::tag('div', get_string('viewintro', 'local_profilecohort').'
'. get_string('invisiblecohortsnote', 'local_profilecohort'), ['id' => 'intro', 'class' => 'box generalbox']); } else if ($this->action == 'add') { - $out .= \html_writer::tag('div', get_string('addintro', 'local_profilecohort'). + $out .= html_writer::tag('div', get_string('addintro', 'local_profilecohort'). '
'.get_string('invisiblecohortsnote', 'local_profilecohort'), ['id' => 'intro', 'class' => 'box generalbox']); } if (!$this->get_possible_fields()) { $profilefieldsurl = new \core\url('/user/profile/index.php'); - $link = \html_writer::link($profilefieldsurl, get_string('profilefields', 'core_admin')); + $link = html_writer::link($profilefieldsurl, get_string('profilefields', 'core_admin')); $notification = new \core\output\notification(get_string('nofields', 'local_profilecohort', $link), \core\output\notification::NOTIFY_ERROR); $notification->set_show_closebutton(false);