scorm-learnpath
[ class tree: scorm-learnpath ] [ index: scorm-learnpath ] [ all elements ]

Source for file aiccResource.class.php

Documentation is available at aiccResource.class.php

  1. <?php //$id:$
  2. /**
  3.  * Container for the aiccResource class that deals with elemens from AICC Descriptor file
  4.  * @package    scorm.learnpath
  5.  * @author    Yannick Warnier <ywarnier@beeznest.org>
  6.  * @license    GNU/GPL - See Dokeos license directory for details
  7.  */
  8. /**
  9.  * Class defining the elements from an AICC Descriptor file
  10.  */
  11. class aiccResource {
  12.     var $identifier = '';
  13.     var $title = '';
  14.     var $description = '';    
  15.     var $developer_id = '';
  16.             
  17.     /**
  18.      * Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
  19.      * object from database records or from the array given as second param
  20.      * @param    string    Type of construction needed ('db' or 'config', default = 'config')
  21.      * @param    mixed    Depending on the type given, DB id for the lp_item or parameters array
  22.      */
  23.     function aiccResource($type='config',$params{
  24.  
  25.         if(isset($params))
  26.         {
  27.             switch($type){
  28.                 case 'db':
  29.                     //TODO implement this way of object creation
  30.                     return false;
  31.                 case 'config'//do the same as the default
  32.                 default:
  33.                      foreach($params as $a => $value)
  34.                      {
  35.                          switch($a)
  36.                          {
  37.                                 case 'system_id':
  38.                                     $this->identifier = strtolower($value);
  39.                                  break;
  40.                              case 'title':
  41.                                  $this->title = $value;
  42.                              case 'description':
  43.                                  $this->description = $value;
  44.                                  break;
  45.                              case 'developer_id':
  46.                                  $this->developer_id = $value;
  47.                                  break;
  48.                          }
  49.                      }
  50.                     return true;
  51.                      
  52.             }
  53.         }
  54.         return false;
  55.      }
  56. }
  57. ?>

Documentation generated on Thu, 12 Jun 2008 12:57:21 -0500 by phpDocumentor 1.4.1