MDL-66118 hub: Remove the mentions of moodle.net
This is an update of the site registration admin page and some relevant backend code to remove the mentions of moodle.net. AMOS BEGIN CPY [registerwithmoodleorg,core_admin],[registerwithmoodleorg,core_hub] AMOS END
This commit is contained in:
@@ -46,7 +46,7 @@ $error = optional_param('error', '', PARAM_ALPHANUM);
|
||||
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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ if ($unregistration && \core\hub\registration::is_registered()) {
|
||||
}
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(get_string('unregisterfrom', 'hub', 'Moodle.net'), 3, 'main');
|
||||
echo $OUTPUT->heading(get_string('registerwithmoodleorgremove', 'core_hub'), 3, 'main');
|
||||
$siteunregistrationform->display();
|
||||
echo $OUTPUT->footer();
|
||||
exit;
|
||||
@@ -82,7 +82,7 @@ if ($fromform = $siteregistrationform->get_data()) {
|
||||
|
||||
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()) {
|
||||
@@ -104,11 +104,11 @@ if (\core\hub\registration::is_registered()) {
|
||||
|
||||
// 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');
|
||||
|
||||
@@ -40,7 +40,7 @@ $token = optional_param('token', '', PARAM_TEXT);
|
||||
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) {
|
||||
@@ -56,7 +56,7 @@ if ($url !== HUB_MOODLEORGHUBURL) {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
+22
-1
@@ -2112,6 +2112,27 @@ class core_admin_renderer extends plugin_renderer_base {
|
||||
* @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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class manage_competency_frameworks_page implements renderable, templatable {
|
||||
);
|
||||
$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'
|
||||
);
|
||||
|
||||
@@ -266,7 +266,7 @@ class manager {
|
||||
'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',
|
||||
],
|
||||
|
||||
+5
-5
@@ -1011,11 +1011,6 @@ $string['quizattemptsupgradedmessage'] = 'In Moodle 2.1 there was a major upgrad
|
||||
$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:
|
||||
|
||||
@@ -1432,3 +1427,8 @@ $string['allowblockstodock'] = 'Allow blocks to use the dock';
|
||||
$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';
|
||||
|
||||
@@ -106,3 +106,11 @@ 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
|
||||
|
||||
+24
-10
@@ -33,7 +33,6 @@ $string['audiencestudents'] = 'Students';
|
||||
$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}\'.';
|
||||
@@ -55,7 +54,7 @@ $string['eduleveltertiary'] = 'Tertiary';
|
||||
$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})';
|
||||
@@ -86,7 +85,7 @@ $string['none'] = 'None';
|
||||
$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})';
|
||||
@@ -97,7 +96,19 @@ $string['registeredsites'] = 'Registered sites';
|
||||
$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'] = 'Unregistering 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';
|
||||
@@ -151,13 +162,12 @@ $string['subject'] = 'Subject';
|
||||
$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['unregisterexplained'] = 'If the site with URL {$a} is registered, then its registration will be removed.';
|
||||
$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.';
|
||||
|
||||
@@ -168,6 +178,7 @@ $string['advertised'] = 'For people to join';
|
||||
$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.';
|
||||
@@ -201,6 +212,7 @@ $string['publisheremail'] = 'Publisher email';
|
||||
$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.';
|
||||
@@ -219,4 +231,6 @@ $string['unpublishalladvertisedcourses'] = 'Remove all courses that were shared
|
||||
$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}';
|
||||
+18
-18
@@ -33,7 +33,7 @@ use coding_exception;
|
||||
use moodle_url;
|
||||
|
||||
/**
|
||||
* Methods to communicate with moodle.net web services
|
||||
* Provides methods to communicate with the hub (sites directory) web services.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2017 Marina Glancy
|
||||
@@ -51,11 +51,11 @@ class api {
|
||||
const HUB_BACKUP_FILE_TYPE = 'backup';
|
||||
|
||||
/**
|
||||
* Calls moodle.net WS
|
||||
* Calls a remote function exposed via web services on the hub.
|
||||
*
|
||||
* @param string $function name of WS function
|
||||
* @param array $data parameters of WS function
|
||||
* @param bool $allowpublic allow request without moodle.net registration
|
||||
* @param bool $allowpublic allow request without registration on the hub
|
||||
* @return mixed depends on the function
|
||||
* @throws moodle_exception
|
||||
*/
|
||||
@@ -71,7 +71,7 @@ class api {
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs REST request to moodle.net (using GET method)
|
||||
* Performs a REST request to the hub site (using the GET method).
|
||||
*
|
||||
* @param string $token
|
||||
* @param string $function
|
||||
@@ -94,7 +94,7 @@ class api {
|
||||
// Connection error.
|
||||
throw new moodle_exception('errorconnect', 'hub', '', $curl->error);
|
||||
} else if (isset($curloutput['exception'])) {
|
||||
// Exception occurred on moodle.net .
|
||||
// Exception occurred on the remote side.
|
||||
self::process_curl_exception($token, $curloutput);
|
||||
} else if ($info['http_code'] != 200) {
|
||||
throw new moodle_exception('errorconnect', 'hub', '', $info['http_code']);
|
||||
@@ -104,7 +104,7 @@ class api {
|
||||
}
|
||||
|
||||
/**
|
||||
* Analyses exception received from moodle.net
|
||||
* Analyses exception received from the hub server.
|
||||
*
|
||||
* @param string $token token used for CURL request
|
||||
* @param array $curloutput output from CURL request
|
||||
@@ -127,7 +127,7 @@ class api {
|
||||
}
|
||||
|
||||
/**
|
||||
* Update site registration on moodle.net
|
||||
* Update site registration on the hub.
|
||||
*
|
||||
* @param array $siteinfo
|
||||
* @throws moodle_exception
|
||||
@@ -138,20 +138,20 @@ class api {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about moodle.net
|
||||
* Returns information about the hub.
|
||||
*
|
||||
* Example of the return array:
|
||||
* {
|
||||
* "courses": 384,
|
||||
* "description": "Moodle.net connects you with free content and courses shared by Moodle ...",
|
||||
* "downloadablecourses": 190,
|
||||
* "enrollablecourses": 194,
|
||||
* "description": "Official Moodle sites directory.",
|
||||
* "downloadablecourses": 0,
|
||||
* "enrollablecourses": 0,
|
||||
* "hublogo": 1,
|
||||
* "language": "en",
|
||||
* "name": "Moodle.net",
|
||||
* "name": "moodle",
|
||||
* "sites": 274175,
|
||||
* "url": "https://moodle.net",
|
||||
* "imgurl": "https://moodle.net/local/hub/webservice/download.php?filetype=hubscreenshot"
|
||||
* "url": "https://stats.moodle.org",
|
||||
* "imgurl": "https://stats.moodle.org/local/hub/webservice/download.php?filetype=hubscreenshot"
|
||||
* }
|
||||
*
|
||||
* @return array
|
||||
@@ -326,7 +326,7 @@ class api {
|
||||
*
|
||||
* @param array|\stdClass $courseinfo
|
||||
* @return int id of the published course on the hub
|
||||
* @throws moodle_exception if communication to moodle.net failed or course could not be published
|
||||
* @throws moodle_exception if the communication with the hub failed or the course could not be published
|
||||
*/
|
||||
public static function register_course($courseinfo) {
|
||||
debugging("This function has been deprecated as part of the Moodle.net sunsetting process.");
|
||||
@@ -338,7 +338,7 @@ class api {
|
||||
*
|
||||
* @deprecated since Moodle 3.8. Moodle.net has been sunsetted making this function useless.
|
||||
*
|
||||
* @param int $hubcourseid id of the published course on moodle.net, it must be published from this site
|
||||
* @param int $hubcourseid id of the published course on the hub, it must be published from this site
|
||||
* @param \stored_file $file
|
||||
* @param int $screenshotnumber ordinal number of the screenshot
|
||||
*/
|
||||
@@ -351,7 +351,7 @@ class api {
|
||||
*
|
||||
* @deprecated since Moodle 3.8. Moodle.net has been sunsetted making this function useless.
|
||||
*
|
||||
* @param int $hubcourseid id of the course on moodle.net
|
||||
* @param int $hubcourseid id of the course on the hub
|
||||
* @param string $path local path (in tempdir) to save the downloaded backup to.
|
||||
*/
|
||||
public static function download_course_backup($hubcourseid, $path) {
|
||||
@@ -363,7 +363,7 @@ class api {
|
||||
*
|
||||
* @deprecated since Moodle 3.8. Moodle.net has been sunsetted making this function useless.
|
||||
*
|
||||
* @param int $hubcourseid id of the published course on moodle.net, it must be published from this site
|
||||
* @param int $hubcourseid id of the published course on the hub, it must be published from this site
|
||||
* @param \stored_file $backupfile
|
||||
*/
|
||||
public static function upload_course_backup($hubcourseid, \stored_file $backupfile) {
|
||||
|
||||
@@ -32,7 +32,7 @@ use stdClass;
|
||||
use html_writer;
|
||||
|
||||
/**
|
||||
* Methods to use when publishing and searching courses on moodle.net
|
||||
* Methods to use when registering the site at the moodle sites directory.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2017 Marina Glancy
|
||||
@@ -147,7 +147,7 @@ class registration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates and prepares site information to send to moodle.net as part of registration or update
|
||||
* Calculates and prepares site information to send to the sites directory as a part of registration.
|
||||
*
|
||||
* @param array $defaults default values for inputs in the registration form (if site was never registered before)
|
||||
* @return array site info
|
||||
@@ -209,7 +209,7 @@ class registration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable summary of data that will be sent to moodle.net
|
||||
* Human-readable summary of data that will be sent to the sites directory.
|
||||
*
|
||||
* @param array $siteinfo result of get_site_info()
|
||||
* @return string
|
||||
@@ -266,7 +266,7 @@ class registration {
|
||||
foreach (self::FORM_FIELDS as $field) {
|
||||
set_config('site_' . $field, $formdata->$field, 'hub');
|
||||
}
|
||||
// Even if the the connection with moodle.net fails, admin has manually submitted the form which means they don't need
|
||||
// Even if the connection with the sites directory fails, admin has manually submitted the form which means they don't need
|
||||
// to be redirected to the site registration page any more.
|
||||
set_config('site_regupdateversion', max(array_keys(self::CONFIRM_NEW_FIELDS)), 'hub');
|
||||
}
|
||||
@@ -327,7 +327,7 @@ class registration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirms registration by moodle.net
|
||||
* Confirms registration by the sites directory.
|
||||
*
|
||||
* @param string $token
|
||||
* @param string $newtoken
|
||||
@@ -366,8 +366,8 @@ class registration {
|
||||
* Registers a site
|
||||
*
|
||||
* This method will make sure that unconfirmed registration record is created and then redirect to
|
||||
* registration script on https://moodle.net
|
||||
* Moodle.net will check that the site is accessible, register it and redirect back
|
||||
* registration script on the sites directory.
|
||||
* The sites directory will check that the site is accessible, register it and redirect back
|
||||
* to /admin/registration/confirmregistration.php
|
||||
*
|
||||
* @param string $returnurl
|
||||
@@ -388,7 +388,7 @@ class registration {
|
||||
$hub->token = get_site_identifier();
|
||||
$hub->secret = $hub->token;
|
||||
$hub->huburl = HUB_MOODLEORGHUBURL;
|
||||
$hub->hubname = 'Moodle.net';
|
||||
$hub->hubname = 'moodle';
|
||||
$hub->confirmed = 0;
|
||||
$hub->timemodified = time();
|
||||
$hub->id = $DB->insert_record('registration_hubs', $hub);
|
||||
@@ -467,20 +467,20 @@ class registration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns information about moodle.net
|
||||
* Returns information about the sites directory.
|
||||
*
|
||||
* Example of the return array:
|
||||
* {
|
||||
* "courses": 384,
|
||||
* "description": "Moodle.net connects you with free content and courses shared by Moodle ...",
|
||||
* "downloadablecourses": 190,
|
||||
* "enrollablecourses": 194,
|
||||
* "description": "Official moodle sites directory",
|
||||
* "downloadablecourses": 0,
|
||||
* "enrollablecourses": 0,
|
||||
* "hublogo": 1,
|
||||
* "language": "en",
|
||||
* "name": "Moodle.net",
|
||||
* "name": "moodle",
|
||||
* "sites": 274175,
|
||||
* "url": "https://moodle.net",
|
||||
* "imgurl": moodle_url : "https://moodle.net/local/hub/webservice/download.php?filetype=hubscreenshot"
|
||||
* "url": "https://stats.moodle.org",
|
||||
* "imgurl": "https://stats.moodle.org/local/hub/webservice/download.php?filetype=hubscreenshot"
|
||||
* }
|
||||
*
|
||||
* @return array|null
|
||||
@@ -489,8 +489,8 @@ class registration {
|
||||
try {
|
||||
return api::get_hub_info();
|
||||
} catch (moodle_exception $e) {
|
||||
// Ignore error, we only need it for displaying information about moodle.net, if this request
|
||||
// fails, it's not a big deal.
|
||||
// Ignore error, we only need it for displaying information about the sites directory.
|
||||
// If this request fails, it's not a big deal.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ global $CFG;
|
||||
require_once($CFG->libdir . '/formslib.php');
|
||||
|
||||
/**
|
||||
* The site registration form. Information will be sent to moodle.net
|
||||
* The site registration form. Information will be sent to the sites directory.
|
||||
*
|
||||
* @author Jerome Mouneyrac <[email protected]>
|
||||
* @package core
|
||||
@@ -161,16 +161,16 @@ class site_registration_form extends \moodleform {
|
||||
$mform->addElement('static', 'urlstring', get_string('siteurl', 'hub'), $siteinfo['url']);
|
||||
$mform->addHelpButton('urlstring', 'siteurl', 'hub');
|
||||
|
||||
// Display statistic that are going to be retrieve by moodle.net.
|
||||
// Display statistic that are going to be retrieve by the sites directory.
|
||||
$mform->addElement('static', 'siteinfosummary', get_string('sendfollowinginfo', 'hub'), registration::get_stats_summary($siteinfo));
|
||||
|
||||
// Check if it's a first registration or update.
|
||||
if (registration::is_registered()) {
|
||||
$buttonlabel = get_string('updatesite', 'hub', 'Moodle.net');
|
||||
$buttonlabel = get_string('updatesiteregistration', 'core_hub');
|
||||
$mform->addElement('hidden', 'update', true);
|
||||
$mform->setType('update', PARAM_BOOL);
|
||||
} else {
|
||||
$buttonlabel = get_string('registersite', 'hub', 'Moodle.net');
|
||||
$buttonlabel = get_string('register', 'core_admin');
|
||||
}
|
||||
|
||||
$this->add_action_buttons(false, $buttonlabel);
|
||||
|
||||
@@ -40,7 +40,7 @@ $string['generalsettings'] = 'General settings';
|
||||
$string['nobootswatch'] = 'None';
|
||||
$string['pluginname'] = 'Boost';
|
||||
$string['presetfiles'] = 'Additional theme preset files';
|
||||
$string['presetfiles_desc'] = 'Preset files can be used to dramatically alter the appearance of the theme. See <a href="https://docs.moodle.org/dev/Boost_Presets">Boost presets</a> for information on creating and sharing your own preset files, and see the <a href="https://moodle.net/boost">Presets repository</a> for presets that others have shared.';
|
||||
$string['presetfiles_desc'] = 'Preset files can be used to dramatically alter the appearance of the theme. See <a href="https://docs.moodle.org/dev/Boost_Presets">Boost presets</a> for information on creating and sharing your own preset files, and see the <a href="https://archive.moodle.net/boost">Presets repository</a> for presets that others have shared.';
|
||||
$string['preset'] = 'Theme preset';
|
||||
$string['preset_desc'] = 'Pick a preset to broadly change the look of the theme.';
|
||||
$string['privacy:metadata'] = 'The Boost theme does not store any personal data about any user.';
|
||||
|
||||
@@ -32,7 +32,7 @@ $string['navbardark'] = 'Use a dark style navbar';
|
||||
$string['navbardarkdesc'] = 'Swaps text and background colours for the navbar at the top of the page between dark and light.';
|
||||
$string['pluginname'] = 'Classic';
|
||||
$string['presetfiles'] = 'Additional theme preset files';
|
||||
$string['presetfiles_desc'] = 'Preset files can be used to dramatically alter the appearance of the theme. See <a href=https://docs.moodle.org/dev/Boost_Presets>Boost presets</a> for information on creating and sharing your own preset files, and see the <a href=https://moodle.net/boost>Presets repository</a> for presets that others have shared.';
|
||||
$string['presetfiles_desc'] = 'Preset files can be used to dramatically alter the appearance of the theme. See <a href="https://docs.moodle.org/dev/Boost_Presets">Boost presets</a> for information on creating and sharing your own preset files, and see the <a href="https://archive.moodle.net/boost">Presets repository</a> for presets that others have shared.';
|
||||
$string['preset'] = 'Theme preset';
|
||||
$string['preset_desc'] = 'Pick a preset to broadly change the look of the theme.';
|
||||
$string['region-side-post'] = 'Right';
|
||||
|
||||
Reference in New Issue
Block a user