| Línea 32... | Línea 32... | 
          
            | 32 |  
 | 32 |  
 | 
          
            | Línea 33... | Línea 33... | 
          
            | 33 | admin_externalpage_setup('registrationmoodleorg');
 | 33 | admin_externalpage_setup('registrationmoodleorg');
 | 
          
            | 34 |  
 | 34 |  
 | 
          
            | - |   | 35 | $unregistration = optional_param('unregistration', false, PARAM_BOOL);
 | 
          
            | - |   | 36 | $confirm = optional_param('confirm', false, PARAM_BOOL);
 | 
          
            | Línea 35... | Línea 37... | 
          
            | 35 | $unregistration = optional_param('unregistration', false, PARAM_BOOL);
 | 37 | // Consider the site 'registered' if records exist locally and at the hub.
 | 
          
            | 36 | $confirm = optional_param('confirm', false, PARAM_BOOL);
 | 38 | $siteisregistered = \core\hub\registration::is_registered() && core\hub\api::is_site_registered_in_hub();
 | 
          
            | 37 |  
 | 39 |  
 | 
          
            | 38 | if ($unregistration && \core\hub\registration::is_registered()) {
 | 40 | if ($unregistration && $siteisregistered) {
 | 
          
            | Línea 39... | Línea 41... | 
          
            | 39 |     if ($confirm) {
 | 41 |     if ($confirm) {
 | 
          
            | Línea 58... | Línea 60... | 
          
            | 58 | $isinitialregistration = \core\hub\registration::show_after_install(true);
 | 60 | $isinitialregistration = \core\hub\registration::show_after_install(true);
 | 
          
            | 59 | if (!$returnurl = optional_param('returnurl', null, PARAM_LOCALURL)) {
 | 61 | if (!$returnurl = optional_param('returnurl', null, PARAM_LOCALURL)) {
 | 
          
            | 60 |     $returnurl = $isinitialregistration ? '/admin/index.php' : '/admin/registration/index.php';
 | 62 |     $returnurl = $isinitialregistration ? '/admin/index.php' : '/admin/registration/index.php';
 | 
          
            | 61 | }
 | 63 | }
 | 
          
            | Línea 62... | Línea 64... | 
          
            | 62 |  
 | 64 |  
 | 
          
            | 63 | $siteregistrationform = new \core\hub\site_registration_form();
 | 65 | $siteregistrationform = new \core\hub\site_registration_form(null, ['registered' => $siteisregistered]);
 | 
          
            | 64 | $siteregistrationform->set_data(['returnurl' => $returnurl]);
 | 66 | $siteregistrationform->set_data(['returnurl' => $returnurl]);
 | 
          
            | Línea 65... | Línea 67... | 
          
            | 65 | if ($fromform = $siteregistrationform->get_data()) {
 | 67 | if ($fromform = $siteregistrationform->get_data()) {
 | 
          
            | 66 |  
 | 68 |  
 | 
          
            | Línea 84... | Línea 86... | 
          
            | 84 | echo $OUTPUT->header();
 | 86 | echo $OUTPUT->header();
 | 
          
            | Línea 85... | Línea 87... | 
          
            | 85 |  
 | 87 |  
 | 
          
            | Línea 86... | Línea 88... | 
          
            | 86 | // Current status of registration.
 | 88 | // Current status of registration.
 | 
          
            | 87 |  
 | 89 |  
 | 
          
            | 88 | $notificationtype = \core\output\notification::NOTIFY_ERROR;
 | 90 | $notificationtype = \core\output\notification::NOTIFY_ERROR;
 | 
          
            | 89 | if (\core\hub\registration::is_registered()) {
 | 91 | if ($siteisregistered) {
 | 
          
            | 90 |     $lastupdated = \core\hub\registration::get_last_updated();
 | 92 |     $lastupdated = \core\hub\registration::get_last_updated();
 | 
          
            | 91 |     if ($lastupdated == 0) {
 | 93 |     if ($lastupdated == 0) {
 | 
          
            | 92 |         $registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
 | 94 |         $registrationmessage = get_string('pleaserefreshregistrationunknown', 'admin');
 | 
          
            | Línea 102... | Línea 104... | 
          
            | 102 |     $registrationmessage = get_string('registrationwarning', 'admin');
 | 104 |     $registrationmessage = get_string('registrationwarning', 'admin');
 | 
          
            | 103 |     echo $OUTPUT->notification($registrationmessage, $notificationtype);
 | 105 |     echo $OUTPUT->notification($registrationmessage, $notificationtype);
 | 
          
            | 104 | }
 | 106 | }
 | 
          
            | Línea 105... | Línea 107... | 
          
            | 105 |  
 | 107 |  
 | 
          
            | 106 | // Heading.
 | 108 | // Heading.
 | 
          
            | 107 | if (\core\hub\registration::is_registered()) {
 | 109 | if ($siteisregistered) {
 | 
          
            | 108 |     echo $OUTPUT->heading(get_string('registerwithmoodleorgupdate', 'core_hub'));
 | 110 |     echo $OUTPUT->heading(get_string('registerwithmoodleorgupdate', 'core_hub'));
 | 
          
            | 109 | } else if ($isinitialregistration) {
 | 111 | } else if ($isinitialregistration) {
 | 
          
            | 110 |     echo $OUTPUT->heading(get_string('registerwithmoodleorgcomplete', 'core_hub'));
 | 112 |     echo $OUTPUT->heading(get_string('registerwithmoodleorgcomplete', 'core_hub'));
 | 
          
            | 111 | } else {
 | 113 | } else {
 | 
          
            | Línea 115... | Línea 117... | 
          
            | 115 | $renderer = $PAGE->get_renderer('core', 'admin');
 | 117 | $renderer = $PAGE->get_renderer('core', 'admin');
 | 
          
            | 116 | echo $renderer->moodleorg_registration_message();
 | 118 | echo $renderer->moodleorg_registration_message();
 | 
          
            | Línea 117... | Línea 119... | 
          
            | 117 |  
 | 119 |  
 | 
          
            | Línea 118... | Línea 120... | 
          
            | 118 | $siteregistrationform->display();
 | 120 | $siteregistrationform->display();
 | 
          
            | 119 |  
 | 121 |  
 | 
          
            | 120 | if (\core\hub\registration::is_registered()) {
 | 122 | if ($siteisregistered) {
 | 
          
            | 121 |     // Unregister link.
 | 123 |     // Unregister link.
 | 
          
            | 122 |     $unregisterhuburl = new moodle_url("/admin/registration/index.php", ['unregistration' => 1]);
 | 124 |     $unregisterhuburl = new moodle_url("/admin/registration/index.php", ['unregistration' => 1]);
 | 
          
            | 123 |     echo html_writer::div(html_writer::link($unregisterhuburl, get_string('unregister', 'hub')), 'unregister mt-2');
 | 125 |     echo html_writer::div(html_writer::link($unregisterhuburl, get_string('unregister', 'hub')), 'unregister mt-2');
 | 
          
            | 124 | } else if ($isinitialregistration) {
 | 126 | } else if ($isinitialregistration) {
 | 
          
            | 125 |     echo html_writer::div(html_writer::link(new moodle_url($returnurl), get_string('skipregistration', 'hub')),
 | 127 |     echo html_writer::div(html_writer::link(new moodle_url($returnurl), get_string('skipregistration', 'hub')),
 | 
          
            | - |   | 128 |         'skipregistration mt-2');
 | 
          
            | - |   | 129 | }
 | 
          
            | - |   | 130 |  
 | 
          
            | 126 |         'skipregistration mt-2');
 | 131 | $PAGE->requires->js_call_amd('core_admin/expand_hash', 'init');
 |