[ Index ] |
PHP Cross Reference of Unnamed Project |
[Summary view] [Print] [Text view]
1 <?php 2 3 /////////////////////////////////////////////////////////////////////////// 4 // // 5 // This file is part of Moodle - http://moodle.org/ // 6 // Moodle - Modular Object-Oriented Dynamic Learning Environment // 7 // // 8 // Moodle is free software: you can redistribute it and/or modify // 9 // it under the terms of the GNU General Public License as published by // 10 // the Free Software Foundation, either version 3 of the License, or // 11 // (at your option) any later version. // 12 // // 13 // Moodle is distributed in the hope that it will be useful, // 14 // but WITHOUT ANY WARRANTY; without even the implied warranty of // 15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // 16 // GNU General Public License for more details. // 17 // // 18 // You should have received a copy of the GNU General Public License // 19 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. // 20 // // 21 /////////////////////////////////////////////////////////////////////////// 22 23 /** 24 * Registration renderer. 25 * @package moodle 26 * @subpackage registration 27 * @copyright 2010 Moodle Pty Ltd (http://moodle.com) 28 * @author Jerome Mouneyrac 29 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later 30 */ 31 class core_register_renderer extends plugin_renderer_base { 32 33 /** 34 * Display message about the benefits of registering on Moodle.org 35 * 36 * @return string 37 */ 38 public function moodleorg_registration_message() { 39 $moodleorgstatslink = html_writer::link('http://moodle.net/stats', 40 get_string('statsmoodleorg', 'admin'), 41 array('target' => '_blank')); 42 43 $moodleorgregmsg = get_string('registermoodleorg', 'admin'); 44 $items = array(get_string('registermoodleorgli1', 'admin'), 45 get_string('registermoodleorgli2', 'admin', $moodleorgstatslink)); 46 $moodleorgregmsg .= html_writer::alist($items); 47 return $moodleorgregmsg; 48 } 49 50 /** 51 * Display a box message confirming a site registration (add or update) 52 * @param string $confirmationmessage 53 * @return string 54 */ 55 public function registration_confirmation($confirmationmessage) { 56 $linktositelist = html_writer::tag('a', get_string('sitelist', 'hub'), 57 array('href' => new moodle_url('/local/hub/index.php'))); 58 $message = $confirmationmessage . html_writer::empty_tag('br') . $linktositelist; 59 return $this->output->box($message); 60 } 61 62 /** 63 * Display the listing of registered on hub 64 */ 65 public function registeredonhublisting($hubs) { 66 global $CFG; 67 $table = new html_table(); 68 $table->head = array(get_string('hub', 'hub'), get_string('operation', 'hub')); 69 $table->size = array('80%', '20%'); 70 71 foreach ($hubs as $hub) { 72 if ($hub->huburl == HUB_MOODLEORGHUBURL) { 73 $hub->hubname = get_string('registeredmoodleorg', 'hub', $hub->hubname); 74 } 75 $hublink = html_writer::tag('a', $hub->hubname, array('href' => $hub->huburl)); 76 $hublinkcell = html_writer::tag('div', $hublink, array('class' => 'registeredhubrow')); 77 78 $unregisterhuburl = new moodle_url("/" . $CFG->admin . "/registration/index.php", 79 array('sesskey' => sesskey(), 'huburl' => $hub->huburl, 80 'unregistration' => 1)); 81 $unregisterbutton = new single_button($unregisterhuburl, 82 get_string('unregister', 'hub')); 83 $unregisterbutton->class = 'centeredbutton'; 84 $unregisterbuttonhtml = $this->output->render($unregisterbutton); 85 86 //add button cells 87 $cells = array($hublinkcell, $unregisterbuttonhtml); 88 $row = new html_table_row($cells); 89 $table->data[] = $row; 90 } 91 92 return html_writer::table($table); 93 } 94 95 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Thu Aug 11 10:00:09 2016 | Cross-referenced by PHPXref 0.7.1 |