diff --git a/admin/registration/index.php b/admin/registration/index.php index b9aeb18f8d7..61ffa0383ee 100644 --- a/admin/registration/index.php +++ b/admin/registration/index.php @@ -37,7 +37,7 @@ require_once($CFG->dirroot . "/webservice/xmlrpc/lib.php"); admin_externalpage_setup('registrationhubs'); -$renderer = $PAGE->get_renderer('core', 'register'); +$renderer = $PAGE->get_renderer('core', 'admin'); $unregistration = optional_param('unregistration', 0, PARAM_INT); $cleanregdata = optional_param('cleanregdata', 0, PARAM_BOOL); diff --git a/admin/registration/register.php b/admin/registration/register.php index 15c30cd87fa..c5ae2f9da98 100644 --- a/admin/registration/register.php +++ b/admin/registration/register.php @@ -195,7 +195,7 @@ if ($huburl == HUB_MOODLEORGHUBURL) { echo $OUTPUT->notification($registrationmessage, $notificationtype); echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin')); - $renderer = $PAGE->get_renderer('core', 'register'); + $renderer = $PAGE->get_renderer('core', 'admin'); echo $renderer->moodleorg_registration_message(); } diff --git a/admin/registration/renderer.php b/admin/registration/renderer.php deleted file mode 100644 index 09d2735866a..00000000000 --- a/admin/registration/renderer.php +++ /dev/null @@ -1,95 +0,0 @@ -. // -// // -/////////////////////////////////////////////////////////////////////////// - -/** - * Registration renderer. - * @package moodle - * @subpackage registration - * @copyright 2010 Moodle Pty Ltd (http://moodle.com) - * @author Jerome Mouneyrac - * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later - */ -class core_register_renderer extends plugin_renderer_base { - - /** - * Display message about the benefits of registering on Moodle.org - * - * @return string - */ - public function moodleorg_registration_message() { - $moodleorgstatslink = html_writer::link('http://moodle.net/stats', - get_string('statsmoodleorg', 'admin'), - array('target' => '_blank')); - - $moodleorgregmsg = get_string('registermoodleorg', 'admin'); - $items = array(get_string('registermoodleorgli1', 'admin'), - get_string('registermoodleorgli2', 'admin', $moodleorgstatslink)); - $moodleorgregmsg .= html_writer::alist($items); - return $moodleorgregmsg; - } - - /** - * Display a box message confirming a site registration (add or update) - * @param string $confirmationmessage - * @return string - */ - public function registration_confirmation($confirmationmessage) { - $linktositelist = html_writer::tag('a', get_string('sitelist', 'hub'), - array('href' => new moodle_url('/local/hub/index.php'))); - $message = $confirmationmessage . html_writer::empty_tag('br') . $linktositelist; - return $this->output->box($message); - } - - /** - * Display the listing of registered on hub - */ - public function registeredonhublisting($hubs) { - global $CFG; - $table = new html_table(); - $table->head = array(get_string('hub', 'hub'), get_string('operation', 'hub')); - $table->size = array('80%', '20%'); - - foreach ($hubs as $hub) { - if ($hub->huburl == HUB_MOODLEORGHUBURL) { - $hub->hubname = get_string('registeredmoodleorg', 'hub', $hub->hubname); - } - $hublink = html_writer::tag('a', $hub->hubname, array('href' => $hub->huburl)); - $hublinkcell = html_writer::tag('div', $hublink, array('class' => 'registeredhubrow')); - - $unregisterhuburl = new moodle_url("/" . $CFG->admin . "/registration/index.php", - array('sesskey' => sesskey(), 'huburl' => $hub->huburl, - 'unregistration' => 1)); - $unregisterbutton = new single_button($unregisterhuburl, - get_string('unregister', 'hub')); - $unregisterbutton->class = 'centeredbutton'; - $unregisterbuttonhtml = $this->output->render($unregisterbutton); - - //add button cells - $cells = array($hublinkcell, $unregisterbuttonhtml); - $row = new html_table_row($cells); - $table->data[] = $row; - } - - return html_writer::table($table); - } - -} diff --git a/admin/renderer.php b/admin/renderer.php index 22be7a7519f..4ee8e3df0e2 100644 --- a/admin/renderer.php +++ b/admin/renderer.php @@ -2033,4 +2033,69 @@ class core_admin_renderer extends plugin_renderer_base { return $this->warning(get_string('legacylogginginuse')); } } + + /** + * Display message about the benefits of registering on Moodle.org + * + * @return string + */ + public function moodleorg_registration_message() { + $moodleorgstatslink = html_writer::link('http://moodle.net/stats', + get_string('statsmoodleorg', 'admin'), + array('target' => '_blank')); + + $moodleorgregmsg = get_string('registermoodleorg', 'admin'); + $items = array(get_string('registermoodleorgli1', 'admin'), + get_string('registermoodleorgli2', 'admin', $moodleorgstatslink)); + $moodleorgregmsg .= html_writer::alist($items); + return $moodleorgregmsg; + } + + /** + * Display a box message confirming a site registration (add or update) + * @param string $confirmationmessage + * @return string + */ + public function registration_confirmation($confirmationmessage) { + $linktositelist = html_writer::tag('a', get_string('sitelist', 'hub'), + array('href' => new moodle_url('/local/hub/index.php'))); + $message = $confirmationmessage . html_writer::empty_tag('br') . $linktositelist; + return $this->output->box($message); + } + + /** + * Display the listing of registered on hub + * + * @param stdClass[] $hubs + * @return string + */ + public function registeredonhublisting($hubs) { + global $CFG; + $table = new html_table(); + $table->head = array(get_string('hub', 'hub'), get_string('operation', 'hub')); + $table->size = array('80%', '20%'); + + foreach ($hubs as $hub) { + if ($hub->huburl == HUB_MOODLEORGHUBURL) { + $hub->hubname = get_string('registeredmoodleorg', 'hub', $hub->hubname); + } + $hublink = html_writer::tag('a', $hub->hubname, array('href' => $hub->huburl)); + $hublinkcell = html_writer::tag('div', $hublink, array('class' => 'registeredhubrow')); + + $unregisterhuburl = new moodle_url("/" . $CFG->admin . "/registration/index.php", + array('sesskey' => sesskey(), 'huburl' => $hub->huburl, + 'unregistration' => 1)); + $unregisterbutton = new single_button($unregisterhuburl, + get_string('unregister', 'hub')); + $unregisterbutton->class = 'centeredbutton'; + $unregisterbuttonhtml = $this->output->render($unregisterbutton); + + // Add button cells. + $cells = array($hublinkcell, $unregisterbuttonhtml); + $row = new html_table_row($cells); + $table->data[] = $row; + } + + return html_writer::table($table); + } } diff --git a/lib/upgrade.txt b/lib/upgrade.txt index c5932a19f23..6f6405b6a98 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -1,6 +1,15 @@ This files describes API changes in core libraries and APIs, information provided here is intended especially for developers. +=== 3.3.6 === +* The following have been removed from the list of core subsystems: + - core_register + - core_publish + Following this change, \core_register_renderer has been removed and it's methods have been moved to \core_admin_renderer: + - moodleorg_registration_message() + - registration_confirmation() + - registeredonhublisting() + === 3.3.5 === * Plugins can define class 'PLUGINNAME\privacy\local\sitepolicy\handler' if they implement an alternative mechanisms for