dokeos-backup
[ class tree: dokeos-backup ] [ index: dokeos-backup ] [ all elements ]

Source for file Learnpath.class.php

Documentation is available at Learnpath.class.php

  1. <?php // $Id: Learnpath.class.php 11364 2007-03-03 10:48:36Z yannoo $
  2. /*
  3. ==============================================================================
  4.     Dokeos - elearning and course management software
  5.  
  6.     Copyright (c) 2004 Dokeos S.A.
  7.     Copyright (c) 2003 Ghent University (UGent)
  8.     Copyright (c) 2001 Universite catholique de Louvain (UCL)
  9.     Copyright (c) Bart Mollet (bart.mollet@hogent.be)
  10.  
  11.     For a full list of contributors, see "credits.txt".
  12.     The full license can be read in "license.txt".
  13.  
  14.     This program is free software; you can redistribute it and/or
  15.     modify it under the terms of the GNU General Public License
  16.     as published by the Free Software Foundation; either version 2
  17.     of the License, or (at your option) any later version.
  18.  
  19.     See the GNU General Public License for more details.
  20.  
  21.     Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium
  22.     Mail: info@dokeos.com
  23. ==============================================================================
  24. */
  25. /**
  26.  * A learnpath
  27.  * @author Bart Mollet <bart.mollet@hogent.be>
  28.  * @package dokeos.backup
  29.  */
  30. class Learnpath extends Resource
  31. {
  32.     /**
  33.      * Type of learnpath (can be dokeos (1), scorm (2), aicc (3))
  34.      */
  35.     var $lp_type;
  36.     /**
  37.      * The name
  38.      */
  39.     var $name;
  40.     /**
  41.      * The reference
  42.      */
  43.     var $ref;
  44.     /**
  45.      * The description
  46.      */
  47.     var $description;
  48.     /**
  49.      * Path to the learning path files
  50.      */
  51.     var $path;
  52.     /**
  53.      * Whether additional commits should be forced or not
  54.      */
  55.     var $force_commit;
  56.     /**
  57.      * View mode by default ('embedded' or 'fullscreen')
  58.      */
  59.     var $default_view_mod;
  60.     /**
  61.      * Default character encoding
  62.      */
  63.     var $default_encoding;
  64.     /**
  65.      * Display order
  66.      */
  67.     var $display_order;
  68.     /**
  69.      * Content editor/publisher
  70.      */
  71.     var $content_maker;
  72.     /**
  73.      * Location of the content (local or remote)
  74.      */
  75.     var $content_local;
  76.     /**
  77.      * License of the content
  78.      */
  79.     var $content_license;
  80.     /**
  81.      * Whether to prevent reinitialisation or not
  82.      */
  83.     var $prevent_reinit;
  84.     /**
  85.      * JavaScript library used
  86.      */
  87.     var $js_lib;
  88.     /**
  89.      * Debug level for this lp
  90.      */
  91.     var $debug;
  92.     /**
  93.      * The items
  94.      */
  95.     var $items;
  96.     /**
  97.      * The learnpath visibility on the homepage
  98.      */
  99.     var $visibility;
  100.  
  101.     /**
  102.      * Create a new learnpath
  103.      * @param integer ID
  104.      * @param integer Type (1,2,3,...)
  105.      * @param string $name 
  106.      * @param string $path 
  107.      * @param string $ref 
  108.      * @param string $description 
  109.      * @param string $content_local 
  110.      * @param string $default_encoding 
  111.      * @param string $default_view_mode 
  112.      * @param bool   $prevent_reinit 
  113.      * @param bool   $force_commit 
  114.      * @param string $content_maker 
  115.      * @param integer $display_order 
  116.      * @param string $js_lib 
  117.      * @param string $content_license 
  118.      * @param integer $debug 
  119.      * @param string $visibility 
  120.      * @param array  $items 
  121.      */
  122.     function Learnpath($id,$type,$name,$path,$ref,$description,$content_local,$default_encoding,$default_view_mode,$prevent_reinit,$force_commit,$content_maker,$display_order,$js_lib,$content_license,$debug,$visibility,$items)
  123.     {
  124.         parent::Resource($id,RESOURCE_LEARNPATH);
  125.         $this->lp_type = $type
  126.         $this->name = $name;
  127.         $this->path = $path;
  128.         $this->ref = $ref;
  129.         $this->description = $description;
  130.         $this->content_local = $content_local;
  131.         $this->default_encoding = $default_encoding;
  132.         $this->default_view_mod = $default_view_mode;
  133.         $this->prevent_reinit = $prevent_reinit;
  134.         $this->force_commit = $force_commit;
  135.         $this->content_maker = $content_maker;
  136.         $this->display_order = $display_order;
  137.         $this->js_lib = $js_lib;
  138.         $this->content_license = $content_license;
  139.         $this->debug = $debug;
  140.         $this->visibility=$visibility;
  141.         $this->items = $items;
  142.     }
  143.     /**
  144.      * Get the items
  145.      */
  146.     function get_items()
  147.     {
  148.         return $this->items;
  149.     }
  150.     /**
  151.      * Check if a given resource is used as an item in this chapter
  152.      */
  153.     function has_item($resource)
  154.     {
  155.         foreach($this->items as $index => $item)
  156.         {
  157.             if$item['id'== $resource->get_id(&& $item['type'== $resource->get_type())
  158.             {
  159.                 return true;
  160.             }
  161.         }
  162.         return false;
  163.     }
  164.     /**
  165.      * Show this learnpath
  166.      */
  167.     function show()
  168.     {
  169.         parent::show();
  170.         echo $this->name;
  171.     }
  172. }
  173. ?>

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