* @package dokeos.backup */ class Learnpath extends Resource { /** * The name */ var $name; /** * The description */ var $description; /** * The chapters */ var $chapters; var $visibility; /** * Create a new learnpath * @param string $name * @param string $description */ function Learnpath($id,$name,$description,$visibility,$chapters) { parent::Resource($id,RESOURCE_LEARNPATH); $this->name = $name; $this->description = $description; $this->visibility=$visibility; $this->chapters = $chapters; } /** * Get the chapters */ function get_chapters() { return $this->chapters; } /** * Check if a given resource is used as an item in this chapter */ function has_item($resource) { foreach($this->chapters as $index => $chapter) { foreach($chapter['items'] as $index => $item) { if( $item['id'] == $resource->get_id() && $item['type'] == $resource->get_type()) { return true; } } } return false; } /** * Show this learnpath */ function show() { parent::show(); echo $this->name; } } ?>