|
|
@ -22,7 +22,7 @@ class Course |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Create a new Course-object |
|
|
|
* Create a new Course-object |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function __construct() |
|
|
|
public function __construct() |
|
|
|
{ |
|
|
|
{ |
|
|
|
$this->resources = array(); |
|
|
|
$this->resources = array(); |
|
|
|
$this->code = ''; |
|
|
|
$this->code = ''; |
|
|
@ -94,14 +94,12 @@ class Course |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function get_sample_text() |
|
|
|
public function get_sample_text() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
$sample_text = ''; |
|
|
|
$sample_text = ''; |
|
|
|
foreach ($this->resources as $type => & $resources) { |
|
|
|
foreach ($this->resources as $type => & $resources) { |
|
|
|
if (count($resources) > 0) { |
|
|
|
if (count($resources) > 0) { |
|
|
|
foreach ($resources as $id => & $resource) { |
|
|
|
foreach ($resources as $id => & $resource) { |
|
|
|
$title = ''; |
|
|
|
$title = ''; |
|
|
|
$description = ''; |
|
|
|
$description = ''; |
|
|
|
|
|
|
|
|
|
|
|
switch ($type) { |
|
|
|
switch ($type) { |
|
|
|
case RESOURCE_ANNOUNCEMENT: |
|
|
|
case RESOURCE_ANNOUNCEMENT: |
|
|
|
$title = $resource->title; |
|
|
|
$title = $resource->title; |
|
|
@ -214,8 +212,8 @@ class Course |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Converts to the system encoding all the language-sensitive fields in the imported course. |
|
|
|
* Converts to the system encoding all the language-sensitive fields in the imported course. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function to_system_encoding() { |
|
|
|
public function to_system_encoding() |
|
|
|
|
|
|
|
{ |
|
|
|
if (api_equal_encodings($this->encoding, api_get_system_encoding())) { |
|
|
|
if (api_equal_encodings($this->encoding, api_get_system_encoding())) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -223,9 +221,7 @@ class Course |
|
|
|
foreach ($this->resources as $type => & $resources) { |
|
|
|
foreach ($this->resources as $type => & $resources) { |
|
|
|
if (count($resources) > 0) { |
|
|
|
if (count($resources) > 0) { |
|
|
|
foreach ($resources as $id => & $resource) { |
|
|
|
foreach ($resources as $id => & $resource) { |
|
|
|
|
|
|
|
|
|
|
|
switch ($type) { |
|
|
|
switch ($type) { |
|
|
|
|
|
|
|
|
|
|
|
case RESOURCE_ANNOUNCEMENT: |
|
|
|
case RESOURCE_ANNOUNCEMENT: |
|
|
|
$resource->title = api_to_system_encoding($resource->title, $this->encoding); |
|
|
|
$resource->title = api_to_system_encoding($resource->title, $this->encoding); |
|
|
|
$resource->content = api_to_system_encoding($resource->content, $this->encoding); |
|
|
|
$resource->content = api_to_system_encoding($resource->content, $this->encoding); |
|
|
|