Skip to content

Commit

Permalink
Add download buttons to list layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Bakual committed Apr 15, 2024
1 parent db535ba commit 3247644
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
10 changes: 9 additions & 1 deletion com_sermonspeaker/site/views/serie/tmpl/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
$listDirn = $this->state->get('list.direction');
$limit = (int) $this->params->get('limit', '');
$player = SermonspeakerHelperSermonspeaker::getPlayer($this->items);
$prio = $this->params->get('fileprio');
?>
<div class="com-sermonspeaker-serie<?php echo $this->pageclass_sfx; ?> com-sermonspeaker-serie-list">
<?php echo $this->loadTemplate('header'); ?>
Expand Down Expand Up @@ -64,6 +65,13 @@ class="<?php echo ($item->state) ? '' : 'system-unpublished '; ?>cat-list-row<?p
<?php echo SermonspeakerHelperSermonspeaker::insertSermonTitle($i, $item, $player); ?>
</strong>
<?php echo LayoutHelper::render('blocks.state_info', array('item' => $item, 'show' => $showState)); ?>
<?php if (in_array('sermons:download', $this->columns)) : ?>
<?php $type = ($item->videofile and ($prio || !$item->audiofile)) ? 'video' : 'audio'; ?>
<?php $filesize = $type . 'filesize'; ?>
<span class="ss-dl ms-1 float-end">
<?php echo SermonspeakerHelperSermonspeaker::insertdlbutton($item->slug, $type, 3, $item->$filesize); ?>
</span>
<?php endif; ?>
<?php if (in_array('serie:hits', $this->columns)) : ?>
<span class="ss-hits badge bg-info float-end">
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
Expand Down Expand Up @@ -105,7 +113,7 @@ class="<?php echo ($item->state) ? '' : 'system-unpublished '; ?>cat-list-row<?p
<span class="ss-date float-end">
<small class="text-muted">
<?php echo HTMLHelper::date($item->sermon_date, Text::_($this->params->get('date_format')), true); ?>
</small>&nbsp;
</small>
</span>
<?php endif; ?>

Expand Down
10 changes: 9 additions & 1 deletion com_sermonspeaker/site/views/sermons/tmpl/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
$listDirn = $this->state->get('list.direction');
$limit = (int) $this->params->get('limit', '');
$player = SermonspeakerHelperSermonspeaker::getPlayer($this->items);
$prio = $this->params->get('fileprio');
?>
<div class="com-sermonspeaker-sermons<?php echo $this->pageclass_sfx; ?> com-sermonspeaker-sermons-list">
<?php echo LayoutHelper::render('blocks.header', array('category' => $this->category, 'params' => $this->params)); ?>
Expand Down Expand Up @@ -65,6 +66,13 @@ class="<?php echo ($item->state) ? '' : 'system-unpublished '; ?>cat-list-row<?p
<?php echo SermonspeakerHelperSermonspeaker::insertSermonTitle($i, $item, $player); ?>
</strong>
<?php echo LayoutHelper::render('blocks.state_info', array('item' => $item, 'show' => $showState)); ?>
<?php if (in_array('sermons:download', $this->columns)) : ?>
<?php $type = ($item->videofile and ($prio || !$item->audiofile)) ? 'video' : 'audio'; ?>
<?php $filesize = $type . 'filesize'; ?>
<span class="ss-dl ms-1 float-end">
<?php echo SermonspeakerHelperSermonspeaker::insertdlbutton($item->slug, $type, 3, $item->$filesize); ?>
</span>
<?php endif; ?>
<?php if (in_array('sermons:hits', $this->columns)) : ?>
<span class="ss-hits badge bg-info float-end">
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
Expand Down Expand Up @@ -122,7 +130,7 @@ class="<?php echo ($item->state) ? '' : 'system-unpublished '; ?>cat-list-row<?p
<small class="text-muted">
<?php echo HTMLHelper::date($item->sermon_date, Text::_($this->params->get('date_format')), true); ?>
</small>
</span>&nbsp;
</span>
<?php endif; ?>

<?php if (in_array('sermons:notes', $this->columns) and $item->notes) : ?>
Expand Down
8 changes: 8 additions & 0 deletions com_sermonspeaker/site/views/speaker/tmpl/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
$listDirnSeries = $this->state_series->get('list.direction');
$limit = (int) $this->params->get('limit', '');
$player = SermonspeakerHelperSermonspeaker::getPlayer($this->sermons);
$prio = $this->params->get('fileprio');

// Determine active tab
$this->getDocument()->addScriptDeclaration("window.onload = function() {
Expand Down Expand Up @@ -89,6 +90,13 @@ class="<?php echo ($item->state) ? '' : 'system-unpublished '; ?>cat-list-row<?p
<?php echo SermonspeakerHelperSermonspeaker::insertSermonTitle($i, $item, $player); ?>
</strong>
<?php echo LayoutHelper::render('blocks.state_info', array('item' => $item, 'show' => $showState)); ?>
<?php if (in_array('sermons:download', $this->col_sermon)) : ?>
<?php $type = ($item->videofile and ($prio || !$item->audiofile)) ? 'video' : 'audio'; ?>
<?php $filesize = $type . 'filesize'; ?>
<span class="ss-dl ms-1 float-end">
<?php echo SermonspeakerHelperSermonspeaker::insertdlbutton($item->slug, $type, 3, $item->$filesize); ?>
</span>
<?php endif; ?>
<?php if (in_array('speaker:hits', $this->col_sermon)) : ?>
<span class="ss-hits badge bg-info float-end">
<?php echo Text::sprintf('JGLOBAL_HITS_COUNT', $item->hits); ?>
Expand Down

0 comments on commit 3247644

Please sign in to comment.