Source for file _base.php

Documentation is available at _base.php

  1. <?php
  2. // This file is part of the Sloodle project (www.sloodle.org) and is released under the GNU GPL v3.
  3.  
  4. /**
  5. * Defines base classes for SLOODLE Presenter plugins.
  6. *
  7. @package sloodle
  8. @copyright Copyright (c) 2009 Sloodle (various contributors)
  9. @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
  10. @since Sloodle 0.4.1
  11. *
  12. @contributor Peter R. Bloomfield
  13. *
  14. */
  15.  
  16.  
  17. /**
  18. * Base class for plugins which provide slide types for the SLOODLE Presenter.
  19. * Sub-classes should override the essential functions, in addition to those in the SloodlePluginBase class.
  20. * The purpose of the plugin is to render slides for output to a browser or to SL.
  21. *
  22. @package sloodle
  23. */
  24. {
  25.  
  26.     // DATA //
  27.  
  28.  
  29.     // OVERRIDABLE FUNCTIONS //
  30.     // These are functions which can be overridden by sub-classes.
  31.  
  32.     /**
  33.     * Render the given slide for browser output -- NOTE: render to a string, and return the string.
  34.     * The title of the slide need not be included -- simply the basic iFrame or embedded player etc.
  35.     * @param SloodlePresenterSlide $slide An object containing the raw slide data.
  36.     * @return string 
  37.     */
  38.     function render_slide_for_browser($slide)
  39.     {
  40.         // In case this function isn't overridden, just output a basic link.
  41.         $output "<a href=\"{$slide->source}\" title=\"\">".get_string('directlink''sloodle')."</a>";
  42.         return $output;
  43.     }
  44.  
  45.     /**
  46.     * Render the given slide for virtual-world output.
  47.     * This returns two items of data in a numeric array.
  48.     * The first is the virtual world compatible type identifier: web, image, video, or audio (or a mime type).
  49.     * The second is the absolute URL to give it.
  50.     * @param SloodlePresenterSlide $slide An object containing the raw slide data.
  51.     * @return array Numeric array containg (type, url)
  52.     */
  53.     function render_slide_for_sl($slide)
  54.     {
  55.         // In case this function isn't overridden, just output a basic web URL
  56.         return array('web'$slide->source);
  57.     }
  58.  
  59. }
  60.  
  61.  
  62. /**
  63. * Base class for plugins which provide slide importers for the SLOODLE Presenter.
  64. * Sub-classes should override the essential functions, in addition to those in the SloodlePluginBase class.
  65. * The purpose of the plugin is to take a specified file (locally), process it, and add slides to the Presentation at the given point.
  66. */
  67. {
  68.     // DATA //
  69.  
  70.  
  71.     // OVERRIDABLE FUNCTIONS //
  72.     // These are functions which can be overridden by sub-classes.
  73.  
  74.     /**
  75.     * Import the given file, and insert the new slides at the specified position in the Presentation.
  76.     * The best approach to inserting slides is to insert the first one at the specified position,
  77.     *  and then increment the position on each insertion.
  78.     * Inserting at the same point repeatedly will cause the slides to appear in reverse order! :-)
  79.     * @param string $file The path of the file to import.
  80.     * @param int $position Position at which the first new slide should be imported. (If negative, then insert at end)
  81.     * @return bool True if successful, or false otherwise.
  82.     */
  83.     function import($file$position = -1)
  84.     {
  85.         return false;
  86.     }
  87. }
  88.  
  89.  
  90. ?>

Documentation generated on Fri, 17 Jul 2009 11:02:49 +0100 by phpDocumentor 1.4.0