first commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
get_header(); ?>
|
||||
|
||||
<section id="primary" class="content-area">
|
||||
<main id="main" class="site-main" role="main">
|
||||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<header class="page-header">
|
||||
<?php
|
||||
the_archive_title( '<h1 class="page-title">', '</h1>' );
|
||||
|
||||
?>
|
||||
</header><!-- .page-header -->
|
||||
<div class="entry-content">
|
||||
<?php wpfd_detail_category(); ?>
|
||||
</div><!-- .entry-content -->
|
||||
<?php
|
||||
// If no content, include the "No posts found" template.
|
||||
else :
|
||||
get_template_part( 'content', 'none' );
|
||||
|
||||
endif;
|
||||
?>
|
||||
|
||||
</main><!-- .site-main -->
|
||||
</section><!-- .content-area -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
get_header(); ?>
|
||||
|
||||
<section id="primary" class="content-area">
|
||||
<main id="main" class="site-main" role="main">
|
||||
|
||||
<header class="page-header">
|
||||
<?php
|
||||
the_archive_title( '<h1 class="page-title">', '</h1>' );
|
||||
?>
|
||||
</header><!-- .page-header -->
|
||||
<div class="entry-content">
|
||||
<?php _e( 'No files found', 'wp-smart-editor' ); ?>
|
||||
</div><!-- .entry-content -->
|
||||
|
||||
</main><!-- .site-main -->
|
||||
</section><!-- .content-area -->
|
||||
|
||||
<?php get_footer(); ?>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/**
|
||||
* The template for displaying the header
|
||||
*
|
||||
* Displays all of the head element and everything up until the "site-content" div.
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Twenty_Fifteen
|
||||
* @since Twenty Fifteen 1.0
|
||||
*/
|
||||
?><!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> class="no-js">
|
||||
<head>
|
||||
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
|
||||
<body class='wpfdviewer'>
|
||||
<div id="primary" class="content-area">
|
||||
<?php
|
||||
wpfd_file_viewer();
|
||||
?>
|
||||
</div>
|
||||
<?php wp_footer(); ?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,413 @@
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
.wpfd-content-default {}
|
||||
|
||||
.wpfd-content-default h2 {
|
||||
padding: 10px 0 0 0;
|
||||
margin: 0px 0px 10px 0px;
|
||||
font-size: 18px;
|
||||
font-family: "robotoregular";
|
||||
color: #595959
|
||||
}
|
||||
|
||||
.wpfd-content-default a {
|
||||
text-decoration: none !important;
|
||||
border-bottom: 0;
|
||||
box-shadow: none;
|
||||
color: #444;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.wpfd-content-default a:hover {
|
||||
box-shadow: 1px 1px 12px #ccc;
|
||||
}
|
||||
|
||||
.wpfd-content-default .wpfd_list {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-flex-wrap: wrap;
|
||||
-ms-flex-wrap: wrap;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.wpfd-content-default .wpfd_list .file {
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
background: #ffffff;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file {
|
||||
min-height: 70px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext {
|
||||
height: 80px;
|
||||
width: 50px;
|
||||
margin-right: 15px;
|
||||
float: left;
|
||||
background: url(../../../assets/images/theme/neutral.png) center center transparent no-repeat;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.ai {
|
||||
background-image: url(../../../assets/images/theme/ai.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.avi {
|
||||
background-image: url(../../../assets/images/theme/avi.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.psd {
|
||||
background-image: url(../../../assets/images/theme/psd.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.css {
|
||||
background-image: url(../../../assets/images/theme/css.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.csv {
|
||||
background-image: url(../../../assets/images/theme/csv.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.dll {
|
||||
background-image: url(../../../assets/images/theme/dll.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.doc {
|
||||
background-image: url(../../../assets/images/theme/doc.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.docx {
|
||||
background-image: url(../../../assets/images/theme/docx.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.fla {
|
||||
background-image: url(../../../assets/images/theme/fla.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.flac {
|
||||
background-image: url(../../../assets/images/theme/flac.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.flv {
|
||||
background-image: url(../../../assets/images/theme/flv.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.gif {
|
||||
background-image: url(../../../assets/images/theme/gif.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.html {
|
||||
background-image: url(../../../assets/images/theme/html.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.iso {
|
||||
background-image: url(../../../assets/images/theme/iso.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.jpg {
|
||||
background-image: url(../../../assets/images/theme/jpg.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.gif {
|
||||
background-image: url(../../../assets/images/theme/gif.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mov {
|
||||
background-image: url(../../../assets/images/theme/mov.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mpg {
|
||||
background-image: url(../../../assets/images/theme/mpg.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mpeg {
|
||||
background-image: url(../../../assets/images/theme/mpeg.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.ogg {
|
||||
background-image: url(../../../assets/images/theme/ogg.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mp3 {
|
||||
background-image: url(../../../assets/images/theme/mp3.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mp4 {
|
||||
background-image: url(../../../assets/images/theme/mp4.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.mkv {
|
||||
background-image: url(../../../assets/images/theme/mkv.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.swf {
|
||||
background-image: url(../../../assets/images/theme/swf.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.pdf {
|
||||
background-image: url(../../../assets/images/theme/pdf.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.php {
|
||||
background-image: url(../../../assets/images/theme/php.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.png {
|
||||
background-image: url(../../../assets/images/theme/png.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.ppt {
|
||||
background-image: url(../../../assets/images/theme/ppt.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.pptx {
|
||||
background-image: url(../../../assets/images/theme/ppt.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.psd {
|
||||
background-image: url(../../../assets/images/theme/psd.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.raw {
|
||||
background-image: url(../../../assets/images/theme/raw.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.sql {
|
||||
background-image: url(../../../assets/images/theme/sql.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.svg {
|
||||
background-image: url(../../../assets/images/theme/svg.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.txt {
|
||||
background-image: url(../../../assets/images/theme/txt.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.wav {
|
||||
background-image: url(../../../assets/images/theme/wav.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.wmv {
|
||||
background-image: url(../../../assets/images/theme/wmv.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.xls {
|
||||
background-image: url(../../../assets/images/theme/xls.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.xlsx {
|
||||
background-image: url(../../../assets/images/theme/xlsx.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.xml {
|
||||
background-image: url(../../../assets/images/theme/xml.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.zip {
|
||||
background-image: url(../../../assets/images/theme/zip.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.rar {
|
||||
background-image: url(../../../assets/images/theme/rar.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext.exe {
|
||||
background-image: url(../../../assets/images/theme/exe.png);
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.wpfd-content-default .filecontent > div.ext .txt {
|
||||
position: absolute;
|
||||
top: 48px;
|
||||
left: 7px;
|
||||
display: block;
|
||||
width: 35px;
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
letter-spacing: -1px;
|
||||
text-transform: uppercase;
|
||||
font-family: arial, helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.wpfd_list .filecontent {
|
||||
margin-left: 0px;
|
||||
min-width: 225px;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file .file-right {
|
||||
float: right;
|
||||
margin: 10px 5px 0px 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file .openlink img {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file .downloadlink:hover {
|
||||
box-shadow: 1px 1px 12px #ccc;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file h3 {
|
||||
font-family: "robotobold";
|
||||
font-size: 16px;
|
||||
padding-top: 0px;
|
||||
margin: 8px 0 !important;
|
||||
clear: none;
|
||||
word-wrap: normal;
|
||||
color: #444;
|
||||
line-height: 1em;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file .file-xinfo {
|
||||
margin-left: 65px;
|
||||
font-size: 11px;
|
||||
text-transform: none;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.wpfd-content-default .file .filecontent {
|
||||
font-size: 0.8em;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.wpfd-foldertree-default {
|
||||
width: 28%;
|
||||
}
|
||||
|
||||
.wpfd-container-default {
|
||||
box-sizing: border-box;
|
||||
padding: 0px 10px 0 5px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpfd-container-default .wpfd-categories h2 {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.wpfd-container-default.with_foldertree {
|
||||
float: left;
|
||||
width: 70%;
|
||||
padding: 0px 10px 0px 0px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
/* single file */
|
||||
|
||||
.wpfd-single-file {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpfd-single-file .wpfd-file-link {
|
||||
background: #444 url("../../../assets/images/theme/download.png") no-repeat scroll 5px center;
|
||||
border: medium none;
|
||||
border-radius: 0px;
|
||||
transition: all 0.2s ease 0s;
|
||||
float: left;
|
||||
margin: 7px;
|
||||
padding: 10px 20px 10px 60px;
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
.wpfd-single-file .wpfd-file-link:hover {
|
||||
background: #888 url("../../../assets/images/theme/download.png") no-repeat scroll 5px center;
|
||||
box-shadow: 1px 1px 12px #ccc;
|
||||
}
|
||||
|
||||
.wpfd-single-file .wpfd-file-link a {
|
||||
color: #FFF;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
box-shadow: none;
|
||||
text-shadow: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.wpfd-single-file .wpfd-file-link a:hover {
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.wpfd-single-file .droptitle {
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.wpfd-single-file .wpfd-file-link span.dropinfos {
|
||||
font-weight: normal;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
ul.jaofiletree li {
|
||||
padding-left: 10px !important;
|
||||
}
|
||||
.wpfd-foldertree-default {
|
||||
width: 100% !important;
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
.wpfd-container-default.with_foldertree {
|
||||
width: 100% !important;
|
||||
}
|
||||
.foldertree-hide {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form class="wpfdparams" method="POST" action="admin.php?page=wpfd-config&theme=default&task=config.savethemeparams">
|
||||
<input
|
||||
name="marginleft"
|
||||
type="typeint"
|
||||
label="Margin left"
|
||||
value="10"
|
||||
class="inputbox input-block-level"
|
||||
required="true"
|
||||
/>
|
||||
<input
|
||||
name="marginright"
|
||||
type="typeint"
|
||||
label="Margin right"
|
||||
value="10"
|
||||
class="inputbox input-block-level"
|
||||
required="true"
|
||||
/>
|
||||
<input
|
||||
name="margintop"
|
||||
type="typeint"
|
||||
label="Margin top"
|
||||
value="10"
|
||||
class="inputbox input-block-level"
|
||||
required="true"
|
||||
/>
|
||||
<input
|
||||
name="marginbottom"
|
||||
type="typeint"
|
||||
label="Margin bottom"
|
||||
value="10"
|
||||
class="inputbox input-block-level"
|
||||
required="true"
|
||||
/>
|
||||
|
||||
<input
|
||||
name="showsize"
|
||||
type="select"
|
||||
label="Show weight"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showtitle"
|
||||
type="select"
|
||||
label="Show title"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
<input
|
||||
name="croptitle"
|
||||
type="text2"
|
||||
label="Crop titles"
|
||||
value="0"
|
||||
class="inputbox input-block-level"
|
||||
required="true"
|
||||
tooltip="Crop the files titles after a predefined number of characters"
|
||||
namespace="Joomunited\WP_File_Download\Admin\Fields\"
|
||||
/>
|
||||
<input
|
||||
name="showversion"
|
||||
type="select"
|
||||
label="Show version"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showhits"
|
||||
type="select"
|
||||
label="Show hits"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showdownload"
|
||||
type="select"
|
||||
label="Show download link"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
<input
|
||||
name="bgdownloadlink"
|
||||
type="text"
|
||||
label="Background download link"
|
||||
value="#76bc58"
|
||||
class="inputbox input-block-level wp-color-field"
|
||||
/>
|
||||
<input
|
||||
name="colordownloadlink"
|
||||
type="text"
|
||||
label="Color download link"
|
||||
value="#ffffff"
|
||||
class="inputbox input-block-level wp-color-field"
|
||||
/>
|
||||
|
||||
<input
|
||||
name="showdateadd"
|
||||
type="select"
|
||||
label="Show date added"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showdatemodified"
|
||||
type="select"
|
||||
label="Show date modified"
|
||||
value="0"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showsubcategories"
|
||||
type="select"
|
||||
label="Show subcategories"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showbreadcrumb"
|
||||
type="select"
|
||||
label="Show Breadcrumb"
|
||||
value="1"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<input
|
||||
name="showfoldertree"
|
||||
type="select"
|
||||
label="Show folder tree"
|
||||
value="0"
|
||||
class="inline">
|
||||
<option value="1">Yes</option>
|
||||
<option value="0">No</option>
|
||||
</input>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
value="Save"
|
||||
class="button button-primary"
|
||||
/>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,245 @@
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
jQuery(document).ready(function($) {
|
||||
var sourcefiles = $("#wpfd-template-files").html();
|
||||
var sourcecategories = $("#wpfd-template-categories").html();
|
||||
var default_hash = window.location.hash;
|
||||
var tree = $('.wpfd-foldertree-default');
|
||||
var tree_source_cat = $('.wpfd-content-default.wpfd-content-multi').data('category');
|
||||
var cParents = {};
|
||||
|
||||
$(".wpfd-content-default").each(function(index ){
|
||||
var topCat = $(this).data('category');
|
||||
cParents[topCat] = {parent:0, term_id: topCat,name: $(this).find("h2").text()};
|
||||
$(this).find(".wpfdcategory.catlink").each(function(index ){
|
||||
var tempidCat = $(this).data('idcat');
|
||||
cParents[tempidCat]= {parent:topCat, term_id:tempidCat,name: $(this).text()};
|
||||
})
|
||||
})
|
||||
|
||||
Handlebars.registerHelper('bytesToSize', function(bytes) {
|
||||
return bytes == 'n/a' ? bytes : bytesToSize(parseInt(bytes));
|
||||
});
|
||||
|
||||
function default_initClick(){
|
||||
|
||||
$('.wpfd-content-default .catlink').click(function(e){
|
||||
default_load($(this).parents('.wpfd-content-default.wpfd-content-multi').data('category'), $(this).data('idcat'));
|
||||
return false;
|
||||
});
|
||||
}
|
||||
default_initClick();
|
||||
default_hash = default_hash.replace('#','');
|
||||
if (default_hash != '') {
|
||||
var hasha = default_hash.split('-');
|
||||
var re = new RegExp("^(p[0-9]+)$");
|
||||
var page = null;
|
||||
var stringpage = hasha.pop();
|
||||
|
||||
if (re.test(stringpage)) {
|
||||
page = stringpage.replace('p','');
|
||||
}
|
||||
|
||||
var hash_category_id = hasha[0];
|
||||
if(!parseInt(hash_category_id)){
|
||||
return;
|
||||
}
|
||||
setTimeout(function () {
|
||||
default_load($('.wpfd-content-default.wpfd-content-multi').data('category'), hash_category_id, page);
|
||||
},100)
|
||||
}
|
||||
|
||||
|
||||
function default_load(sourcecat,category, page){
|
||||
|
||||
var pathname = window.location.pathname;
|
||||
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_category').val(category);
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").next('.wpfd-pagination').remove();
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").empty();
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").html($('#wpfd-loading-wrap').html());
|
||||
//Get categories
|
||||
$.ajax({
|
||||
url: wpfdparams.ajaxurl+"?action=wpfd&task=categories.display&view=categories&id="+category+"&top="+sourcecat,
|
||||
dataType : "json"
|
||||
}).done(function(categories) {
|
||||
|
||||
if (page !=null) {
|
||||
window.history.pushState('', document.title, pathname + '#'+category+'-'+categories.category.slug+'-p' + page );
|
||||
} else {
|
||||
window.history.pushState('', document.title, pathname + '#'+category+'-'+categories.category.slug );
|
||||
}
|
||||
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_category_slug').val(categories.category.slug);
|
||||
|
||||
var template = Handlebars.compile(sourcecategories);
|
||||
var html = template(categories);
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").prepend(html);
|
||||
|
||||
for(i=0;i< categories.categories.length;i++) {
|
||||
cParents[categories.categories[i].term_id]= categories.categories[i];
|
||||
}
|
||||
|
||||
default_breadcrum(sourcecat,category);
|
||||
default_initClick();
|
||||
|
||||
if (tree.length) {
|
||||
|
||||
tree.find('li').removeClass('selected');
|
||||
tree.find('i.md').removeClass('md-folder-open').addClass("md-folder");
|
||||
|
||||
tree.jaofiletree('open', category);
|
||||
|
||||
var el = tree.find('a[data-file="'+category+'"]').parent();
|
||||
el.find(' > i.md').removeClass("md-folder").addClass("md-folder-open");
|
||||
|
||||
if (!el.hasClass('selected') ) {
|
||||
el.addClass('selected');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Get files
|
||||
$.ajax({
|
||||
url: wpfdparams.ajaxurl+"?action=wpfd&task=files.display&view=files&id="+category+"&rootcat="+tree_source_cat+"&page=" + page,
|
||||
dataType : "json"
|
||||
}).done(function(content) {
|
||||
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").after(content.pagination);
|
||||
delete content.pagination;
|
||||
var template = Handlebars.compile(sourcefiles);
|
||||
var html = template(content);
|
||||
html = $('<textarea/>').html(html).val();
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").append(html);
|
||||
|
||||
if (typeof wpfdColorboxInit !='undefined') {
|
||||
wpfdColorboxInit();
|
||||
}
|
||||
|
||||
wpfdTrackDownload();
|
||||
|
||||
default_init_pagination($('.wpfd-pagination'));
|
||||
wpfd_remove_loading($(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default"));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function default_breadcrum(sourcecat, catid) {
|
||||
var links = [];
|
||||
current_Cat = cParents[catid];
|
||||
if(!current_Cat){
|
||||
return false;
|
||||
}
|
||||
links.unshift(current_Cat);
|
||||
if (current_Cat.parent != 0) {
|
||||
while(cParents[current_Cat.parent]) {
|
||||
current_Cat = cParents[current_Cat.parent];
|
||||
links.unshift(current_Cat);
|
||||
};
|
||||
}
|
||||
|
||||
html = '';
|
||||
for(i=0;i<links.length;i++) {
|
||||
if(i< links.length-1) {
|
||||
html += '<li><a class="catlink" data-idcat="'+links[i].term_id+'" href="javascript:void(0)">'+links[i].name+'</a><span class="divider"> > </span></li>';
|
||||
}else {
|
||||
html += '<li><span>'+links[i].name+'</span></li>';
|
||||
}
|
||||
}
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-breadcrumbs-default").html(html);
|
||||
}
|
||||
|
||||
if (tree.length) {
|
||||
tree.each(function( index ) {
|
||||
var topCat = $(this).parents('.wpfd-content-default.wpfd-content-multi').data('category');
|
||||
$(this).jaofiletree({
|
||||
script : wpfdparams.ajaxurl+'?action=wpfd&task=categories.getSubs',
|
||||
usecheckboxes : false,
|
||||
root: topCat,
|
||||
showroot : cParents[topCat].name,
|
||||
onclick: function(elem,file){
|
||||
|
||||
if (topCat != file) {
|
||||
|
||||
$(elem).parents('.directory').each(function() {
|
||||
var $this = $(this);
|
||||
var category = $this.find(' > a');
|
||||
var parent = $this.find('.icon-open-close');
|
||||
if (parent.length > 0) {
|
||||
if (typeof cParents[category.data('file')] =='undefined') {
|
||||
cParents[category.data('file')] = {parent: parent.data('parent_id'),term_id:category.data('file'),name: category.text()};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
default_load(topCat,file);
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
$('.wpfd-pagination').each(function() {
|
||||
var $this = $(this);
|
||||
default_init_pagination($this);
|
||||
})
|
||||
|
||||
function default_init_pagination($this) {
|
||||
|
||||
var number = $this.find('a:not(.current)');
|
||||
|
||||
var wrap = $this.prev('.wpfd-content-default');
|
||||
|
||||
var current_category = wrap.find('#current_category').val();
|
||||
var sourcecat = wrap.data('category');
|
||||
|
||||
number.unbind('click').bind('click', function () {
|
||||
var page_number = $(this).attr('data-page');
|
||||
if (typeof page_number != 'undefined') {
|
||||
var pathname = window.location.pathname;
|
||||
var category = $(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_category').val();
|
||||
var category_slug = $(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"]").find('#current_category_slug').val();
|
||||
|
||||
window.history.pushState('', document.title, pathname + '#'+category+'-'+category_slug+'-p'+page_number );
|
||||
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default div.file").remove();
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").append($('#wpfd-loading-wrap').html());
|
||||
//Get files
|
||||
$.ajax({
|
||||
url: wpfdparams.ajaxurl+"?action=wpfd&task=files.display&view=files&id="+current_category+"&page=" + page_number,
|
||||
dataType : "json"
|
||||
}).done(function(content) {
|
||||
|
||||
delete content.category;
|
||||
wrap.next('.wpfd-pagination').remove();
|
||||
wrap.after(content.pagination);
|
||||
delete content.pagination;
|
||||
var template = Handlebars.compile(sourcefiles);
|
||||
var html = template(content);
|
||||
|
||||
$(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default").append(html);
|
||||
|
||||
|
||||
if (typeof wpfdColorboxInit != 'undefined') {
|
||||
wpfdColorboxInit();
|
||||
}
|
||||
default_init_pagination($('.wpfd-pagination'));
|
||||
wpfd_remove_loading($(".wpfd-content-default.wpfd-content-multi[data-category="+sourcecat+"] .wpfd-container-default"));
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
use Joomunited\WPFramework\v1_0_4\Factory;
|
||||
use Joomunited\WPFramework\v1_0_4\Application;
|
||||
use Joomunited\WPFramework\v1_0_4\Model;
|
||||
//-- No direct access
|
||||
defined( 'ABSPATH' ) || die();
|
||||
|
||||
class wpfdThemeDefault
|
||||
{
|
||||
|
||||
public $name = 'default';
|
||||
protected $options;
|
||||
|
||||
public function getThemeName(){
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function showCategory($options){
|
||||
|
||||
if(wpfdBase::checkExistTheme($this->name)) {
|
||||
$url = plugin_dir_url( __FILE__ );
|
||||
} else {
|
||||
$dirs = wp_get_upload_dir();
|
||||
$url = $dirs['baseurl'] . '/wpfd-themes/wpfd-' . $this->name .'/';
|
||||
}
|
||||
|
||||
if(empty($options['files']) && empty($options['categories'])){
|
||||
return '';
|
||||
}
|
||||
$this->options = $options;
|
||||
$app = Application::getInstance('wpfd');
|
||||
$modelConfig = Model::getInstance('config');
|
||||
$this->config = $modelConfig->getGlobalConfig();
|
||||
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('handlebars', $url . 'js/handlebars-1.0.0-rc.3.js');
|
||||
wp_enqueue_script('wpfd-front', plugins_url( 'app/site/assets/js/front.js' , WPFDL_PLUGIN_FILE,array(),WPFDL_VERSION ));
|
||||
wp_enqueue_style('wpfd-material-design', plugins_url( 'app/site/assets/css/material-design-iconic-font.min.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-foldertree', plugins_url( 'app/site/assets/js/jaofiletree.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_style('wpfd-foldertree', plugins_url( 'app/site/assets/css/jaofiletree.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-helper', plugins_url( 'assets/js/helper.js' , Application::getInstance('wpfd')->getPath().DIRECTORY_SEPARATOR.'site'.DIRECTORY_SEPARATOR.'foobar'));
|
||||
wp_enqueue_script('wpfd-theme-default', $url . 'js/script.js',array(),WPFDL_VERSION);
|
||||
wp_localize_script('wpfd-theme-default','wpfdparams', array(
|
||||
'ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl(),
|
||||
'ga_download_tracking' => $this->config['ga_download_tracking']
|
||||
));
|
||||
wp_enqueue_style('wpfd-theme-default', $url . 'css/style.css',array(),WPFDL_VERSION);
|
||||
|
||||
$content = '';
|
||||
$this->files = $this->options['files'];
|
||||
$this->category = $this->options['category'];
|
||||
$this->categories = $this->options['categories'];
|
||||
$this->params = $this->options['params'];
|
||||
|
||||
|
||||
if ($this->config['use_google_viewer'] == 'lightbox') {
|
||||
wp_enqueue_style('wpfd-videojs', plugins_url( 'app/site/assets/css/video-js.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_style('wpfd-colorbox', plugins_url( 'app/site/assets/css/colorbox.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_style('wpfd-viewer', plugins_url( 'app/site/assets/css/viewer.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-colorboxjs', plugins_url( 'app/site/assets/js/jquery.colorbox-min.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-colorbox-init', plugins_url( 'app/site/assets/js/colorbox.init.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-videojs', plugins_url( 'app/site/assets/js/video.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_localize_script('wpfd-colorbox-init','wpfdcolorbox',array('ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl()));
|
||||
}
|
||||
|
||||
if(!empty($this->options['files']) || wpfdBase::loadValue($this->params,'showsubcategories',1)==1){
|
||||
$this->style = 'margin : '.wpfdBase::loadValue($this->params,'margintop',5).'px '.wpfdBase::loadValue($this->params,'marginright',5).'px '.wpfdBase::loadValue($this->params,'marginbottom',5).'px '.wpfdBase::loadValue($this->params,'marginleft',5).'px;';
|
||||
|
||||
ob_start();
|
||||
require dirname(__FILE__).DIRECTORY_SEPARATOR.'tpl.php';
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
//fix conflict with wpautop in VC
|
||||
$content = str_replace(array("\n", "\r"), '', $content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
public function showFile($options){
|
||||
$this->options = $options;
|
||||
$modelConfig = Model::getInstance('config');
|
||||
$this->config = $modelConfig->getGlobalConfig();
|
||||
if(wpfdBase::checkExistTheme($this->name)) {
|
||||
$url = plugin_dir_url( __FILE__ );
|
||||
} else {
|
||||
$dirs = wp_get_upload_dir();
|
||||
$url = $dirs['baseurl'] . '/wpfd-themes/wpfd-' . $this->name .'/';
|
||||
}
|
||||
wp_enqueue_script('jquery');
|
||||
wp_enqueue_script('handlebars', $url . 'js/handlebars-1.0.0-rc.3.js');
|
||||
wp_enqueue_script('wpfd-front', plugins_url( 'app/site/assets/js/front.js' , WPFDL_PLUGIN_FILE,array(),WPFDL_VERSION ));
|
||||
wp_enqueue_style('wpfd-theme-default', $url . 'css/style.css');
|
||||
wp_localize_script('wpfd-front','wpfdparams', array(
|
||||
'ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl(),
|
||||
'ga_download_tracking' => $this->config['ga_download_tracking']
|
||||
));
|
||||
|
||||
if ($this->config['use_google_viewer'] == 'lightbox') {
|
||||
wp_enqueue_style('wpfd-videojs', plugins_url( 'app/site/assets/css/video-js.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_style('wpfd-colorbox', plugins_url( 'app/site/assets/css/colorbox.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_style('wpfd-viewer', plugins_url( 'app/site/assets/css/viewer.css' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-colorboxjs', plugins_url( 'app/site/assets/js/jquery.colorbox-min.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-colorbox-init', plugins_url( 'app/site/assets/js/colorbox.init.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_enqueue_script('wpfd-videojs', plugins_url( 'app/site/assets/js/video.js' , WPFDL_PLUGIN_FILE ),array(),WPFDL_VERSION);
|
||||
wp_localize_script('wpfd-colorbox-init','wpfdcolorbox',array('ajaxurl' => Application::getInstance('wpfd')->getAjaxUrl()));
|
||||
}
|
||||
|
||||
$content = '';
|
||||
if(!empty($this->options['file'])){
|
||||
$this->file = $this->options['file'];
|
||||
$this->params = $this->options['params'];
|
||||
$this->file_params = $this->options['file_params'];
|
||||
|
||||
$this->style = 'margin : '.wpfdBase::loadValue($this->params,'margintop',5).'px '.wpfdBase::loadValue($this->params,'marginright',5).'px '.wpfdBase::loadValue($this->params,'marginbottom',5).'px '.wpfdBase::loadValue($this->params,'marginleft',5).'px;';
|
||||
|
||||
|
||||
ob_start();
|
||||
require dirname(__FILE__).DIRECTORY_SEPARATOR.'tplsingle.php';
|
||||
|
||||
$content = ob_get_contents();
|
||||
ob_end_clean();
|
||||
//fix conflict with wpautop in VC
|
||||
$content = str_replace(array("\n", "\r"), '', $content);
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
use Joomunited\WPFramework\v1_0_4\Factory;
|
||||
use Joomunited\WPFramework\v1_0_4\Application;
|
||||
//-- No direct access
|
||||
defined( 'ABSPATH' ) || die();
|
||||
$app = Application::getInstance('wpfd');
|
||||
?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showsubcategories',1)==1): ?>
|
||||
<script type="text/x-handlebars-template" id="wpfd-template-categories">
|
||||
<div class="wpfd-categories">
|
||||
<?php if(wpfdBase::loadValue($this->params,'showcategorytitle',1)==1): ?>
|
||||
{{#if category}}
|
||||
{{#with category}}
|
||||
<h2>{{name}}
|
||||
{{#if parent}}
|
||||
<a class="catlink wpfdcategory backcategory" href="#" data-idcat="{{parent}}"><i class="zmdi zmdi-chevron-left"></i><?php _e('Back','wp-smart-editor'); ?></a>
|
||||
{{/if}}
|
||||
</h2>
|
||||
{{/with}}
|
||||
{{/if}}
|
||||
<?php endif; ?>
|
||||
|
||||
{{#if categories}}
|
||||
{{#each categories}}
|
||||
<a class="catlink wpfdcategory" style="<?php echo $this->style; ?>" href="#" data-idcat="{{term_id}}"><span>{{name}}</span><i class="zmdi zmdi-folder wpfd-folder"></i></a>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
|
||||
<script type="text/x-handlebars-template" id="wpfd-template-files">
|
||||
{{#if files}}
|
||||
<div class="wpfd_list">
|
||||
{{#each files}}
|
||||
<div class="file" style="<?php echo $this->style; ?>">
|
||||
<div class="filecontent">
|
||||
<div class="ext {{ext}}"><span class="txt">{{ext}}</div>
|
||||
|
||||
<?php if(wpfdBase::loadValue($this->params,'showtitle',1)==1): ?>
|
||||
<h3><a href="{{linkdownload}}" class="wpfd_downloadlink" title="{{post_title}}">{{crop_title}}</a></h3>
|
||||
<?php endif; ?>
|
||||
<div class="file-xinfo">
|
||||
<div class="file-desc">{{{description}}}</div>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showversion',1)==1): ?>
|
||||
{{#if versionNumber}}
|
||||
<div class="file-version"><span><?php _e('Version :','wp-smart-editor'); ?></span> {{versionNumber}} </div>
|
||||
{{/if}}
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showsize',1)==1): ?>
|
||||
<div class="file-size"><span><?php _e('Size :','wp-smart-editor'); ?></span> {{bytesToSize size}}</div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showhits',1)==1): ?>
|
||||
<div class="file-hits"><span><?php _e('Hits :','wp-smart-editor'); ?></span> {{hits}}</div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdateadd',0)==1): ?>
|
||||
<div class="file-dated"><span><?php _e('Date added :','wp-smart-editor'); ?></span> {{created}}</div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdatemodified',0)==1): ?>
|
||||
<div class="file-modifed"><span><?php _e('Date modified :','wp-smart-editor'); ?></span> {{modified}}</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<span class="file-right">
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdownload',1)==1): ?>
|
||||
<?php
|
||||
$bg_download = wpfdBase::loadValue($this->params,'bgdownloadlink','');
|
||||
$color_download = wpfdBase::loadValue($this->params,'colordownloadlink','');
|
||||
$download_style = '';
|
||||
if ($bg_download != '' ) {
|
||||
$download_style .= 'background-color:'.$bg_download.';';
|
||||
}
|
||||
if ($color_download != '') {
|
||||
$download_style .= 'color:'.$color_download.';';
|
||||
}
|
||||
if ($download_style != '') {
|
||||
$download_style = 'style="'.$download_style.'"';
|
||||
}
|
||||
?>
|
||||
|
||||
<a class="downloadlink wpfd_downloadlink" href="{{linkdownload}}" <?php echo $download_style;?>><?php _e('Download','wp-smart-editor'); ?><i class="zmdi zmdi-cloud-download wpfd-download"></i></a>
|
||||
<?php endif; ?>
|
||||
{{#if openpdflink}}
|
||||
<a href="{{openpdflink}}" target="_blank"><?php _e('Preview','wp-smart-editor'); ?><i class="zmdi zmdi-filter-center-focus wpfd-preview"></i></a>
|
||||
{{else}}
|
||||
{{#if viewerlink}}
|
||||
<?php
|
||||
$viewer_attr = 'class="openlink wpfdlightbox wpfd_previewlink"';
|
||||
if ($this->config['use_google_viewer'] == 'tab') {
|
||||
$viewer_attr = 'class="openlink wpfd_previewlink" target="_blank"';
|
||||
} ?>
|
||||
<a href="{{viewerlink}}" <?php echo $viewer_attr;?> data-id="{{ID}}" data-catid="{{catid}}" data-file-type="{{ext}}"><?php _e('Preview','wp-smart-editor'); ?><i class="zmdi zmdi-filter-center-focus wpfd-preview"></i></a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</script>
|
||||
<?php if(!empty($this->category) ): ?>
|
||||
<?php if(!empty($this->files) || !empty($this->categories)): ?>
|
||||
|
||||
<div class="wpfd-content wpfd-content-default wpfd-content-multi" data-category="<?php echo $this->category->term_id; ?>">
|
||||
<input type="hidden" id="current_category" value="<?php echo $this->category->term_id; ?>"/>
|
||||
<input type="hidden" id="current_category_slug" value="<?php echo $this->category->slug; ?>"/>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showbreadcrumb',1)==1): ?>
|
||||
<ul class="breadcrumbs wpfd-breadcrumbs-default">
|
||||
<li class="active">
|
||||
<?php echo $this->category->name; ?>
|
||||
</li>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<div class="wpfd-container">
|
||||
<?php if(wpfdBase::loadValue($this->params,'showfoldertree',0)==1): ?>
|
||||
<div class="wpfd-foldertree wpfd-foldertree-default <?php echo wpfdBase::loadValue($this->params,'showsubcategories',1)==1 ? 'foldertree-hide' : '';?>">
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wpfd-container-default <?php if(wpfdBase::loadValue($this->params,'showfoldertree',0)==1) { echo " with_foldertree";}?>">
|
||||
<div class="wpfd-categories">
|
||||
<?php if(wpfdBase::loadValue($this->params,'showcategorytitle',1)==1): ?>
|
||||
<h2><?php echo $this->category->name; ?></h2>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if(count($this->categories) && wpfdBase::loadValue($this->params,'showsubcategories',1)==1): ?>
|
||||
<?php foreach ($this->categories as $category): ?>
|
||||
<a class="wpfdcategory catlink" style="<?php echo $this->style; ?>" href="#" data-idcat="<?php echo $category->term_id; ?>" title="<?php echo $category->name; ?>">
|
||||
<span><?php echo $category->name; ?></span><i class="zmdi zmdi-folder wpfd-folder"></i></a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php if(!empty($this->files)): ?>
|
||||
<div class="wpfd_list">
|
||||
<?php foreach ($this->files as $file): ?>
|
||||
<div class="file" style="<?php echo $this->style; ?>">
|
||||
<div class="filecontent">
|
||||
<div class="ext <?php echo $file->ext ; ?>"><span class="txt"><?php echo $file->ext ; ?></div>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showtitle',1)==1): ?>
|
||||
<h3><a class="wpfd_downloadlink" href="<?php echo $file->linkdownload ?>" title="<?php echo $file->post_title ; ?>" ><?php echo $file->crop_title ; ?></a></h3>
|
||||
<?php endif; ?>
|
||||
<div class="file-xinfo">
|
||||
<div class="file-desc"><?php if(!empty($file->description)) {echo $file->description ;} else { echo '';} ?></div>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showversion',1)==1 && trim($file->versionNumber!='')): ?>
|
||||
<div class="file-version"><span><?php _e('Version :','wp-smart-editor'); ?></span> <?php echo $file->versionNumber; ?> </div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showsize',1)==1): ?>
|
||||
<div class="file-size"><span><?php _e('Size :','wp-smart-editor'); ?></span> <?php echo ($file->size == 'n/a') ? $file->size : wpfdHelperFile::bytesToSize($file->size); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showhits',1)==1): ?>
|
||||
<div class="file-hits"><span><?php _e('Hits :','wp-smart-editor'); ?></span> <?php echo $file->hits; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdateadd',0)==1): ?>
|
||||
<div class="file-dated"><span><?php _e('Date added :','wp-smart-editor'); ?></span> <?php echo $file->created; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdatemodified',0)==1): ?>
|
||||
<div class="file-modified"><span><?php _e('Date modified :','wp-smart-editor'); ?></span> <?php echo $file->modified; ?></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="file-right">
|
||||
<?php if(wpfdBase::loadValue($this->params,'showdownload',1)==1): ?>
|
||||
<?php
|
||||
$bg_download = wpfdBase::loadValue($this->params,'bgdownloadlink','');
|
||||
$color_download = wpfdBase::loadValue($this->params,'colordownloadlink','');
|
||||
$download_style = '';
|
||||
if ($bg_download != '' ) {
|
||||
$download_style .= 'background-color:'.$bg_download.';';
|
||||
}
|
||||
if ($color_download != '') {
|
||||
$download_style .= 'color:'.$color_download.';';
|
||||
}
|
||||
if ($download_style != '') {
|
||||
$download_style = 'style="'.$download_style.'"';
|
||||
}
|
||||
?>
|
||||
<a class="downloadlink wpfd_downloadlink" href="<?php echo $file->linkdownload ?>" <?php echo $download_style;?>>
|
||||
<?php _e('Download','wp-smart-editor'); ?> <i class="zmdi zmdi-cloud-download wpfd-download"></i></a>
|
||||
<?php endif; ?>
|
||||
<?php if (isset($file->openpdflink)) { ?>
|
||||
<a href="<?php echo $file->openpdflink; ?>" target="_blank">
|
||||
<?php _e('Preview','wp-smart-editor'); ?> <i class="zmdi zmdi-filter-center-focus wpfd-preview"></i></a>
|
||||
<?php } else { ?>
|
||||
<?php if (isset($file->viewerlink)) { ?>
|
||||
<?php
|
||||
$viewer_attr = 'class="openlink wpfdlightbox wpfd_previewlink"';
|
||||
if ($file->viewer_type == 'tab') {
|
||||
$viewer_attr = 'class="openlink wpfd_previewlink" target="_blank"';
|
||||
} ?>
|
||||
<a href="<?php echo $file->viewerlink; ?>" <?php echo $viewer_attr;?> data-id="<?php echo $file->ID ; ?>" data-catid="<?php echo $file->catid ; ?>" data-file-type="<?php echo $file->ext ;?>">
|
||||
<?php _e('Preview','wp-smart-editor'); ?> <i class="zmdi zmdi-filter-center-focus wpfd-preview"></i></a>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* WP File Download
|
||||
*
|
||||
* @package WP File Download
|
||||
* @author Joomunited
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
use Joomunited\WPFramework\v1_0_4\Factory;
|
||||
use Joomunited\WPFramework\v1_0_4\Application;
|
||||
//-- No direct access
|
||||
defined('ABSPATH') || die();
|
||||
$app = Application::getInstance('wpfd');
|
||||
?>
|
||||
<?php if (!empty($this->file)): ?>
|
||||
<?php
|
||||
$bg_color = wpfdBase::loadValue($this->file_params, 'singlebg', '#444444');
|
||||
$hover_color = wpfdBase::loadValue($this->file_params, 'singlehover', '#888888');
|
||||
$font_color = wpfdBase::loadValue($this->file_params, 'singlefontcolor', '#ffffff');
|
||||
|
||||
?>
|
||||
<style>
|
||||
.wpfd-single-file .wpfd_previewlink {
|
||||
margin-top: 10px;
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
}
|
||||
<?php if ($bg_color != '') {?>
|
||||
.wpfd-single-file .wpfd-file-link {
|
||||
background-color:<?php echo $bg_color;?> !important;
|
||||
}
|
||||
<?php } ?>
|
||||
<?php if ($font_color != '') {?>
|
||||
.wpfd-single-file .wpfd-file-link a{
|
||||
color:<?php echo $font_color;?> !important;
|
||||
}
|
||||
<?php } ?>
|
||||
<?php if ($hover_color != '') { ?>
|
||||
.wpfd-single-file .wpfd-file-link a:hover {
|
||||
background-color:<?php echo $hover_color;?> !important;
|
||||
}
|
||||
<?php } ?>
|
||||
</style>
|
||||
|
||||
<div class="wpfd-file wpfd-single-file" data-file="<?php echo $this->file->ID; ?>">
|
||||
<div class="wpfd-file-link wpfd_downloadlink">
|
||||
<a class="noLightbox"
|
||||
href="<?php echo $this->file->linkdownload ?>"
|
||||
data-id="<?php echo $this->file->ID; ?>" title="<?php echo ($this->file->description)?$this->file->description:$this->file->title; ?>">
|
||||
<span class="droptitle"><?php echo $this->file->title; ?></span><br/>
|
||||
<span class="dropinfos">
|
||||
<?php if (wpfdBase::loadValue($this->params, 'showsize', 1) == 1): ?>
|
||||
<b><?php _e('Size', 'wp-smart-editor'); ?> : </b><?php echo wpfdHelperFile::bytesToSize($this->file->size); ?>
|
||||
<?php endif; ?>
|
||||
<b><?php _e('Format', 'wp-smart-editor'); ?> : </b><?php echo strtoupper($this->file->ext); ?>
|
||||
</span>
|
||||
</a><br>
|
||||
<?php if (isset($this->file->openpdflink)) { ?>
|
||||
<a href="<?php echo $this->file->openpdflink; ?>" class="noLightbox" target="_blank">
|
||||
<?php _e('Preview','wp-smart-editor'); ?> </a>
|
||||
<?php } else if (isset($this->file->viewerlink)) { ?>
|
||||
<a data-id="<?php echo $this->file->ID;?>" data-catid="<?php echo $this->file->catid;?>" data-file-type="<?php echo $this->file->ext;?>" class="openlink wpfdlightbox wpfd_previewlink noLightbox" href="<?php echo $this->file->viewerlink;?>">
|
||||
<?php _e('Preview','wp-smart-editor'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user