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 the base class for all SLOODLE 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.  
  19. /**
  20. * Base class for all SLOODLE plugins.
  21. * All SLOODLE plugins should be derived from this (directly or indirectly).
  22. * Specific plugin types will likely have their own base classes, which should be sub-classes of this.
  23. * For example, the Presenter has plugin base classes for "slide" and "import" plugins.
  24. * New plugins should be derived directly from those.
  25. *
  26. * Plugin classes should have names starting with "SloodlePlugin".
  27. * Make sure your class name does not conflict with any existing plugin classes, even if it is a different type of plugin.
  28. * Instantiating a plugin class should require no parameters, and should perform minimal processing. This is to allow the plugin loader to be as efficient as possible.
  29. *
  30. @package sloodle
  31. */
  32. {
  33.  
  34.     // DATA //
  35.  
  36.  
  37.     // OVERRIDABLE FUNCTIONS //
  38.     // These are functions which can be overridden by sub-classes.
  39.  
  40.     /**
  41.     * Gets the human-readable name of this plugin.
  42.     * This MUST be overridden by base classes. If not, it will just return the name of the class.
  43.     * @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.
  44.     * @access public
  45.     * @return string The human-readable name of this plugin
  46.     */
  47.     function get_plugin_name($lang null)
  48.     {
  49.         return get_class($this);
  50.     }
  51.  
  52.     /**
  53.     * Gets the human-readable description of this plugin.
  54.     * This should be overridden by base classes. If not, it will just return an empty string.
  55.     * @param string $lang Optional -- can specify the language we want the description in, as an identifier like "en_utf8". If unspecified, then the current Moodle language should be used.
  56.     * @access public
  57.     * @return string The human-readable description of this plugin
  58.     */
  59.     function get_plugin_description($lang null)
  60.     {
  61.         return '';
  62.     }
  63.  
  64.     /**
  65.     * Gets the identifier of this plugin.
  66.     * This can be overridden, but should usually not be.
  67.     * This ID is just the name of the class
  68.     */
  69.     function get_id()
  70.     {
  71.         $className get_class($this);
  72.         if (strpos($className'SloodlePlugin'=== 0return substr($className13);
  73.         return $className;
  74.     }
  75.  
  76.     /**
  77.     * Gets the internal version number of this plugin.
  78.     * This MUST be overridden.
  79.     * This should be a number like the internal version number for Moodle modules, containing the date and release number.
  80.     * Format is: YYYYMMDD##.
  81.     * For example, "2009012302" would be the 3rd release on the 23rd January 2009.
  82.     * @return int The version number of this module.
  83.     */
  84.     function get_version()
  85.     {
  86.         return 0;
  87.     }
  88.  
  89. }
  90.  
  91.  
  92. ?>

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