Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/admin/webservice/documentation.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00026 require_once('../../config.php');
00027 require_once($CFG->libdir . '/adminlib.php');
00028 require($CFG->dirroot . '/webservice/lib.php');
00029 
00030 admin_externalpage_setup('webservicedocumentation');
00031 
00032 // get all the function descriptions
00033 $functions = $DB->get_records('external_functions', array(), 'name');
00034 $functiondescs = array();
00035 foreach ($functions as $function) {
00036     $functiondescs[$function->name] = external_function_info($function);
00037 }
00038 
00039 //display the documentation for all documented protocols,
00040 //regardless if they are activated or not
00041 $protocols = array();
00042 $protocols['rest'] = true;
00043 $protocols['xmlrpc'] = true;
00044 
00046 $printableformat = optional_param('print', false, PARAM_BOOL);
00047 
00049 echo $OUTPUT->header();
00050 
00051 $renderer = $PAGE->get_renderer('core', 'webservice');
00052 echo $renderer->documentation_html($functiondescs,
00053         $printableformat, $protocols, array(), $PAGE->url);
00054 
00056 if (!empty($printableformat)) {
00057     $PAGE->requires->js_function_call('window.print', array());
00058 }
00059 
00060 echo $OUTPUT->footer();
00061 
 All Data Structures Namespaces Files Functions Variables Enumerations