Permalink
Browse files

Merge branch 'wip-MDL-60108-master' of git://github.com/marinaglancy/…

…moodle
  • Loading branch information...
dmonllao committed Oct 19, 2017
2 parents c1c7cb9 + 1095afa commit b6b299ddae39bc87d8e94aae6e484372dd5cea2e
@@ -699,6 +699,7 @@
if (during_initial_install()) {
set_config('rolesactive', 1); // after this, during_initial_install will return false.
set_config('adminsetuppending', 1);
set_config('registrationpending', 1); // Remind to register site after all other setup is finished.
// we need this redirect to setup proper session
upgrade_finished("index.php?sessionstarted=1&lang=$CFG->lang");
}
@@ -814,6 +815,9 @@
}
}
// If site registration needs updating, redirect.
\core\hub\registration::registration_reminder('/admin/index.php');
// Everything should now be set up, and the user is an admin
// Print default admin page with notifications.
@@ -64,8 +64,10 @@
echo $OUTPUT->notification(get_string('registrationconfirmedon', 'hub'), 'notifysuccess');
// Display continue button.
$registrationpage = new moodle_url('/admin/registration/index.php');
$continuebutton = $OUTPUT->render(new single_button($registrationpage, get_string('continue')));
$returnurl = !empty($SESSION->registrationredirect) ? clean_param($SESSION->registrationredirect, PARAM_LOCALURL) : null;
unset($SESSION->registrationredirect);
$continueurl = new moodle_url($returnurl ?: '/admin/registration/index.php');
$continuebutton = $OUTPUT->render(new single_button($continueurl, get_string('continue')));
$continuebutton = html_writer::tag('div', $continuebutton, array('class' => 'mdl-align'));
echo $continuebutton;
@@ -53,17 +53,25 @@
exit;
}
$isinitialregistration = \core\hub\registration::show_after_install(true);
if (!$returnurl = optional_param('returnurl', null, PARAM_LOCALURL)) {
$returnurl = $isinitialregistration ? '/admin/index.php' : '/admin/registration/index.php';
}
$siteregistrationform = new \core\hub\site_registration_form();
$siteregistrationform->set_data(['returnurl' => $returnurl]);
if ($fromform = $siteregistrationform->get_data()) {
// Save the settings.
\core\hub\registration::save_site_info($fromform);
if (\core\hub\registration::is_registered()) {
\core\hub\registration::update_manual();
redirect(new moodle_url('/admin/registration/index.php'));
if (\core\hub\registration::update_manual()) {
redirect(new moodle_url($returnurl));
}
redirect(new moodle_url('/admin/registration/index.php', ['returnurl' => $returnurl]));
} else {
\core\hub\registration::register();
\core\hub\registration::register($returnurl);
// This method will redirect away.
}
@@ -80,20 +88,24 @@
$lastupdated = \core\hub\registration::get_last_updated();
if ($lastupdated == 0) {
$registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
} else if (\core\hub\registration::get_new_registration_fields()) {
$registrationmessage = get_string('pleaserefreshregistrationnewdata', 'admin');
} else {
$lastupdated = userdate($lastupdated, get_string('strftimedate', 'langconfig'));
$registrationmessage = get_string('pleaserefreshregistration', 'admin', $lastupdated);
$notificationtype = \core\output\notification::NOTIFY_INFO;
}
echo $OUTPUT->notification($registrationmessage, $notificationtype);
} else {
} else if (!$isinitialregistration) {
$registrationmessage = get_string('registrationwarning', 'admin');
echo $OUTPUT->notification($registrationmessage, $notificationtype);
}
// Heading.
if (\core\hub\registration::is_registered()) {
echo $OUTPUT->heading(get_string('updatesite', 'hub', 'Moodle.net'));
} else if ($isinitialregistration) {
echo $OUTPUT->heading(get_string('completeregistration', 'hub'));
} else {
echo $OUTPUT->heading(get_string('registerwithmoodleorg', 'admin'));
}
@@ -107,5 +119,7 @@
// 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');
} else if ($isinitialregistration) {
echo html_writer::div(html_writer::link(new moodle_url($returnurl), get_string('skipregistration', 'hub')), 'skipregistration');
}
echo $OUTPUT->footer();
@@ -36,14 +36,6 @@ class core_register_renderer extends plugin_renderer_base {
* @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;
return format_text(get_string('registermoodlenet', 'admin'), FORMAT_MARKDOWN, ['noclean' => true]);
}
}
@@ -18,6 +18,9 @@
redirect(new moodle_url('/admin/index.php'));
}
// If site registration needs updating, redirect.
\core\hub\registration::registration_reminder('/admin/search.php');
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
$adminroot = admin_get_root(); // need all settings here
@@ -66,6 +66,9 @@
redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
}
// If site registration needs updating, redirect.
\core\hub\registration::registration_reminder('/index.php');
if (get_home_page() != HOMEPAGE_SITE) {
// Redirect logged-in users to My Moodle overview if required.
$redirect = optional_param('redirect', 1, PARAM_BOOL);
@@ -844,6 +844,7 @@
$string['phpfloatproblem'] = 'Detected unexpected problem in handling of PHP float numbers - {$a}';
$string['pleaserefreshregistration'] = 'Your site is registered. Registration last updated {$a}.<br />The \'Site registration\' scheduled task keeps your registration up to date. You can also manually update your registration at any time.';
$string['pleaserefreshregistrationunknown'] = 'Your site has been registered but the registration date is unknown. Please update your registration using the \'Update registration\' button or ensure that the \'Site registration\' scheduled task is enabled so your registration is automatically updated.';
$string['pleaserefreshregistrationnewdata'] = 'Registration information has been changed. Please confirm it using the \'Update registration\' button.';
$string['plugin'] = 'Plugin';
$string['plugins'] = 'Plugins';
$string['pluginscheck'] = 'Plugin dependencies check';
@@ -939,6 +940,15 @@
$string['recaptchaprivatekey'] = 'ReCAPTCHA secret key';
$string['recaptchapublickey'] = 'ReCAPTCHA site key';
$string['register'] = 'Register your site';
$string['registermoodlenet'] = 'We\'d love to stay in touch for important things for your Moodle site!
By registering,
* You are contributing to our collective knowledge about the users of Moodle which helps us improve Moodle and all our community services
* You’ll be one of the first to find out about important notifications such as security alerts and new Moodle releases.
* You can access and activate mobile push notifications from your Moodle site through our free [Moodle Mobile app](https://download.moodle.org/mobile/)
* Optionally, your site can be included as a proud member and supporter of the Moodle community on the [list of registered sites](https://moodle.net/stats).
';
$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.';
@@ -154,3 +154,5 @@ moodleorghubname,core_admin
hubs,core_admin
quickdownloadcalendar,core_calendar
ical,core_calendar
privacy,core_hub
privacy_help,core_hub
@@ -36,6 +36,7 @@
$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['contributornames'] = 'Other contributors';
$string['contributornames_help'] = 'You can use this field to list the names of anyone else who contributed to this course.';
@@ -114,8 +115,6 @@
$string['postaladdress_help'] = 'Postal address of this site, or of the entity represented by this site.';
$string['postsnumber'] = 'Number of posts ({$a})';
$string['previousregistrationdeleted'] = 'The previous registration has been deleted from {$a}. You can restart the registration process. Thank you.';
$string['privacy'] = 'Privacy';
$string['privacy_help'] = 'The hub may want to display a list of registered sites. If it does then you can choose whether or not you want to appear on that list.';
$string['publicationinfo'] = 'Course publication information';
$string['publishcourse'] = 'Publish {$a}';
$string['publishcourseon'] = 'Publish on {$a}';
@@ -152,35 +151,42 @@
$string['sharepublication_help'] = 'Uploading this course to a community server will enable people to download it and install it on their own Moodle sites.';
$string['siteadmin'] = 'Administrator';
$string['siteadmin_help'] = 'The full name of the site administrator.';
$string['sitecommnews'] = 'Updates about Moodle news and features';
$string['sitecommnews_help'] = 'You have the option of subscribing to our low volume email list including a newsletter about happenings in the Moodle community. ';
$string['sitecommnewsno'] = 'No, I do not want to receive any email from Moodle HQ';
$string['sitecommnewsyes'] = 'Yes please, include me in Moodle’s regular e-newsletter updates';
$string['sitecountry'] = 'Country';
$string['sitecountry_help'] = 'The country your organisation is in.';
$string['sitecountry_help'] = 'The country your organisation or institution is located in.';
$string['sitedesc'] = 'Description';
$string['sitedesc_help'] = 'This description of your site may be shown in the site listing. Please use plain text only.';
$string['sitedesc_help'] = 'Provide some information about how you are using Moodle.';
$string['sitegeolocation'] = 'Geolocation';
$string['sitegeolocation_help'] = 'In future we may provide location-based searching in the hubs. If you want to specify the location for your site use a latitude/longitude value here (eg: -31.947884,115.871285). One way to find this is to use Google Maps.';
$string['siteemail'] = 'Email address';
$string['siteemail_help'] = 'You need to provide an email address so the hub administrator can contact you if necessary. This will not be used for any other purpose. It is recommended to enter a email address related to a position (example: sitemanager@example.com) and not directly to a person.';
$string['siteemail'] = 'Admin email address';
$string['siteemail_help'] = 'An email address is necessary so that Moodle HQ can contact you if required. It may also be used for other purposes as you allow below. We recommend a generic email address related to a position (eg.: sitemanager@example.com), not a personal address.';
$string['sitelang'] = 'Language';
$string['sitelang_help'] = 'Your site language will be displayed on the site listing.';
$string['sitelang_help'] = 'What is the main language used on your Moodle site?';
$string['sitename'] = 'Name';
$string['sitename_help'] = 'The name of the site will be shown on the site listing if the hub allows that.';
$string['sitephone'] = 'Phone';
$string['sitephone_help'] = 'Your phone number will only be seen by the hub administrator.';
$string['siteprivacy'] = 'Privacy';
$string['siteprivacynotpublished'] = 'Please do not publish this site';
$string['siteprivacypublished'] = 'Publish the site name only';
$string['siteprivacylinked'] = 'Publish the site name with a link';
$string['siteregistrationcontact'] = 'Contact form';
$string['siteregistrationcontact_help'] = 'If you allow it, other people may be able to contact you via a contact form on the hub. They will never be able to see your email address.';
$string['siteregistrationemail'] = 'Email notifications';
$string['siteregistrationemail_help'] = 'If you enable this the hub administrator may email you to inform you of important news like security issues.';
$string['siteprivacy'] = 'Site listing';
$string['siteprivacy_help'] = 'You can choose to have your site listed publicly in the list of registered sites, with or without a link to your site.';
$string['siteprivacynotpublished'] = 'Do not list my site';
$string['siteprivacypublished'] = 'Only display my site name';
$string['siteprivacylinked'] = 'Display my site name with the link';
$string['siteregistrationcontact'] = 'Display contact form';
$string['siteregistrationcontact_help'] = 'If you allow it, other people in our Moodle community (who need a login account) can contact you via a form on our Moodle community site. However, they will never be able to see your email address.';
$string['siteregistrationemail'] = 'Notifications about important security and technical issues.';
$string['siteregistrationemail_help'] = 'You have the option of subscribing to our low volume email list for important news (on security issues or new releases).';
$string['siteregistrationupdated'] = 'Site registration updated';
$string['siterelease'] = 'Moodle release';
$string['sitereleasenum'] = 'Moodle release ({$a})';
$string['siterelease_help'] = 'Moodle release number of this site.';
$string['siteurl'] = 'Site URL';
$string['siteurl_help'] = 'The URL is the address of this site. If privacy settings allow people to see site addresses then this is the URL that will be used.';
$string['siteversion'] = 'Moodle version';
$string['siteversion_help'] = 'The Moodle version of this site.';
$string['skipregistration'] = 'Skip';
$string['subject'] = 'Subject';
$string['subject_help'] = 'Select the main subject area which the course covers.';
$string['status'] = 'Listing status';
@@ -200,6 +206,7 @@
$string['update'] = 'Update';
$string['updatesite'] = 'Update registration on {$a}';
$string['updatestatus'] = 'Check it now.';
$string['usedifferentemail'] = 'Use different email';
$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['usersnumber'] = 'Number of users ({$a})';
$string['wrongtoken'] = 'The registration failed for some unknown reason (network?). Please try again.';
@@ -240,6 +247,8 @@
$string['notregisteredonmoodleorg'] = 'Your administrator needs to register this site with moodle.org.';
$string['orenterprivatehub'] = 'Alternatively, enter a private hub URL:';
$string['prioritise'] = 'Prioritise';
$string['privacy'] = 'Privacy';
$string['privacy_help'] = 'The hub may want to display a list of registered sites. If it does then you can choose whether or not you want to appear on that list.';
$string['private'] = 'Private';
$string['privatehuburl'] = 'Private hub URL';
$string['publichub'] = 'Public hub';
@@ -1567,8 +1567,8 @@
$string['refreshingevents'] = 'Refreshing events';
$string['registration'] = 'Moodle registration';
$string['registrationcontact'] = 'Contact from the public';
$string['registrationcontactno'] = 'No, I do not want a contact form in the site listing';
$string['registrationcontactyes'] = 'Yes, provide a form for prospective Moodlers to contact me';
$string['registrationcontactno'] = 'No, I do not want to be contacted by other people';
$string['registrationcontactyes'] = 'Yes, provide a form for other Moodlers to contact me';
$string['registrationemail'] = 'Email notifications';
$string['registrationinfo'] = '<p>This page allows you to register your Moodle site with moodle.org. Registration is free.
The main benefit of registering is that you will be added to a low-volume mailing list
@@ -1579,9 +1579,9 @@
<p>If you choose, you can allow your site name, country and URL to be added to the public list of Moodle Sites.</p>
<p>All new registrations are verified manually before they are added to the list, but once you are added you can update your registration (and your entry on the public list) at any time by resubmitting this form.</p>';
$string['registrationinfotitle'] = 'Registration information';
$string['registrationno'] = 'No, I do not want to receive email';
$string['registrationno'] = 'No, I do not want to receive any email from Moodle HQ';
$string['registrationsend'] = 'Send registration information to moodle.org';
$string['registrationyes'] = 'Yes, please notify me about important issues';
$string['registrationyes'] = 'Yes, notify me about important news (e.g. security issues or releases) ';
$string['reject'] = 'Reject';
$string['rejectdots'] = 'Reject...';
$string['reload'] = 'Reload';
Oops, something went wrong.

0 comments on commit b6b299d

Please sign in to comment.