Skip to content

Commit

Permalink
Merge branch 'MDL-66118-master-byebyemoodlenet' of git://github.com/m…
Browse files Browse the repository at this point in the history
…udrd8mz/moodle
  • Loading branch information
andrewnicols committed Oct 8, 2019
2 parents c35f47d + 254b579 commit 13ef95e
Show file tree
Hide file tree
Showing 22 changed files with 245 additions and 176 deletions.
2 changes: 1 addition & 1 deletion admin/registration/confirmregistration.php
Expand Up @@ -46,7 +46,7 @@
admin_externalpage_setup('registrationmoodleorg');

if ($url !== HUB_MOODLEORGHUBURL) {
// Allow other plugins to confirm registration on hubs other than moodle.net . Plugins implementing this
// Allow other plugins to confirm registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
foreach ($callbacks as $plugintype => $plugins) {
Expand Down
3 changes: 1 addition & 2 deletions admin/registration/forms.php
Expand Up @@ -32,5 +32,4 @@

defined('MOODLE_INTERNAL') || die();

debugging('Support for alternative hubs has been removed from Moodle in 3.4. For communication with moodle.net ' .
'see lib/classes/hub/ .', DEBUG_DEVELOPER);
debugging('Support for alternative hubs has been removed from Moodle in 3.4.', DEBUG_DEVELOPER);
34 changes: 18 additions & 16 deletions admin/registration/index.php
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 1999 onwards Martin Dougiamas http://dougiamas.com
*
* This page displays the site registration form for Moodle.net.
* This page displays the site registration form.
* It handles redirection to the hub to continue the registration workflow process.
* It also handles update operation by web service.
*/
Expand All @@ -32,24 +32,25 @@

admin_externalpage_setup('registrationmoodleorg');

$unregistration = optional_param('unregistration', 0, PARAM_INT);
$unregistration = optional_param('unregistration', false, PARAM_BOOL);
$confirm = optional_param('confirm', false, PARAM_BOOL);

if ($unregistration && \core\hub\registration::is_registered()) {
$siteunregistrationform = new \core\hub\site_unregistration_form();
if ($confirm) {
require_sesskey();
\core\hub\registration::unregister(false, false);

if ($siteunregistrationform->is_cancelled()) {
redirect(new moodle_url('/admin/registration/index.php'));
} else if ($data = $siteunregistrationform->get_data()) {
\core\hub\registration::unregister($data->unpublishalladvertisedcourses,
$data->unpublishalluploadedcourses);
if (!\core\hub\registration::is_registered()) {
redirect(new moodle_url('/admin/registration/index.php'));
}
}

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('unregisterfrom', 'hub', 'Moodle.net'), 3, 'main');
$siteunregistrationform->display();
echo $OUTPUT->confirm(
get_string('registerwithmoodleorgremove', 'core_hub'),
new moodle_url(new moodle_url('/admin/registration/index.php', ['unregistration' => 1, 'confirm' => 1])),
new moodle_url(new moodle_url('/admin/registration/index.php'))
);
echo $OUTPUT->footer();
exit;
}
Expand Down Expand Up @@ -82,7 +83,7 @@

echo $OUTPUT->header();

// Current status of registration on Moodle.net.
// Current status of registration.

$notificationtype = \core\output\notification::NOTIFY_ERROR;
if (\core\hub\registration::is_registered()) {
Expand All @@ -104,11 +105,11 @@

// Heading.
if (\core\hub\registration::is_registered()) {
echo $OUTPUT->heading(get_string('updatesite', 'hub', 'Moodle.net'));
echo $OUTPUT->heading(get_string('registerwithmoodleorgupdate', 'core_hub'));
} else if ($isinitialregistration) {
echo $OUTPUT->heading(get_string('completeregistration', 'hub'));
echo $OUTPUT->heading(get_string('registerwithmoodleorgcomplete', 'core_hub'));
} else {
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'core_hub'));
}

$renderer = $PAGE->get_renderer('core', 'admin');
Expand All @@ -119,8 +120,9 @@
if (\core\hub\registration::is_registered()) {
// 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');
echo html_writer::div(html_writer::link($unregisterhuburl, get_string('unregister', 'hub')), 'unregister mt-2');
} else if ($isinitialregistration) {
echo html_writer::div(html_writer::link(new moodle_url($returnurl), get_string('skipregistration', 'hub')), 'skipregistration');
echo html_writer::div(html_writer::link(new moodle_url($returnurl), get_string('skipregistration', 'hub')),
'skipregistration mt-2');
}
echo $OUTPUT->footer();
4 changes: 2 additions & 2 deletions admin/registration/renewregistration.php
Expand Up @@ -40,7 +40,7 @@
admin_externalpage_setup('registrationmoodleorg');

if ($url !== HUB_MOODLEORGHUBURL) {
// Allow other plugins to renew registration on hubs other than moodle.net . Plugins implementing this
// Allow other plugins to renew registration on custom hubs. Plugins implementing this
// callback need to redirect or exit. See https://docs.moodle.org/en/Hub_registration .
$callbacks = get_plugins_with_function('hub_registration');
foreach ($callbacks as $plugintype => $plugins) {
Expand All @@ -56,7 +56,7 @@

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('renewregistration', 'hub'), 3, 'main');
$hublink = html_writer::tag('a', 'Moodle.net', array('href' => HUB_MOODLEORGHUBURL));
$hublink = html_writer::tag('a', HUB_MOODLEORGHUBURL, array('href' => HUB_MOODLEORGHUBURL));

$deletedregmsg = get_string('previousregistrationdeleted', 'hub', $hublink);

Expand Down
23 changes: 22 additions & 1 deletion admin/renderer.php
Expand Up @@ -2112,6 +2112,27 @@ protected function legacy_log_store_writing_error() {
* @return string
*/
public function moodleorg_registration_message() {
return format_text(get_string('registermoodlenet', 'admin'), FORMAT_HTML, ['noclean' => true]);

$out = format_text(get_string('registerwithmoodleorginfo', 'core_hub'), FORMAT_MARKDOWN);

$out .= html_writer::link(
new moodle_url('/admin/settings.php', ['section' => 'moodleservices']),
$this->output->pix_icon('i/info', '').' '.get_string('registerwithmoodleorginfoapp', 'core_hub'),
['class' => 'btn btn-link', 'role' => 'opener', 'target' => '_href']
);

$out .= html_writer::link(
HUB_MOODLEORGHUBURL,
$this->output->pix_icon('i/stats', '').' '.get_string('registerwithmoodleorginfostats', 'core_hub'),
['class' => 'btn btn-link', 'role' => 'opener', 'target' => '_href']
);

$out .= html_writer::link(
HUB_MOODLEORGHUBURL.'/sites',
$this->output->pix_icon('i/location', '').' '.get_string('registerwithmoodleorginfosites', 'core_hub'),
['class' => 'btn btn-link', 'role' => 'opener', 'target' => '_href']
);

return $this->output->box($out);
}
}
Expand Up @@ -75,7 +75,7 @@ public function __construct(context $pagecontext) {
);
$this->navigation[] = $addpage;
$competenciesrepository = new single_button(
new moodle_url('https://moodle.net/competencies'),
new moodle_url('https://archive.moodle.net/competencies'),
get_string('competencyframeworksrepository', 'tool_lp'),
'get'
);
Expand Down
2 changes: 1 addition & 1 deletion admin/tool/usertours/classes/manager.php
Expand Up @@ -266,7 +266,7 @@ protected function print_tour_list() {
'title' => get_string('importtour', 'tool_usertours'),
],
(object) [
'link' => new \moodle_url('https://moodle.net/tours'),
'link' => new \moodle_url('https://archive.moodle.net/tours'),
'linkproperties' => [
'target' => '_blank',
],
Expand Down
12 changes: 0 additions & 12 deletions index.php
Expand Up @@ -91,18 +91,6 @@
// Trigger event.
course_view(context_course::instance(SITEID));

// If the hub plugin is installed then we let it take over the homepage here.
if (file_exists($CFG->dirroot.'/local/hub/lib.php') and get_config('local_hub', 'hubenabled')) {
require_once($CFG->dirroot.'/local/hub/lib.php');
$hub = new local_hub();
$continue = $hub->display_homepage();
// Function display_homepage() returns true if the hub home page is not displayed
// ...mostly when search form is not displayed for not logged users.
if (empty($continue)) {
exit;
}
}

$PAGE->set_pagetype('site-index');
$PAGE->set_docs_path('');
$editing = $PAGE->user_is_editing();
Expand Down
10 changes: 5 additions & 5 deletions lang/en/admin.php
Expand Up @@ -1013,11 +1013,6 @@
$string['recaptchaprivatekey'] = 'ReCAPTCHA secret key';
$string['recaptchapublickey'] = 'ReCAPTCHA site key';
$string['register'] = 'Register your site';
$string['registermoodlenet'] = '<p>We\'d love to stay in touch and provide you with important things for your Moodle site!</p><p>By registering:</p><ul><li>You can subscribe to receive notifications of new Moodle releases, security alerts and other important news.</li><li>You can access and activate mobile push notifications from your Moodle site through our free <a href="https://download.moodle.org/mobile/">Moodle app</a>.</li><li>You are contributing to our <a href="https://moodle.net/stats/">Moodle statistics</a> of the worldwide community, which help us improve Moodle and our community sites.</li><li>If you wish, your site can be included in the <a href="https://moodle.net/sites/">list of registered Moodle sites</a> in your country.</li></ul>';
$string['registermoodleorg'] = 'When you register your site';
$string['registermoodleorgli1'] = 'You are added to a low-volume mailing list for important notifications such as security alerts and new releases of Moodle.';
$string['registermoodleorgli2'] = 'Statistics about your site will be added to the {$a} of the worldwide Moodle community.';
$string['registerwithmoodleorg'] = 'Register your site';
$string['registration'] = 'Registration';
$string['registration_help'] = 'By registering:
Expand Down Expand Up @@ -1434,3 +1429,8 @@
$string['configallowblockstodock'] = 'If enabled and supported by the selected theme users can choose to move blocks to a special dock.';
// Deprecated since Moodle 3.8.
$string['configuserquota'] = 'The maximum number of bytes that a user can store in their own private file area. {$a->bytes} bytes == {$a->displaysize}';
$string['registermoodlenet'] = '<p>We\'d love to stay in touch and provide you with important things for your Moodle site!</p><p>By registering:</p><ul><li>You can subscribe to receive notifications of new Moodle releases, security alerts and other important news.</li><li>You can access and activate mobile push notifications from your Moodle site through our free <a href="https://download.moodle.org/mobile/">Moodle app</a>.</li><li>You are contributing to our <a href="https://stats.moodle.org">Moodle statistics</a> of the worldwide community, which help us improve Moodle and our community sites.</li><li>If you wish, your site can be included in the <a href="https://stats.moodle.org/sites/">list of registered Moodle sites</a> in your country.</li></ul>';
$string['registermoodleorg'] = 'When you register your site';
$string['registermoodleorgli1'] = 'You are added to a low-volume mailing list for important notifications such as security alerts and new releases of Moodle.';
$string['registermoodleorgli2'] = 'Statistics about your site will be added to the {$a} of the worldwide Moodle community.';
$string['registerwithmoodleorg'] = 'Register your site';
9 changes: 9 additions & 0 deletions lang/en/deprecated.txt
Expand Up @@ -106,3 +106,12 @@ unpublishalluploadedcourses,core_hub
unpublishconfirmation,core_hub
unpublishcourse,core_hub
updatestatus,core_hub
registermoodlenet,core_admin
registermoodleorg,core_admin
registermoodleorgli1,core_admin
registermoodleorgli2,core_admin
registerwithmoodleorg,core_admin
completeregistration,core_hub
registersite,core_hub
updatesite,core_hub
unregisterexplained,core_hub
34 changes: 24 additions & 10 deletions lang/en/hub.php
Expand Up @@ -33,7 +33,6 @@
$string['audienceadmins'] = 'Moodle administrators';
$string['badgesnumber'] = 'Number of badges ({$a})';
$string['communityremoved'] = 'That course link has been removed from your list';
$string['completeregistration'] = 'Complete registration with Moodle.net';
$string['confirmregistration'] = 'Confirm registration';
$string['coursename'] = 'Name';
$string['coursepublished'] = 'This course has been shared successfully on \'{$a}\'.';
Expand All @@ -55,7 +54,7 @@
$string['emailalert'] = 'Email notifications';
$string['emailalert_help'] = 'If this is enabled the hub administrator will send you emails about security issues and other important news.';
$string['enrollable'] = 'Enrollable';
$string['errorotherhubsnotsupported'] = 'This page can no longer be used for registration with sites other than Moodle.net';
$string['errorotherhubsnotsupported'] = 'This page can no longer be used for registration with custom sites directories.';
$string['errorws'] = '{$a}';
$string['errorwstokenreset'] = '{$a}. Registration token on this site has been reset. You can now register your site again.';
$string['errorregistrationupdate'] = 'An error occurred during registration update ({$a})';
Expand Down Expand Up @@ -86,7 +85,7 @@
$string['operation'] = 'Actions';
$string['participantnumberaverage'] = 'Average number of participants ({$a})';
$string['policyagreed'] = 'Privacy notice and data processing agreement';
$string['policyagreeddesc'] = 'I agree to the <a href="{$a}" target="_blank">Privacy notice and data processing agreement</a> for Moodle.net';
$string['policyagreeddesc'] = 'I agree to the <a href="{$a}" target="_blank">Privacy notice and data processing agreement</a>';
$string['postaladdress'] = 'Postal address';
$string['postaladdress_help'] = 'Postal address of this site, or of the entity represented by this site.';
$string['postsnumber'] = 'Number of posts ({$a})';
Expand All @@ -97,7 +96,19 @@
$string['registrationinfo'] = 'Registration information';
$string['registereduserdevices'] = 'Number of users with registered mobile devices ({$a})';
$string['registeredactiveuserdevices'] = 'Number of active users with registered mobile devices which are receiving notifications ({$a})';
$string['registersite'] = 'Register with {$a}';
$string['registerwithmoodleorg'] = 'Register your site';
$string['registerwithmoodleorgupdate'] = 'Update your site registration';
$string['registerwithmoodleorgcomplete'] = 'Complete your site registration';
$string['registerwithmoodleorginfo'] = 'We\'d love to stay in touch and provide you with important things for your Moodle site! By registering:
* You can subscribe to receive notifications of new Moodle releases, security alerts and other important news.
* You can access and activate mobile push notifications from your Moodle site through our free Moodle app.
* You are contributing to our Moodle statistics of the worldwide community, which help us improve Moodle and our community sites.
* If you wish, your site can be included in the list of registered Moodle sites in your country.';
$string['registerwithmoodleorginfoapp'] = 'About the Moodle app';
$string['registerwithmoodleorginfostats'] = 'Moodle statistics';
$string['registerwithmoodleorginfosites'] = 'Other sites in my country';
$string['registerwithmoodleorgremove'] = 'You are going to unregister your site. If you continue, you will no longer have access to important notifications and security alerts. Your users will not be able to receive push notifications from your site to their Moodle mobile app. Are you sure you want to unregister your site?';
$string['registrationconfirmed'] = 'Site registration confirmed';
$string['registrationconfirmedon'] = 'Thank you for registering your site. Registration information will be kept up to date by the \'Site registration\' scheduled task.';
$string['renewregistration'] = 'Renew registration';
Expand Down Expand Up @@ -151,13 +162,11 @@
$string['subject_help'] = 'Select the main subject area which the course covers.';
$string['type'] = 'Shared';
$string['unregister'] = 'Unregister';
$string['unregisterfrom'] = 'Unregister from {$a}';
$string['unregistrationerror'] = 'An error occurred when the site tried to unregister from Moodle.net: {$a}';
$string['unregistrationerror'] = 'An error occurred while attempting to unregister the site: {$a}';
$string['update'] = 'Update';
$string['updatesite'] = 'Update registration on {$a}';
$string['updatesiteregistration'] = 'Update registration';
$string['usedifferentemail'] = 'Use different email';
$string['unregisterexplained'] = 'If the site with URL {$a} is registered on Moodle.net its registration will be removed.';
$string['urlalreadyregistered'] = 'Your site seems to be already registered on Moodle.net, which means something has gone wrong. Please contact the Moodle.net administrator to reset your registration so you can try again.';
$string['urlalreadyregistered'] = 'Your site seems to be already registered, which means something has gone wrong. Please contact the sites directory administrator to reset your registration so you can try again.';
$string['usersnumber'] = 'Number of users ({$a})';
$string['wrongtoken'] = 'The registration failed for some unknown reason (network?). Please try again.';

Expand All @@ -168,6 +177,7 @@
$string['advertiseon'] = 'Share this course on {$a}';
$string['readvertiseon'] = 'Update advertising information on {$a}';
$string['advertisepublication_help'] = 'This course will be listed on Moodle.net as a course that people can enrol in and participate. Email-based self-registration should be enabled on the site and you need to enable self enrolment in this course.';
$string['completeregistration'] = 'Complete registration with Moodle.net';
$string['courseunpublished'] = 'The course {$a->courseshortname} is no longer shared on {$a->hubname}.';
$string['courseurl'] = 'Course URL';
$string['courseurl_help'] = 'It is the URL of your course. This URL is displayed as a link in a search result.';
Expand Down Expand Up @@ -201,6 +211,7 @@
$string['publisheremail_help'] = 'The publisher email address allows the hub administrator to alert the publisher about any changes to the status of the published course.';
$string['publishername'] = 'Publisher';
$string['publishername_help'] = 'The publisher is the person or organisation that is the official publisher of the course. Unless you are publishing it on behalf of someone else, it will usually be you.';
$string['registersite'] = 'Register with {$a}';
$string['removefromhub'] = 'Remove from Moodle.net';
$string['screenshots'] = 'Screenshots';
$string['screenshots_help'] = 'Any screenshots of the course will be displayed in search results.';
Expand All @@ -219,4 +230,7 @@
$string['unpublishalluploadedcourses'] = 'Remove all courses that were shared on Moodle.net for people to download';
$string['unpublishconfirmation'] = 'Do you really want to remove the course "{$a->courseshortname}" from "{$a->hubname}"';
$string['unpublishcourse'] = 'Stop sharing {$a}';
$string['updatestatus'] = 'Check it now.';
$string['updatesite'] = 'Update registration on {$a}';
$string['updatestatus'] = 'Check it now.';
$string['unregisterfrom'] = 'Unregister from {$a}';
$string['unregisterexplained'] = 'If the site with URL {$a} is registered, then its registration will be removed.';

0 comments on commit 13ef95e

Please sign in to comment.