| Current Path : /var/www/html/plugins/osmembership/documents/tmpl/ |
| Current File : /var/www/html/plugins/osmembership/documents/tmpl/documents.php |
<?php
/**
* @package Joomla
* @subpackage Membership Pro
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2012 - 2026 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/**
* Layout variables
* -----------------
* @var array $documents
* @var string $path
* @var int $Itemid
* @var bool $showModifiedDate
*/
$bootstrapHelper = OSMembershipHelperBootstrap::getInstance();
$centerClass = $bootstrapHelper->getClassMapping('center');
$config = OSMembershipHelper::getConfig();
?>
<table class="adminlist <?php echo $bootstrapHelper->getClassMapping('table table-striped table-bordered'); ?>" id="adminForm">
<thead>
<tr>
<th class="title"><?php echo Text::_('OSM_TITLE'); ?></th>
<th class="title"><?php echo Text::_('OSM_DOCUMENT'); ?></th>
<?php
if ($showModifiedDate)
{
?>
<th class="<?php echo $centerClass; ?>"><?php echo Text::_('OSM_MODIFIED_DATE'); ?></th>
<?php
}
?>
<th class="<?php echo $centerClass; ?>"><?php echo Text::_('OSM_SIZE'); ?></th>
<th class="<?php echo $centerClass; ?>"><?php echo Text::_('OSM_DOWNLOAD'); ?></th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $i < count($documents); $i++)
{
$document = $documents[$i];
$downloadLink = Route::_('index.php?option=com_osmembership&task=download_document&id=' . $document->id . '&Itemid=' . $Itemid);
$filePath = $path . $document->attachment;
?>
<tr>
<td><a href="<?php echo $downloadLink ?>"><?php echo $document->title; ?></a></td>
<td><?php echo $document->attachment; ?></td>
<?php
if ($showModifiedDate)
{
?>
<td class="<?php echo $centerClass; ?>">
<?php
if (file_exists($filePath))
{
echo HTMLHelper::_('date', filemtime($filePath), $config->date_format);
}
?>
</td>
<?php
}
?>
<td class="<?php echo $centerClass; ?>">
<?php
if (file_exists($filePath))
{
echo OSMembershipHelperHtml::getFormattedFilezize($filePath);
}
?>
</td>
<td class="<?php echo $centerClass; ?>">
<a href="<?php echo $downloadLink; ?>"><i class="<?php echo $bootstrapHelper->getClassMapping('icon-download'); ?>"></i></a>
</td>
</tr>
<?php
}
?>
</tbody>
</table>