Skip to content

Commit

Permalink
[NCN-502] move youtube link to the online lecture column in course re… (
Browse files Browse the repository at this point in the history
  • Loading branch information
JackS9 authored and dbenham committed Dec 20, 2023
1 parent bc75b62 commit 27d06b2
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions core/components/com_resources/site/views/view/tmpl/courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@
$videoi = '';
$breeze = '';
$hubpresenter = '';
$youtube = '';
$pdf = '';
$video = '';
$exercises = '';
Expand All @@ -308,6 +309,7 @@
$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)
{
Expand All @@ -321,17 +323,24 @@
case 'hubpresenter':
$hubpresenter .= (!$hubpresenter) ? '<a title="View Presentation - HTML5 Version" class="hubpresenter html5" href="'.$grandchild->path.'" title="'.$this->escape(stripslashes($grandchild->title)).'">'.Lang::txt('View HTML').'</a>' : '';
break;
case 'elink':
case 'youtube':
if ($logical_alias == 'youtube') // youtube
{
$youtube .= (!$youtube) ? '<a title="View Presentation - YouTube Version" class="youtube" href="'.$grandchild->path.'" title="'.$this->escape(stripslashes($grandchild->title)).'">'.Lang::txt('View on YouTube').'</a>' : '';
break;
}
case 'pdf':
default:
if ($grandchild->get('logical_type') == 14)
if ($logical_alias == 'pdf')
{
$ext = Filesystem::extension($grandchild->path);
$ext = (strpos($ext, '?') ? strstr($ext, '?', true) : $ext);
$pdf .= '<a href="'.$grandchild->path.'">'.Lang::txt('Notes').' (' . $ext . ')</a>'."\n";
$pdf .= '<a href="'.$grandchild->path.'">'.Lang::txt('Notes').' (' . $ext . ')</a><br />'."\n";
}
elseif ($grandchild->get('logical_type') == 51)
elseif ($logical_alias == 'homeworkassignment')
{
$exercises .= '<a href="'.$grandchild->path.'">'.stripslashes($grandchild->title).'</a>'."\n";
$exercises .= '<a href="'.$grandchild->path.'">'.stripslashes($grandchild->title).'</a><br />'."\n";
}
else
{
Expand Down Expand Up @@ -363,6 +372,10 @@
{
$html .= "\t\t\t".'<td>'.$hubpresenter.'<br>'.$breeze.'</td>'."\n";
}
else if ($youtube)
{
$html .= "\t\t\t".'<td>'.$youtube.'</td>'."\n";
}
else
{
$html .= "\t\t\t".'<td>'.$breeze.'</td>'."\n";
Expand Down

0 comments on commit 27d06b2

Please sign in to comment.