Source for file web.php
Documentation is available at web.php
// This file is part of the Sloodle project (www.sloodle.org) and is released under the GNU GPL v3.
* Defines the SLOODLE Presenter plugin for showing web slides.
* @copyright Copyright (c) 2009 Sloodle (various contributors)
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
* @contributor Peter R. Bloomfield
* Presenter plugin for showing web slides.
* Construct an absolute URL, based on the given source data.
* Leaves existing absolute URLs alone, but converts relative URLs as necessary.
* (This allows the site to be moved without disrupting these slides.)
* @param string $source The source data from the slide.
* @return string An absolute URL.
// If we have a protocol specifier, then assume this is already an absolute URL
if (strpos($source, '://') !==
false) return $source;
// Assume the source URL is relative to the Moodle WWW root.
// Make sure we don't duplicate a forward slash.
if (strpos($source, '/') ===
0) return $CFG->wwwroot.
$source;
return $CFG->wwwroot.
'/'.
$source;
* Render the given slide for browser output -- NOTE: render to a string, and return the string.
* The title of the slide need not be included -- simply the basic iFrame or embedded player etc.
* @param SloodlePresenterSlide $slide An object containing the raw slide data.
if (isset
($this->presenter)) {
$framewidth =
$this->presenter->get_frame_width();
$frameheight =
$this->presenter->get_frame_height();
$output =
"<iframe src=\"{$url}\" style=\"width:{$framewidth}px; height:{$frameheight}px;\"></iframe>";
* Render the given slide for virtual-world output.
* This returns two items of data in a numeric array.
* The first is the virtual world compatible type identifier: web, image, video, or audio (or a mime type).
* The second is the absolute URL to give it.
* @param SloodlePresenterSlide $slide An object containing the raw slide data.
* @return array Numeric array containg (type, url)
* Gets the human-readable name of this plugin.
* This MUST be overridden by base classes. If not, it will just return the name of the class.
* @param string $lang Optional -- can specify the language we want the plugin name in, as an identifier like "en_utf8". If unspecified, then the current Moodle language should be used.
* @return string The human-readable name of this plugin
* Gets the internal version number of this plugin.
* This MUST be overridden.
* This should be a number like the internal version number for Moodle modules, containing the date and release number.
* For example, "2009012302" would be the 3rd release on the 23rd January 2009.
* @return int The version number of this module.
Documentation generated on Fri, 17 Jul 2009 11:02:49 +0100 by phpDocumentor 1.4.0