diff --git a/core/components/com_resources/site/views/view/tmpl/courses.php b/core/components/com_resources/site/views/view/tmpl/courses.php index 06b04b5c6c..a49272c03c 100644 --- a/core/components/com_resources/site/views/view/tmpl/courses.php +++ b/core/components/com_resources/site/views/view/tmpl/courses.php @@ -309,7 +309,6 @@ $grandchild->set('path', \Components\Resources\Helpers\Html::processPath($this->option, $grandchild, $child->id)); $alias = $grandchild->type->alias; - $logical_alias = Components\Resources\Models\Type::oneOrFail($grandchild->get('logical_type'))->alias; switch ($alias) { @@ -325,20 +324,20 @@ break; case 'elink': case 'youtube': - if ($logical_alias == 'youtube') // youtube + if ($grandchild->get('logical_type') == 68) // youtube { $youtube .= (!$youtube) ? ''.Lang::txt('View on YouTube').'' : ''; break; } case 'pdf': default: - if ($logical_alias == 'pdf') + if ($grandchild->get('logical_type') == 14) { $ext = Filesystem::extension($grandchild->path); $ext = (strpos($ext, '?') ? strstr($ext, '?', true) : $ext); $pdf .= ''.Lang::txt('Notes').' (' . $ext . ')
'."\n"; } - elseif ($logical_alias == 'homeworkassignment') + elseif ($grandchild->get('logical_type') == 51) { $exercises .= ''.stripslashes($grandchild->title).'
'."\n"; }