Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/course/publish/hubselector.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017 /*
00018  * @package    course
00019  * @subpackage publish
00020  * @author     Jerome Mouneyrac <jerome@mouneyrac.com>
00021  * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL
00022  * @copyright  (C) 1999 onwards Martin Dougiamas  http://dougiamas.com
00023  *
00024  * On this page the user selects where he wants to publish the course
00025 */
00026 
00027 require('../../config.php');
00028 
00029 require_once($CFG->dirroot.'/' . $CFG->admin . '/registration/lib.php');
00030 require_once($CFG->dirroot.'/course/publish/forms.php');
00031 
00032 $id = required_param('id', PARAM_INT);
00033 $course = $DB->get_record('course', array('id'=>$id), '*', MUST_EXIST);
00034 require_login($course);
00035 
00036 $PAGE->set_url('/course/publish/hubselector.php', array('id' => $course->id));
00037 $PAGE->set_pagelayout('course');
00038 $PAGE->set_title(get_string('course') . ': ' . $course->fullname);
00039 $PAGE->set_heading($course->fullname);
00040 
00041 $registrationmanager = new registration_manager();
00042 $registeredhubs = $registrationmanager->get_registered_on_hubs();
00043 if (empty($registeredhubs)) {
00044     echo $OUTPUT->header();
00045     echo $OUTPUT->heading(get_string('publishon', 'hub'), 3, 'main');
00046     echo $OUTPUT->box(get_string('notregisteredonhub', 'hub'));
00047     echo $OUTPUT->footer();
00048     die();
00049 }
00050 
00051 
00052 $share = optional_param('share', false, PARAM_BOOL);
00053 $advertise = optional_param('advertise', false, PARAM_BOOL);
00054 $hubselectorform = new hub_publish_selector_form('',
00055         array('id' => $id, 'share' => $share, 'advertise' => $advertise));
00056 $fromform = $hubselectorform->get_data();
00057 
00059 $huburl = optional_param('huburl', false, PARAM_URL);
00060 
00061 //redirect
00062 if (!empty($huburl) and confirm_sesskey()) {
00063     $hubname = optional_param(clean_param($huburl, PARAM_ALPHANUMEXT), '', PARAM_TEXT);
00064     $params = array('sesskey' => sesskey(), 'id' => $id,
00065             'huburl' => $huburl, 'hubname' => $hubname, 'share' => $share, 'advertise' => $advertise);
00066     redirect(new moodle_url($CFG->wwwroot."/course/publish/metadata.php",
00067             $params));
00068 }
00069 
00070 
00072 
00073 
00074 echo $OUTPUT->header();
00075 echo $OUTPUT->heading(get_string('publishon', 'hub'), 3, 'main');
00076 $hubselectorform->display();
00077 echo $OUTPUT->footer();
 All Data Structures Namespaces Files Functions Variables Enumerations