first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
// No direct access.
|
||||
defined( 'ABSPATH' ) || die();
|
||||
?>
|
||||
<style>
|
||||
ul.tagit{background: none;background-color:#f5f5f5;}
|
||||
.wpfdparams ul.tagit {margin: 0 !important;}
|
||||
.tagit-hidden-field{display:none;}
|
||||
ul.tagit input[type="text"]{background-color: #f5f5f5;}
|
||||
ul.tagit li {
|
||||
font-weight: normal !important;
|
||||
color: #6B6B6B !important;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
<?php echo $this->form; ?>
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
jQuery("#file_tags").tagit({
|
||||
availableTags: <?php echo $this->allTagsFiles; ?>,
|
||||
afterTagAdded:function(e){e.preventDefault();},
|
||||
allowSpaces :true
|
||||
});
|
||||
});
|
||||
<?php echo wpfd_calendartranslation();?>
|
||||
</script>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
$content = '';
|
||||
|
||||
if (!empty($this->versions)) {
|
||||
$content .= '<table>';
|
||||
foreach ($this->versions as $meta_id => $file) {
|
||||
|
||||
$version = '1';
|
||||
$content .= '<tr>';
|
||||
$content .= '<td><a href="admin-ajax.php?action=wpfd&task=file.download&version=' . $version . '&id=' . $this->file_id . '&vid=' . $file['meta_id'] . '&catid='.$file['catid'].'" >';
|
||||
$content .= date("Y M d", strtotime($file['created_time'])) . ' ';
|
||||
$content .= '</a></td>';
|
||||
$content .= '<td>' . wpfdHelperFiles::bytesToSize($file['size']) . '</td>';
|
||||
$content .= '<td>'.
|
||||
'<a data-id="' . $this->file_id . '" data-vid="' . $file['meta_id'] . '" data-catid="'.$file['catid'].'" href="#" class="restore"><i class="icon-restore"></i></a>';
|
||||
if(apply_filters('wpfdAddonCategoryFrom',$file['catid']) == 'dropbox'){
|
||||
$content .= '';
|
||||
}else{
|
||||
$content .= '<a data-id="' . $this->file_id . '" data-vid="' . $file['meta_id'] . '" data-catid="'.$file['catid'].'" href="#" class="trash"><i class="icon-trash"></i></a></td>';
|
||||
}
|
||||
$content .= '</tr>';
|
||||
|
||||
}
|
||||
$content .= '</table>';
|
||||
}
|
||||
echo $content;
|
||||
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
use Joomunited\WPFramework\v1_0_4\Application;
|
||||
use Joomunited\WPFramework\v1_0_4\View;
|
||||
use Joomunited\WPFramework\v1_0_4\Utilities;
|
||||
use Joomunited\WPFramework\v1_0_4\Form;
|
||||
|
||||
defined( 'ABSPATH' ) || die();
|
||||
|
||||
class wpfdViewFile extends View {
|
||||
public function render($tpl = null) {
|
||||
$model = $this->getModel('file');
|
||||
$idCategory = Utilities::getInt('idCategory');
|
||||
if (apply_filters('wpfdAddonCategoryFrom', $idCategory) == 'googleDrive') {
|
||||
$fileId = Utilities::getInput('id', 'GET', 'none');
|
||||
$datas = apply_filters('wpfdAddonGetFileInfo', $fileId);
|
||||
}
|
||||
elseif (apply_filters('wpfdAddonCategoryFrom', $idCategory) == 'dropbox') {
|
||||
$fileId = Utilities::getInput('id', 'GET', 'none');
|
||||
$datas = apply_filters('wpfdAddonDropboxGetFileInfo', $fileId,$idCategory);
|
||||
}
|
||||
else {
|
||||
$datas = $model->getfile(Utilities::getInt('id'));
|
||||
}
|
||||
|
||||
$layout = Utilities::getInput('layout','GET','string');
|
||||
if($layout == 'versions') {
|
||||
$this->file_id = $datas['ID'];
|
||||
if(apply_filters('wpfdAddonCategoryFrom', $idCategory) == 'dropbox'){
|
||||
$this->versions = apply_filters('wpfdAddonDropboxVersionInfo',$datas['ID'],$idCategory);
|
||||
}
|
||||
else{
|
||||
$this->versions = $model->getVersions($datas['ID'],$idCategory) ; //get_post_meta($datas['ID'], '_wpfd_file_versions', false);
|
||||
}
|
||||
parent::render($layout);
|
||||
wp_die();
|
||||
}
|
||||
// $application = Application::getInstance('wpfd');
|
||||
// require_once $application->getPath().DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'forms'.DIRECTORY_SEPARATOR.'fields'.DIRECTORY_SEPARATOR.'Hits.php';
|
||||
|
||||
$form = new Form();
|
||||
if($form->load('file',$datas)){
|
||||
$this->form = $form->render('link');
|
||||
}
|
||||
|
||||
$tags = get_terms( 'wpfd-tag', array(
|
||||
'orderby' => 'count',
|
||||
'hide_empty' => 0,
|
||||
) );
|
||||
|
||||
$allTagsFiles = '';
|
||||
if ($tags) {
|
||||
foreach ($tags as $tag) {
|
||||
$allTagsFiles[] = ''.$tag->slug;
|
||||
}
|
||||
$this->allTagsFiles = '["'.implode('","', $allTagsFiles ).'"]';
|
||||
} else {
|
||||
$this->allTagsFiles = '[]';
|
||||
}
|
||||
|
||||
parent::render($tpl);
|
||||
wp_die();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user