You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
2.0 KiB
54 lines
2.0 KiB
15 years ago
|
<?php
|
||
|
/* For licensing terms, see /license.txt */
|
||
14 years ago
|
|
||
15 years ago
|
/**
|
||
10 years ago
|
* Class defining the elements from an AICC Descriptor file.
|
||
7 years ago
|
* Container for the aiccResource class that deals with elemens from AICC Descriptor file.
|
||
|
*
|
||
8 years ago
|
* @author Yannick Warnier <ywarnier@beeznest.org>
|
||
|
* @license GNU/GPL
|
||
15 years ago
|
*/
|
||
10 years ago
|
class aiccResource
|
||
|
{
|
||
14 years ago
|
public $identifier = '';
|
||
|
public $title = '';
|
||
|
public $description = '';
|
||
|
public $developer_id = '';
|
||
15 years ago
|
|
||
14 years ago
|
/**
|
||
|
* Class constructor. Depending of the type of construction called ('db' or 'manifest'), will create a scormResource
|
||
7 years ago
|
* object from database records or from the array given as second param.
|
||
|
*
|
||
|
* @param string $type Type of construction needed ('db' or 'config', default = 'config')
|
||
|
* @param mixed $params Depending on the type given, DB id for the lp_item or parameters array
|
||
14 years ago
|
*/
|
||
8 years ago
|
public function __construct($type = 'config', $params)
|
||
10 years ago
|
{
|
||
14 years ago
|
if (isset($params)) {
|
||
|
switch ($type) {
|
||
|
case 'db':
|
||
|
// TODO: Implement this way of object creation.
|
||
8 years ago
|
break;
|
||
14 years ago
|
case 'config': // Do the same as the default.
|
||
|
default:
|
||
10 years ago
|
foreach ($params as $a => $value) {
|
||
|
switch ($a) {
|
||
|
case 'system_id':
|
||
|
$this->identifier = strtolower($value);
|
||
|
break;
|
||
|
case 'title':
|
||
|
$this->title = $value;
|
||
8 years ago
|
// no break - @todo check this, not sure the intention is to have description=title
|
||
10 years ago
|
case 'description':
|
||
|
$this->description = $value;
|
||
|
break;
|
||
|
case 'developer_id':
|
||
|
$this->developer_id = $value;
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
14 years ago
|
}
|
||
|
}
|
||
10 years ago
|
}
|
||
15 years ago
|
}
|