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

Source for file aiccBlock.class.php

Documentation is available at aiccBlock.class.php

  1. <?php //$id:$
  2. /**
  3.  * Container for the aiccResource class that deals with elemens from AICC Course Structure 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 Block elements in an AICC Course Structure file
  10.  * 
  11.  */
  12. require_once('learnpathItem.class.php');
  13. class aiccBlock extends learnpathItem{
  14.     var $identifier = '';
  15.     var $members = array();
  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 aiccBlock($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 'member':
  41.                                  if(strstr($value,',')!==false){
  42.                                      $temp split(',',$value);
  43.                                      foreach($temp as $val){
  44.                                          if(!empty($val)){
  45.                                              $this->members[$val;
  46.                                          }
  47.                                      }
  48.                                  }
  49.                                  break;
  50.                          }
  51.                      }
  52.                     return true;
  53.                      
  54.             }
  55.         }
  56.         return false;
  57.      }
  58. }
  59. ?>

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