first commit
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
// No direct access.
|
||||
defined( 'ABSPATH' ) || die();
|
||||
|
||||
$items_thead = array(
|
||||
'ext' => __('#','wp-smart-editor'),
|
||||
'title' => __('Title','wp-smart-editor'),
|
||||
'size' => __('File size','wp-smart-editor'),
|
||||
'created_time' => __('Date added','wp-smart-editor'),
|
||||
'modified_time' => __('Date modified','wp-smart-editor'),
|
||||
'version' => __('Version','wp-smart-editor'),
|
||||
'hits' => __('Hits','wp-smart-editor'),
|
||||
'actions' => __('Actions','wp-smart-editor')
|
||||
);
|
||||
?>
|
||||
<table class="restable">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
foreach ($items_thead as $thead_key => $thead_text) {
|
||||
$icon = '';
|
||||
if ($thead_key === $this->ordering) {
|
||||
$icon = '<span class="dashicons dashicons-arrow-' . ($this->orderingdir === 'asc' ? 'up' : 'down') . '"></span>';
|
||||
}
|
||||
?>
|
||||
<th class="<?php echo $thead_key; ?>">
|
||||
<?php if ($thead_key == 'actions') { ?>
|
||||
<?php echo $thead_text; ?>
|
||||
<?php } else { ?>
|
||||
<a href="#" class="<?php echo($this->ordering === $thead_key ? 'currentOrderingCol' : ''); ?>"
|
||||
data-ordering="<?php echo $thead_key; ?>"
|
||||
data-direction="<?php echo $this->orderingdir; ?>"><?php echo $thead_text; ?><?php echo $icon; ?></a>
|
||||
<?php } ?>
|
||||
</th>
|
||||
<?php } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody >
|
||||
<?php if(is_array($this->files) || is_object($this->files)):?>
|
||||
<?php foreach ($this->files as $file): ?>
|
||||
<tr class="file" data-id-file="<?php echo $file->ID; ?>">
|
||||
<td class="ext <?php echo $file->ext; ?>"><span class="txt"><?php echo $file->ext; ?></span></td>
|
||||
<td class="title"><?php echo $file->post_title; ?></td>
|
||||
<td class="size"><?php echo ($file->size == 'n/a') ? $file->size : wpfdHelperFiles::bytesToSize($file->size); ?></td>
|
||||
<td class="created"><?php echo mysql2date(wpfdBase::loadValue($this->params, 'date_format', get_option('date_format')), $file->created); ?></td>
|
||||
<td class="modified"><?php echo mysql2date(wpfdBase::loadValue($this->params, 'date_format', get_option('date_format')), $file->modified); ?></td>
|
||||
<td class="version"><?php echo $file->version; ?></td>
|
||||
<td class="hits"><?php echo $file->hits.' '.__('hits','wp-smart-editor'); ?></td>
|
||||
<td class="actions"><a class="trash"><i class="icon-trash"></i></a> <a href="<?php echo $file->linkdownload;?>" class="download"><i class="icon-download"></i></a></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
use Joomunited\WPFramework\v1_0_4\View;
|
||||
use Joomunited\WPFramework\v1_0_4\Utilities;
|
||||
|
||||
defined( 'ABSPATH' ) || die();
|
||||
|
||||
class wpfdViewFiles extends View {
|
||||
|
||||
public function render($tpl = null) {
|
||||
$id_category = Utilities::getInt('id_category');
|
||||
if(empty($id_category)) return '';
|
||||
$model = $this->getModel();
|
||||
|
||||
$category_model = $this->getModel('Category');;
|
||||
|
||||
$this->category = $category_model->getCategory($id_category);
|
||||
|
||||
$this->ordering = Utilities::getInput('orderCol','GET','none') != null ? Utilities::getInput('orderCol','GET','none') : $this->category->ordering;
|
||||
$this->orderingdir = Utilities::getInput('orderDir','GET','none') != null ? Utilities::getInput('orderDir','GET','none') : $this->category->orderingdir;
|
||||
|
||||
|
||||
$modelConfig = $this->getModel('Config');
|
||||
|
||||
$this->params = $modelConfig->getConfig();
|
||||
|
||||
if(apply_filters('wpfdAddonCategoryFrom', $id_category) == 'googleDrive') {
|
||||
$this->files = apply_filters('wpfdAddonDisplayGoogleDriveCategories', $id_category);
|
||||
}
|
||||
elseif(apply_filters('wpfdAddonCategoryFrom', $id_category) == 'dropbox') {
|
||||
$this->files = apply_filters('wpfdAddonDisplayDropboxCategories', $id_category);
|
||||
}
|
||||
else {
|
||||
$this->files = $model->getFiles($id_category, $this->ordering, $this->orderingdir);
|
||||
}
|
||||
|
||||
parent::render($tpl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user