--- a/simple-file-list/ee-admin-page.php
+++ b/simple-file-list/ee-admin-page.php
@@ -1,5 +1,5 @@
<?php // Simple File List Script: ee-admin-page.php | Author: Mitchell Bennis | support@simplefilelist.com
-
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! wp_verify_nonce( $eeSFL_Nonce, 'eeInclude' )) exit('ERROR 98'); // Exit if nonce fails
@@ -7,16 +7,16 @@
// Admin-Side Display
function eeSFL_BASE_BackEnd() {
-
+
global $eeSFL_BASE, $eeSFLU_BASE, $eeSFLM;
-
+
$eeConfirm = FALSE;
$eeForceSort = FALSE; // Only used in shortcode
$eeURL = $eeSFL_BASE->eeSFL_GetThisURL();
-
+
$eeAdmin = is_admin(); // Should be TRUE here
if(!$eeAdmin) { return FALSE; }
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include('includes/ee-admin-header.php');
@@ -31,221 +31,221 @@
} else {
$active_tab = 'file_list'; // Default tab
}
-
+
$eeOutput .= '
<h2 class="nav-tab-wrapper">';
-
+
// Main Tabs -------
-
+
// File List
$eeOutput .= '
<span class="nav-tab-wrapper-left">
- <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=file_list" class="nav-tab ' . ($active_tab == 'file_list' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('File List', 'ee-simple-file-list') . '</a>';
-
+ <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=file_list" class="nav-tab ' . ($active_tab == 'file_list' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('File List', 'simple-file-list') . '</a>';
+
// Settings
$eeOutput .= '
- <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings" class="nav-tab ' . ($active_tab == 'settings' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('List Settings', 'ee-simple-file-list') . '</a>';
-
+ <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings" class="nav-tab ' . ($active_tab == 'settings' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('List Settings', 'simple-file-list') . '</a>';
+
// Pro Upgrade
$eeOutput .= '
- <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=pro" class="nav-tab ' . ($active_tab == 'pro' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('Upgrade Version', 'ee-simple-file-list') . '</a>
+ <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=pro" class="nav-tab ' . ($active_tab == 'pro' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('Upgrade Version', 'simple-file-list') . '</a>
</span>';
-
+
// Right Tabs -------
$eeOutput .= '
<span class="nav-tab-wrapper-right">
- <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=author" class="nav-tab ' . ($active_tab == 'author' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('Author', 'ee-simple-file-list') . '</a>';
-
+ <a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=author" class="nav-tab ' . ($active_tab == 'author' ? 'nav-tab-active eeActiveTab' : '') . '">' . __('Author', 'simple-file-list') . '</a>';
+
// Link to Support Form
$eeOutput .= '
- <a href="https://simplefilelist.com/get-support/" class="nav-tab" target="_blank">' . __('Get Help', 'ee-simple-file-list') . ' →</a>
+ <a href="https://simplefilelist.com/get-support/" class="nav-tab" target="_blank">' . __('Get Help', 'simple-file-list') . ' →</a>
</span>
</h2>';
// END Main Tabs
-
-
-
+
+
+
// Tab Content =============================================================
-
+
if($active_tab == 'file_list') {
-
+
// Upload Check
$eeSFL_Uploaded = $eeSFLU_BASE->eeSFL_UploadCheck($eeSFL_BASE->eeListRun);
-
+
// Get the File Array
$eeSFL_BASE->eeSFL_UpdateFileListArray();
-
+
// echo '<pre>'; print_r($eeSFL_BASE->eeAllFiles); echo '</pre>';
// echo '<pre>'; print_r($eeSFL_BASE->eeLog); echo '</pre>'; exit;
-
+
$eeOutput .= '
-
+
<section class="eeSFL_Settings">
-
-
+
+
<div id="uploadFilesDiv" class="eeSettingsTile eeAdminUploadForm">';
-
+
// The Upload Form
$eeOutput .= $eeSFLU_BASE->eeSFL_UploadForm();
-
+
$eeOutput .= '</div>
-
-
+
+
<div class="eeSettingsTile">
-
+
<div class="eeColInline">';
-
+
// If showing just-uploaded files
- if($eeSFL_Uploaded AND $eeSFL_BASE->eeListSettings['UploadConfirm'] == 'YES') {
-
+ if($eeSFL_Uploaded AND $eeSFL_BASE->eeListSettings['UploadConfirm'] == 'YES') {
+
$eeOutput .= '
-
- <a href="' . $eeURL . '" class="button eeButton" id="eeSFL_BacktoFilesButton">← ' . __('Back to the Files', 'ee-simple-file-list') . '</a>';
-
+
+ <a href="' . $eeURL . '" class="button eeButton" id="eeSFL_BacktoFilesButton">← ' . __('Back to the Files', 'simple-file-list') . '</a>';
+
} else {
-
+
$eeOutput .= '
-
+
<div class="eeColHalfLeft">
-
- <a class="eeHide button eeFlex1" id="eeSFL_UploadFilesButtonSwap">' . __('Cancel Upload', 'ee-simple-file-list') . '</a>
- <a href="#" class="button eeFlex1" id="eeSFL_UploadFilesButton">' . __('Upload Files', 'ee-simple-file-list') . '</a>
- <a href="#" class="button eeFlex1" id="eeSFL_ReScanButton">' . __('Re-Scan Files', 'ee-simple-file-list') . '</a>
- <a href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" class="button eeFlex1" >' . __('Create Folder', 'ee-simple-file-list') . '</a>
-
+
+ <a class="eeHide button eeFlex1" id="eeSFL_UploadFilesButtonSwap">' . __('Cancel Upload', 'simple-file-list') . '</a>
+ <a href="#" class="button eeFlex1" id="eeSFL_UploadFilesButton">' . __('Upload Files', 'simple-file-list') . '</a>
+ <a href="#" class="button eeFlex1" id="eeSFL_ReScanButton">' . __('Re-Scan Files', 'simple-file-list') . '</a>
+ <a href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" class="button eeFlex1" >' . __('Create Folder', 'simple-file-list') . '</a>
+
</div>
-
+
<div class="eeColHalfRight">';
-
+
// Check Array and Get File Count
- if(is_array($eeSFL_BASE->eeAllFiles)) {
-
+ if(is_array($eeSFL_BASE->eeAllFiles)) {
+
$eeFileCount = count($eeSFL_BASE->eeAllFiles);
-
+
// Calc Date Last Changed
$eeArray = array();
foreach( $eeSFL_BASE->eeAllFiles as $eeKey => $eeFileArray) { $eeArray[] = $eeFileArray['FileDateAdded']; }
- rsort($eeArray); // Most recent at the top
-
- $eeOutput .= '<small>' . $eeFileCount . ' ' . __('Files', 'ee-simple-file-list') . ' - ' . __('Sorted by', 'ee-simple-file-list') . ' ' . ucwords($eeSFL_BASE->eeListSettings['SortBy']);
-
- if($eeSFL_BASE->eeListSettings['SortOrder'] == 'Ascending') { $eeOutput .= ' ↑'; } else { $eeOutput .= ' ↓'; }
-
- $eeOutput .= '<br />' .
- __('Last Changed', 'ee-simple-file-list') . ': ' . date_i18n( get_option('date_format'), strtotime( $eeArray[0] ) ) . '</small>';
-
+ rsort($eeArray); // Most recent at the top
+
+ $eeOutput .= '<small>' . $eeFileCount . ' ' . __('Files', 'simple-file-list') . ' - ' . __('Sorted by', 'simple-file-list') . ' ' . ucwords($eeSFL_BASE->eeListSettings['SortBy']);
+
+ if($eeSFL_BASE->eeListSettings['SortOrder'] == 'Ascending') { $eeOutput .= ' ↑'; } else { $eeOutput .= ' ↓'; }
+
+ $eeOutput .= '<br />' .
+ __('Last Changed', 'simple-file-list') . ': ' . date_i18n( get_option('date_format'), strtotime( $eeArray[0] ) ) . '</small>';
+
unset($eeArray);
-
- } else {
+
+ } else {
$eeSFL_BASE->eeAllFiles = array('' => ''); // No files found :-(
}
-
+
$eeOutput .= '</div>';
}
-
+
$eeOutput .= '
-
+
</div>
</div>
</section>';
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude'); // Security
- include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'ee-list-display.php'); // The File List
-
-
-
+ include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'ee-list-display.php'); // The File List
+
+
+
} elseif($active_tab == 'settings') {
-
+
// Sub Tabs
if( isset( $_GET['subtab'] ) ) {
$active_subtab = sanitize_text_field( $_GET['subtab'] ); // Sanitize input
} else {
$active_subtab = 'list_settings'; // Default subtab
}
-
+
$eeOutput .= '
<h2 class="nav-tab-wrapper">
<div class="ee-nav-sub-tabs">';
-
+
// List Settings
- $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=list_settings" class="nav-tab ' . ($active_subtab == 'list_settings' ? 'nav-tab-active' : '') . '">' . __('File List Settings', 'ee-simple-file-list') . '</a>';
-
+ $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=list_settings" class="nav-tab ' . ($active_subtab == 'list_settings' ? 'nav-tab-active' : '') . '">' . __('File List Settings', 'simple-file-list') . '</a>';
+
// Uploader Settings
- $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=uploader_settings" class="nav-tab ' . ($active_subtab == 'uploader_settings' ? 'nav-tab-active' : '') . '">' . __('File Upload Settings', 'ee-simple-file-list') . '</a>';
-
+ $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=uploader_settings" class="nav-tab ' . ($active_subtab == 'uploader_settings' ? 'nav-tab-active' : '') . '">' . __('File Upload Settings', 'simple-file-list') . '</a>';
+
// Notifications Settings
- $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=email_settings" class="nav-tab ' . ($active_subtab == 'email_settings' ? 'nav-tab-active' : '') . '">' . __('Notification Settings', 'ee-simple-file-list') . '</a>';
-
+ $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=email_settings" class="nav-tab ' . ($active_subtab == 'email_settings' ? 'nav-tab-active' : '') . '">' . __('Notification Settings', 'simple-file-list') . '</a>';
+
// Extension Settings (Coming Soon)
- $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=extension_settings" class="nav-tab ' . ($active_subtab == 'extension_settings' ? 'nav-tab-active' : '') . '">' . __('Extension Settings', 'ee-simple-file-list') . '</a>';
-
+ $eeOutput .= '<a href="?page=' . esc_attr(eeSFL_BASE_PluginSlug) . '&tab=settings&subtab=extension_settings" class="nav-tab ' . ($active_subtab == 'extension_settings' ? 'nav-tab-active' : '') . '">' . __('Extension Settings', 'simple-file-list') . '</a>';
+
// End Subtabs
$eeOutput .= '
-
+
</div>
</h2>
-
- <section class="eeSFL_Settings">';
-
+
+ <section class="eeSFL_Settings">';
+
// Sub-Tab Content
if($active_subtab == 'uploader_settings') {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-upload-settings.php'); // The Uploader Settings
-
+
} elseif($active_subtab == 'email_settings') {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-email-settings.php'); // The Notifications Settings
-
+
} elseif($active_subtab == 'extension_settings') {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-extension-settings.php'); // Extension Settings
-
+
} else {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
- include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-list-settings.php'); // The File List Settings
+ include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-list-settings.php'); // The File List Settings
}
-
+
$eeOutput .= '
-
+
</section>';
-
+
} elseif($active_tab == 'pro') { // Instructions Tab Display...
-
+
// Get the sales page
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-get-pro.php');
-
-
+
+
} elseif($active_tab == 'help') { // Email Support Tab Display...
-
+
$eePlugin = eeSFL_PluginName;
-
+
// Get the support page
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'support/ee-get-help.php');
-
-
+
+
} else { // Author
-
+
// Get the support page
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-plugin-author.php');
-
+
} // END Tab Content
-
-
+
+
$eeSFL_Nonce = wp_create_nonce('eeInclude');
include('includes/ee-admin-footer.php');
-
+
// Timer
$eeSFL_Time = microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"];
$eeSFL_BASE->eeLog[] = 'Execution Time: ' . round($eeSFL_Time,3);
-
+
// Logging
$eeOutput .= $eeSFL_BASE->eeSFL_WriteLogData(); // Only adds output if DevMode is ON
--- a/simple-file-list/ee-list-display.php
+++ b/simple-file-list/ee-list-display.php
@@ -1,5 +1,5 @@
<?php // Simple File List Script: ee-list-display.php | Author: Mitchell Bennis | support@simplefilelist.com
-
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! wp_verify_nonce( $eeSFL_Nonce, 'eeInclude' ) ) exit('ERROR 98'); // Exit if nonce fails
@@ -27,16 +27,16 @@
// Check for Upload Job
if( $eeSFL_Uploaded ) {
-
+
// echo '<pre>'; print_r($eeSFL_BASE->eeAllFiles); echo '</pre>'; exit;
-
+
foreach( $eeSFL_BASE->eeAllFiles as $eeKey => $eeFileArray ) {
-
+
if( in_array($eeFileArray['FilePath'], $eeSFLU_BASE->eeUploadedFiles) ) {
$eeSFL_BASE->eeDisplayFiles[] = $eeFileArray;
}
}
-
+
$eeSFL_BASE->eeAllFiles = $eeSFL_BASE->eeDisplayFiles;
if(count($eeSFL_BASE->eeAllFiles) == 0) {
@@ -68,12 +68,12 @@
// Upload Confirmation
if(!$eeAdmin AND $eeSFL_Uploaded AND $eeSFL_BASE->eeListSettings['UploadConfirm'] == 'YES' AND $eeSFL_BASE->eeListRun == 1) {
-
+
$eeOutput .= '
-
- <p><a href="' . eeSFL_BASE_AppendProperUrlOp($eeURL) . 'ee=1" class="button eeButton" id="eeSFL_BacktoFilesButton">← ' .
- __('Back to the Files', 'ee-simple-file-list') . '</a></p>
-
+
+ <p><a href="' . eeSFL_BASE_AppendProperUrlOp($eeURL) . 'ee=1" class="button eeButton" id="eeSFL_BacktoFilesButton">← ' .
+ __('Back to the Files', 'simple-file-list') . '</a></p>
+
';
}
@@ -84,33 +84,33 @@
if( !empty($eeSFL_BASE->eeAllFiles) ) {
if($eeAdmin OR $eeSFL_BASE->eeListSettings['ShowListStyle'] == 'TABLE') {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude'); // Security
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-list-display-table.php');
-
+
} elseif($eeSFL_BASE->eeListSettings['ShowListStyle'] == 'TILES') {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude'); // Security
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-list-display-tiles.php');
-
+
} else {
-
+
$eeSFL_Nonce = wp_create_nonce('eeInclude'); // Security
include($eeSFL_BASE->eeEnvironment['pluginDir'] . 'includes/ee-list-display-flex.php');
-
+
}
} else {
-
+
$eeSFL_BASE->eeLog[eeSFL_BASE_Go]['notice'][] = 'There are no files here :-(';
-
+
if($eeAdmin) {
$eeOutput .= '<div>
-
- <p>↑ ' . __('Upload some files and they will appear here.', 'ee-simple-file-list') . '</p>
-
+
+ <p>↑ ' . __('Upload some files and they will appear here.', 'simple-file-list') . '</p>
+
</div>
-
+
';
}
}
@@ -124,7 +124,7 @@
// Modal Input
if($eeAdmin OR $eeSFL_BASE->eeListSettings['AllowFrontManage'] == 'YES') {
-
+
$eeOutput .= '
<span class="eeHide" id="eeSFL_ActionNonce">';
if(is_admin() OR $eeSFL_BASE->eeListSettings['AllowFrontManage'] == 'YES') {
@@ -132,39 +132,39 @@
$eeOutput .= $eeSFL_ActionNonce;
}
$eeOutput .= '</span>
-
+
<div class="eeSFL_Modal" id="eeSFL_Modal_Manage">
<div class="eeSFL_ModalBackground"></div>
<div class="eeSFL_ModalBody">
-
+
<button id="eeSFL_Modal_Manage_Close" class="eeSFL_ModalClose">×</button>
-
- <h1>' . __('Edit File', 'ee-simple-file-list') . '</h1>
-
- <p class="eeSFL_ModalFileDetails">File ID: <span class="eeSFL_Modal_Manage_FileID">???</span> | ' .
- __('Added', 'ee-simple-file-list') . ': <span id="eeSFL_FileDateAdded" >???</span> | ' .
- __('Changed', 'ee-simple-file-list') . ': <span id="eeSFL_FileDateChanged" >???</span> | ' .
- __('Size', 'ee-simple-file-list') . ': <span id="eeSFL_FileSize">???</span>
+
+ <h1>' . __('Edit File', 'simple-file-list') . '</h1>
+
+ <p class="eeSFL_ModalFileDetails">File ID: <span class="eeSFL_Modal_Manage_FileID">???</span> | ' .
+ __('Added', 'simple-file-list') . ': <span id="eeSFL_FileDateAdded" >???</span> | ' .
+ __('Changed', 'simple-file-list') . ': <span id="eeSFL_FileDateChanged" >???</span> | ' .
+ __('Size', 'simple-file-list') . ': <span id="eeSFL_FileSize">???</span>
</p>
-
- <label for="eeSFL_FileNameNew">' . __('File Name', 'ee-simple-file-list') . '</label>
+
+ <label for="eeSFL_FileNameNew">' . __('File Name', 'simple-file-list') . '</label>
<input type="text" id="eeSFL_FileNameNew" name="eeSFL_FileNameNew" value="??" size="64" />
- <small class="eeSFL_ModalNote">' . __('Change the name.', 'ee-simple-file-list') . ' ' . __('Some characters are not allowed. These will be automatically replaced.', 'ee-simple-file-list') . '</small>';
-
- $eeOutput .= '<label for="eeSFL_FileNiceNameNew">' . __('File Nice Name', 'ee-simple-file-list') . '</label>
+ <small class="eeSFL_ModalNote">' . __('Change the name.', 'simple-file-list') . ' ' . __('Some characters are not allowed. These will be automatically replaced.', 'simple-file-list') . '</small>';
+
+ $eeOutput .= '<label for="eeSFL_FileNiceNameNew">' . __('File Nice Name', 'simple-file-list') . '</label>
<input type="text" id="eeSFL_FileNiceNameNew" name="eeSFL_FileNiceNameNew" value="" size="64" />
- <small class="eeSFL_ModalNote">' . __('Enter a name that will be shown in place of the real file name.', 'ee-simple-file-list') . ' ' . __('You may use special characters not allowed in the file name.', 'ee-simple-file-list') . '</small>';
-
- $eeOutput .= '<label for="eeSFL_FileDescriptionNew">' . __('File Description', 'ee-simple-file-list') . '</label>
+ <small class="eeSFL_ModalNote">' . __('Enter a name that will be shown in place of the real file name.', 'simple-file-list') . ' ' . __('You may use special characters not allowed in the file name.', 'simple-file-list') . '</small>';
+
+ $eeOutput .= '<label for="eeSFL_FileDescriptionNew">' . __('File Description', 'simple-file-list') . '</label>
<textarea cols="64" rows="3" id="eeSFL_FileDescriptionNew" name="eeSFL_FileDescriptionNew"></textarea>
- <small class="eeSFL_ModalNote">' . __('Add a description.', 'ee-simple-file-list') . ' ' . __('Use this field to describe this file and apply keywords for searching.', 'ee-simple-file-list') . '</small>
-
- <button class="button" onclick="eeSFL_FileEditSaved()">' . __('Save', 'ee-simple-file-list') . '</button>
+ <small class="eeSFL_ModalNote">' . __('Add a description.', 'simple-file-list') . ' ' . __('Use this field to describe this file and apply keywords for searching.', 'simple-file-list') . '</small>
+
+ <button class="button" onclick="eeSFL_FileEditSaved()">' . __('Save', 'simple-file-list') . '</button>
</div>
</div>';
}
-
+
$eeSFL_BASE->eeEnvironment['FileLists'] = ''; // Remove to clean up display
$eeMessages[] = $eeURL;
--- a/simple-file-list/ee-simple-file-list.php
+++ b/simple-file-list/ee-simple-file-list.php
@@ -8,10 +8,10 @@
Plugin URI: http://simplefilelist.com
Description: A Basic File List Manager with File Uploader
Author: Mitchell Bennis
-Version: 6.1.15
+Version: 6.1.16
Author URI: http://simplefilelist.com
License: GPLv2 or later
-Text Domain: ee-simple-file-list
+Text Domain: simple-file-list
Domain Path: /languages
*/
@@ -19,9 +19,9 @@
// CONSTANTS
define('eeSFL_BASE_DevMode', FALSE);
-define('eeSFL_BASE_Version', '6.1.15'); // Plugin version
+define('eeSFL_BASE_Version', '6.1.16'); // Plugin version
define('eeSFL_BASE_PluginName', 'Simple File List');
-define('eeSFL_BASE_PluginSlug', 'ee-simple-file-list');
+define('eeSFL_BASE_PluginSlug', 'simple-file-list');
define('eeSFL_BASE_PluginDir', 'simple-file-list');
define('eeSFL_BASE_FileListDefaultDir', 'simple-file-list/'); // Default Upload Directory
define('eeSFL_BASE_PluginMenuTitle', 'File List');
@@ -63,11 +63,6 @@
return $conflictingShortcodes;
}
-function eeSFL_BASE_Textdomain() {
- load_plugin_textdomain('ee-simple-file-list', false, basename(dirname(__FILE__)) . '/languages/');
-}
-add_action('init', 'eeSFL_BASE_Textdomain');
-
// Plugin Setup
function eeSFL_BASE_Setup() {
@@ -83,19 +78,19 @@
$eeProtocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';
$eeSFL_BASE_VarsForJS = array(
'ajaxurl' => admin_url( 'admin-ajax.php', $eeProtocol ),
- 'eeEditText' => __('Edit', 'ee-simple-file-list'), // Edit link text
- 'eeConfirmDeleteText' => __('Are you sure you want to delete this?', 'ee-simple-file-list'), // Delete confirmation
- 'eeCancelText' => __('Cancel', 'ee-simple-file-list'),
- 'eeCopyLinkText' => __('The Link Has Been Copied', 'ee-simple-file-list'),
- 'eeUploadLimitText' => __('Upload Limit', 'ee-simple-file-list'),
- 'eeFileTooLargeText' => __('This file is too large', 'ee-simple-file-list'),
- 'eeFileNotAllowedText' => __('This file type is not allowed', 'ee-simple-file-list'),
- 'eeUploadErrorText' => __('Upload Failed', 'ee-simple-file-list'),
- 'eeFilesSelected' => __('Files Selected', 'ee-simple-file-list'),
+ 'eeEditText' => __('Edit', 'simple-file-list'), // Edit link text
+ 'eeConfirmDeleteText' => __('Are you sure you want to delete this?', 'simple-file-list'), // Delete confirmation
+ 'eeCancelText' => __('Cancel', 'simple-file-list'),
+ 'eeCopyLinkText' => __('The Link Has Been Copied', 'simple-file-list'),
+ 'eeUploadLimitText' => __('Upload Limit', 'simple-file-list'),
+ 'eeFileTooLargeText' => __('This file is too large', 'simple-file-list'),
+ 'eeFileNotAllowedText' => __('This file type is not allowed', 'simple-file-list'),
+ 'eeUploadErrorText' => __('Upload Failed', 'simple-file-list'),
+ 'eeFilesSelected' => __('Files Selected', 'simple-file-list'),
// Back-End Only
- 'eeShowText' => __('Show', 'ee-simple-file-list'), // Shortcode Builder
- 'eeHideText' => __('Hide', 'ee-simple-file-list')
+ 'eeShowText' => __('Show', 'simple-file-list'), // Shortcode Builder
+ 'eeHideText' => __('Hide', 'simple-file-list')
);
// Get Class
@@ -164,10 +159,10 @@
} else {
- $eeERROR = '<strong>' . $eeSFL_Extension . ' ← ' . __('EXTENSION DISABLED', 'ee-simple-file-list') . '</strong><br />' .
- __('Please go to Plugins and update the extension to the latest version.', 'ee-simple-file-list');
+ $eeERROR = '<strong>' . $eeSFL_Extension . ' ← ' . __('EXTENSION DISABLED', 'simple-file-list') . '</strong><br />' .
+ __('Please go to Plugins and update the extension to the latest version.', 'simple-file-list');
- if( is_admin() AND @$_GET['page'] == 'ee-simple-file-list') {
+ if( is_admin() AND @$_GET['page'] == 'simple-file-list') {
$eeSFL_BASE->eeLog[eeSFL_BASE_Go]['errors'][] = $eeERROR;
}
}
@@ -420,7 +415,7 @@
$deps = array('jquery');
// wp_die($eeHook); // Check the hook
- $eeHooks = array('toplevel_page_ee-simple-file-list');
+ $eeHooks = array('toplevel_page_simple-file-list');
if(in_array($eeHook, $eeHooks)) {
@@ -549,7 +544,8 @@
if( strpos($eeFileName, '.') ) { // Gotta be a File - Looking for the dot rather than using is_file() for better speed
- if(unlink($eeFilePath)) {
+ $deleteResult = eeSFL_BASE_FileSystem('delete', array('file' => $eeFilePath));
+ if($deleteResult['success']) {
// Remove the item from the array
$eeAllFilesArray = get_option('eeSFL_FileList_1'); // Get the full list
@@ -572,11 +568,11 @@
return 'SUCCESS';
} else {
- return __('File Delete Failed', 'ee-simple-file-list') . ':' . $eeFileName;
+ return __('File Delete Failed', 'simple-file-list') . ':' . $eeFileName;
}
} else {
- return __('Item is Not a File', 'ee-simple-file-list') . ':' . $eeFileName;
+ return __('Item is Not a File', 'simple-file-list') . ':' . $eeFileName;
}
} elseif($eeFileAction == 'Edit') {
@@ -639,13 +635,15 @@
$eeOldFilePath = ABSPATH . $eeSFL_BASE->eeListSettings['FileListDir'] . $eeFileName;
$eeNewFilePath = ABSPATH . $eeSFL_BASE->eeListSettings['FileListDir'] . $eeFileNameNew;
- if(!is_file($eeOldFilePath)) {
- return __('File Not Found', 'ee-simple-file-list') . ': ' . basename($eeOldFilePath);
+ $fileCheck = eeSFL_BASE_FileSystem('is_file', array('file' => $eeOldFilePath));
+ if(!$fileCheck['data']) {
+ return __('File Not Found', 'simple-file-list') . ': ' . basename($eeOldFilePath);
}
- if( !rename($eeOldFilePath, $eeNewFilePath) ) {
+ $moveResult = eeSFL_BASE_FileSystem('move', array('from' => $eeOldFilePath, 'to' => $eeNewFilePath));
+ if( !$moveResult['success'] ) {
- return __('Could Not Change the Name', 'ee-simple-file-list') . ' ' . $eeOldFilePath . ' ' . __('to', 'ee-simple-file-list') . ' ' . $eeNewFilePath;
+ return __('Could Not Change the Name', 'simple-file-list') . ' ' . $eeOldFilePath . ' ' . __('to', 'simple-file-list') . ' ' . $eeNewFilePath;
} else {
@@ -658,7 +656,7 @@
$eeMessages[] = $eeSFL_BASE->eeListSettings['FileListDir'] . $eeFileNameNew;
} else {
- return __('Invalid New File Name', 'ee-simple-file-list');
+ return __('Invalid New File Name', 'simple-file-list');
}
}
@@ -684,8 +682,8 @@
function eeSFL_BASE_ActionPluginLinks( $links ) {
$eeLinks = array(
- '<a href="' . admin_url( 'admin.php?page=ee-simple-file-list' ) . '">' . __('Admin List', 'ee-simple-file-list') . '</a>',
- '<a href="' . admin_url( 'admin.php?page=ee-simple-file-list&tab=settings' ) . '">' . __('Settings', 'ee-simple-file-list') . '</a>'
+ '<a href="' . admin_url( 'admin.php?page=simple-file-list' ) . '">' . __('Admin List', 'simple-file-list') . '</a>',
+ '<a href="' . admin_url( 'admin.php?page=simple-file-list&tab=settings' ) . '">' . __('Settings', 'simple-file-list') . '</a>'
);
return array_merge( $links, $eeLinks );
}
@@ -700,13 +698,13 @@
global $eeSFL_BASE;
// Only include when accessing the plugin admin pages
- if( isset($_GET['page']) ) {
+ if( isset($_GET['page']) && $_GET['page'] == eeSFL_BASE_PluginSlug ) {
$eeOutput = '<!-- Simple File List Admin -->';
$eeSFL_BASE->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - Admin Menu Loading ...';
$eeSFL_Nonce = wp_create_nonce('eeInclude'); // Security
- include_once($eeSFL_BASE->eeEnvironment['pluginDir'] . 'ee-admin-page.php'); // Admin's List Management Page
+ include_once(plugin_dir_path(__FILE__) . 'ee-admin-page.php'); // Admin's List Management Page
}
@@ -737,8 +735,8 @@
// The Admin Menu
add_menu_page(
- __(eeSFL_BASE_PluginName, eeSFL_BASE_PluginSlug), // Page Title - Defined at the top of this file
- __(eeSFL_BASE_PluginMenuTitle, eeSFL_BASE_PluginSlug), // Menu Title
+ eeSFL_BASE_PluginName, // Page Title - Defined at the top of this file
+ eeSFL_BASE_PluginMenuTitle, // Menu Title
$eeCapability, // User status reguired to see the menu
eeSFL_BASE_PluginSlug, // Slug
'eeSFL_BASE_BackEnd', // Function that displays the menu page
--- a/simple-file-list/includes/ee-admin-footer.php
+++ b/simple-file-list/includes/ee-admin-footer.php
@@ -1,28 +1,28 @@
<?php
-
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! wp_verify_nonce( $eeSFL_Nonce, 'eeInclude' )) exit('ERROR 98'); // Exit if nonce fails
-
+
$eeOutput .= '
<footer class="eeClearFix">';
-
- $eeOutput .= '<p id="eeFooterImportant" class="eeHide">' . __('IMPORTANT: Allowing the public to upload files to your web server comes with risk.', 'ee-simple-file-list') . ' ' .
- __('Please go to Upload Settings and ensure that you only use the file types that you absolutely need.', 'ee-simple-file-list') . ' ' .
- __('Open each file submitted carefully.', 'ee-simple-file-list') . '</p>
-
- <a href="https://simplefilelist.com/documentation/" target="_blank">' . __('Plugin Documentation', 'ee-simple-file-list') . '</a>
- <a href="https://simplefilelist.com/?pr=free" target="_blank">' . __('Plugin Website', 'ee-simple-file-list') . '</a>
- <a href="https://simplefilelist.com/give-feedback/?pr=free" target="_blank">' . __('Give Feedback', 'ee-simple-file-list') . '</a>
- <a class="eeCaution" href="#" id="eeFooterImportantLink">' . __('Caution', 'ee-simple-file-list') . '</a>
-
+
+ $eeOutput .= '<p id="eeFooterImportant" class="eeHide">' . __('IMPORTANT: Allowing the public to upload files to your web server comes with risk.', 'simple-file-list') . ' ' .
+ __('Please go to Upload Settings and ensure that you only use the file types that you absolutely need.', 'simple-file-list') . ' ' .
+ __('Open each file submitted carefully.', 'simple-file-list') . '</p>
+
+ <a href="https://simplefilelist.com/documentation/" target="_blank">' . __('Plugin Documentation', 'simple-file-list') . '</a>
+ <a href="https://simplefilelist.com/?pr=free" target="_blank">' . __('Plugin Website', 'simple-file-list') . '</a>
+ <a href="https://simplefilelist.com/give-feedback/?pr=free" target="_blank">' . __('Give Feedback', 'simple-file-list') . '</a>
+ <a class="eeCaution" href="#" id="eeFooterImportantLink">' . __('Caution', 'simple-file-list') . '</a>
+
<br class="eeClear" />
-
- <p class="ee-plugin-version"><a href="https://wordpress.org/plugins/simple-file-list/">Simple File List ' . __('Version', 'ee-simple-file-list') . ' ' . eeSFL_BASE_Version . '</a>' .
+
+ <p class="ee-plugin-version"><a href="https://wordpress.org/plugins/simple-file-list/">Simple File List ' . __('Version', 'simple-file-list') . ' ' . eeSFL_BASE_Version . '</a>' .
' → <a href="https://get.simplefilelist.com/" target="_blank">Upgrade</a>';
-
+
$eeOutput .= '</p>
-
+
</footer>
</main><!-- END .eeSFL_Admin -->
</div><!-- END .wrap -->
--- a/simple-file-list/includes/ee-admin-header.php
+++ b/simple-file-list/includes/ee-admin-header.php
@@ -1,18 +1,18 @@
<?php
-
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! wp_verify_nonce( $eeSFL_Nonce, 'eeInclude' )) exit('ERROR 98'); // Exit if nonce fails
-
+
// Please Buy the Pro Version
$eeUpSell = '<div id="eeGoProBanner" class="eeClearFix">
-
-<a href="https://get.simplefilelist.com/index.php?eeExtension=ee-simple-file-list-pro&pr=free" class="button" target="_blank">' . __('Upgrade Now', 'ee-simple-file-list') . ' →</a>
+
+<a href="https://get.simplefilelist.com/index.php?eeExtension=ee-simple-file-list-pro&pr=free" class="button" target="_blank">' . __('Upgrade Now', 'simple-file-list') . ' →</a>
<small><a href="https://demo.simplefilelist.com/?pr=free" class="eeFloatRight" target="_blank">Try the Demo</a></small>
-
-<p><strong>' . __('Upgrade to Pro', 'ee-simple-file-list') . '</strong> - ' .
-__('Add sub-folder support, bulk file editing, directory location customization and add extensions for searching and more flexible user and role file restrictions.', 'ee-simple-file-list') . ' ' . __('The low cost is just once per domain. No recurring fees.', 'ee-simple-file-list') . '</p>
-
+
+<p><strong>' . __('Upgrade to Pro', 'simple-file-list') . '</strong> - ' .
+__('Add sub-folder support, bulk file editing, directory location customization and add extensions for searching and more flexible user and role file restrictions.', 'simple-file-list') . ' ' . __('The low cost is just once per domain. No recurring fees.', 'simple-file-list') . '</p>
+
</div>';
// Begin Output
@@ -21,39 +21,39 @@
<div class="wrap">
<main class="eeSFL_Admin">
-
+
<header class="eeClearFix">
-
+
<div class="eeShortCodeOps">
-
- <p>' . __('Place this shortcode on a page, post or widget.', 'ee-simple-file-list') . '<br />
-
- <label>Shortcode: <input type="text" name="eeSFL_ShortCode" value="[eeSFL]" id="eeSFL_ShortCode" size="8"></label> <button id="eeCopytoClipboard" class="button">' . __('Copy', 'ee-simple-file-list') . '</button></p>
-
+
+ <p>' . __('Place this shortcode on a page, post or widget.', 'simple-file-list') . '<br />
+
+ <label>Shortcode: <input type="text" name="eeSFL_ShortCode" value="[eeSFL]" id="eeSFL_ShortCode" size="8"></label> <button id="eeCopytoClipboard" class="button">' . __('Copy', 'simple-file-list') . '</button></p>
+
</div>
-
+
<div>
-
+
<a href="https://get.simplefilelist.com/index.php" target="_blank" />
- <img src="' . $eeSFL_BASE->eeEnvironment['pluginURL'] . '/images/icon-128x128.png" alt="Simple File List ' . __('Logo', 'ee-simple-file-list') . '" title="Simple File List" /></a>
-
+ <img src="' . $eeSFL_BASE->eeEnvironment['pluginURL'] . '/images/icon-128x128.png" alt="Simple File List ' . __('Logo', 'simple-file-list') . '" title="Simple File List" /></a>
+
</div>
-
+
<div>
<p class="heading">Simple File List</p>
- <p class="eeTagLine">' . __('Easy File Sharing for WordPress', 'ee-simple-file-list') . '</p>
- <p class="eeHeaderLinks">
+ <p class="eeTagLine">' . __('Easy File Sharing for WordPress', 'simple-file-list') . '</p>
+ <p class="eeHeaderLinks">
<a href="https://simplefilelist.com/" target="_blank">Website</a>
- <a href="https://simplefilelist.com/documentation/" target="_blank">' . __('Documentation', 'ee-simple-file-list') . '</a>
- <a href="https://simplefilelist.com/get-support/" target="_blank">' . __('Get Support', 'ee-simple-file-list') . '</a>
- <a href="https://get.simplefilelist.com/index.php" target="_blank">' . __('Upgrade to Pro', 'ee-simple-file-list') . '</a></p>
+ <a href="https://simplefilelist.com/documentation/" target="_blank">' . __('Documentation', 'simple-file-list') . '</a>
+ <a href="https://simplefilelist.com/get-support/" target="_blank">' . __('Get Support', 'simple-file-list') . '</a>
+ <a href="https://get.simplefilelist.com/index.php" target="_blank">' . __('Upgrade to Pro', 'simple-file-list') . '</a></p>
</div>
-
+
</header>
';
// User Messaging
$eeOutput .= $eeSFL_BASE->eeSFL_ResultsNotification();
-
+
?>
No newline at end of file
--- a/simple-file-list/includes/ee-class.php
+++ b/simple-file-list/includes/ee-class.php
@@ -1,46 +1,46 @@
<?php // Simple File List Script: ee-class.php | Author: Mitchell Bennis | support@simplefilelist.com
-
+
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
if ( ! wp_verify_nonce( $eeSFL_Nonce, 'eeSFL_Class' ) ) exit('ERROR 98'); // Exit if nonce fails
class eeSFL_BASE_MainClass {
-
+
public $eeListID = 1;
-
+
// File Types
public $eeDynamicImageThumbFormats = array('gif', 'jpg', 'jpeg', 'png', 'tif', 'tiff');
-
+
public $eeDynamicVideoThumbFormats = array('avi', 'flv', 'm4v', 'mov', 'mp4', 'webm', 'wmv');
-
- public $eeDefaultThumbFormats = array('3gp', 'ai', 'aif', 'aiff', 'apk', 'avi', 'bmp', 'cr2', 'dmg', 'doc', 'docx',
- 'eps', 'flv', 'gz', 'indd', 'iso', 'jpeg', 'jpg', 'm4v', 'mov', 'mp3', 'mp4', 'mpeg', 'mpg', 'pdf', 'png',
+
+ public $eeDefaultThumbFormats = array('3gp', 'ai', 'aif', 'aiff', 'apk', 'avi', 'bmp', 'cr2', 'dmg', 'doc', 'docx',
+ 'eps', 'flv', 'gz', 'indd', 'iso', 'jpeg', 'jpg', 'm4v', 'mov', 'mp3', 'mp4', 'mpeg', 'mpg', 'pdf', 'png',
'pps', 'ppsx', 'ppt', 'pptx', 'psd', 'tar', 'tgz', 'tif', 'tiff', 'txt', 'wav', 'wma', 'wmv', 'xls', 'xlsx', 'zip');
-
- public $eeOpenableFileFormats = array('aif', 'aiff', 'avi', 'bmp', 'flv', 'jpeg', 'jpg', 'gif', 'm4v', 'mov', 'mp3', 'mp4', 'mpeg', 'mpg', 'ogg', 'pdf', 'png',
+
+ public $eeOpenableFileFormats = array('aif', 'aiff', 'avi', 'bmp', 'flv', 'jpeg', 'jpg', 'gif', 'm4v', 'mov', 'mp3', 'mp4', 'mpeg', 'mpg', 'ogg', 'pdf', 'png',
'txt', 'wav', 'wma', 'wmv', 'htm', 'html');
-
+
public $eeExcludedFileNames = array('error_log', 'index.html');
-
+
public $eeForbiddenTypes = array('php','phar','pl','py','com','cgi','asp','exe','js','phtml', 'wsh','vbs');
-
+
// private $eeExcludedFiles = array('index.html');
-
- public $eeNotifyMessageDefault = 'Greetings,' . PHP_EOL . PHP_EOL .
- 'You should know that a file has been uploaded to your website.' . PHP_EOL . PHP_EOL .
-
- '[file-list]' . PHP_EOL . PHP_EOL .
-
- 'File List: [web-page]' . PHP_EOL . PHP_EOL;
-
+
+ public $eeNotifyMessageDefault = 'Greetings,' . PHP_EOL . PHP_EOL .
+ 'You should know that a file has been uploaded to your website.' . PHP_EOL . PHP_EOL .
+
+ '[file-list]' . PHP_EOL . PHP_EOL .
+
+ 'File List: [web-page]' . PHP_EOL . PHP_EOL;
+
// Default Vaules
public $eeDefaultUploadLimit = 99;
public $eeFileThumbSize = 256;
public $eeListRun = 1; // Count of lists per page
public $eeUploadFormRun = FALSE; // Check if uploader form has run or not
-
+
// The Log - Written to wp_option -> eeSFL-Log
public $eeLog = array(eeSFL_BASE_Go => array(
-
+
'Log' => '0.000s | 0 MB Simple File List is Loading...',
'Version' => 'SFL FREE: ' . eeSFL_BASE_Version,
'errors' => array(),
@@ -48,11 +48,11 @@
'messages' => array(),
'notice' => array()
));
-
-
+
+
// Settings for the Current List
public $eeListSettings = array();
-
+
// The Default List Definition
public $DefaultListSettings = array( // An array of file list settings
@@ -76,7 +76,7 @@
'LabelOwner' => 'Submitter', // Label for the file owner
'SortBy' => 'Name', // Sort By (Name, Date, DateChanged, Size, Random) -- DateChanged added in 4.3
'SortOrder' => 'Ascending', // Descending or Ascending
-
+
// Display Settings
'GenerateImgThumbs' => 'YES', // Create thumbnail images for images if possible.
'GeneratePDFThumbs' => 'YES', // Create thumbnail images for PDFs if possible.
@@ -93,7 +93,7 @@
'ShowSubmitterInfo' => 'NO', // Show who uploaded the file (name linked to their email)
'AllowFrontManage' => 'NO', // Allow front-side users to manage files (YES or NO)
'SmoothScroll' => 'YES', // Use the awesome and cool JavaScript smooth scroller after an upload
-
+
// Upload Settings
'AllowUploads' => 'USER', // Allow File Uploads (YES, ADMIN, USER, NO)
'UploadLimit' => 10, // Limit Files Per Upload Job (Quantity)
@@ -104,7 +104,7 @@
'UploadPosition' => 'Above', // Above or Below the list
'GetUploaderDesc' => 'NO', // Show the Description Form
'GetUploaderInfo' => 'NO', // Show the User Info Form
-
+
// Notifications
'Notify' => 'NO', // Send Notifications (YES or NO)
'NotifyTo' => '', // Send Notification Email Here (Defaults to WP Admin Email)
@@ -114,132 +114,132 @@
'NotifyFromName' => 'Simple File List', // The nice name of the sender
'NotifySubject' => 'File Upload Notice', // The subject line
'NotifyMessage' => '', // The notice message's body
-
+
);
-
-
+
+
// Get the WordPress Root Directory
public function eeSFL_GetRootPath() {
-
+
// Get the upload directory path
$eeUploadDir = wp_upload_dir();
$eeUploadPath = $eeUploadDir['basedir'];
-
+
// Navigate up the directory tree until we find the root directory
while ( ! file_exists( $eeUploadPath . '/wp-config.php' ) ) {
$eeUploadPath = dirname( $eeUploadPath );
}
-
+
// Define the root directory path
$eeRootPath = $eeUploadPath . '/';
-
+
// Return the root directory path
return $eeRootPath;
}
-
-
-
+
+
+
// Get Settings for Specified List
public function eeSFL_GetSettings($eeListID) {
-
+
if(is_numeric($eeListID)) {
// Getting the settings array
$this->eeListSettings = get_option('eeSFL_Settings_' . $eeListID);
-
+
if(!is_array($this->eeListSettings)) {
-
+
$this->eeLog[eeSFL_BASE_Go]['warnings'][] = 'No Settings Found. Restoring the defaults ...';
update_option('eeSFL_Settings_' . $this->eeListID, $this->eeDefaultListSettings); // The settings are gone, so reset to defaults.
$this->eeListSettings = $this->eeDefaultListSettings;
}
-
+
$this->eeListSettings['FileListURL'] = $this->eeEnvironment['wpSiteURL'] . $this->eeListSettings['FileListDir']; // The Full URL
-
+
ksort($this->eeListSettings);
-
+
return $this->eeListSettings;
-
+
} else {
-
+
$this->eeListSettings = array();
}
}
-
-
-
+
+
+
// Environment Details
- public $eeEnvironment = array();
-
+ public $eeEnvironment = array();
+
// Get Environment
public function eeSFL_GetEnv() {
-
+
global $eeSFLU_BASE;
-
+
$eeEnv = array();
-
+
// Detect OS
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$eeEnv['eeOS'] = 'WINDOWS';
} else {
$eeEnv['eeOS'] = 'LINUX';
}
-
+
// Detect Web Server
if(!function_exists('apache_get_version')) {
$eeEnv['eeWebServer'] = $_SERVER["SERVER_SOFTWARE"];
} else {
$eeEnv['eeWebServer'] = 'Apache';
}
-
+
$eeEnv['wpSiteURL'] = get_option('siteurl') . '/'; // This Wordpress Website
$eeEnv['wpPluginsURL'] = plugins_url() . '/'; // The Wordpress Plugins Location
-
+
$eeEnv['pluginURL'] = plugins_url() . '/' . eeSFL_BASE_PluginDir . '/';
$eeEnv['pluginDir'] = WP_PLUGIN_DIR . '/' . eeSFL_BASE_PluginDir . '/';
-
+
$wpUploadArray = wp_upload_dir();
$wpUploadDir = $wpUploadArray['basedir'];
$eeEnv['wpUploadDir'] = $wpUploadDir . '/'; // The Wordpress Uploads Location
$eeEnv['wpUploadURL'] = $wpUploadArray['baseurl'] . '/';
$eeEnv['FileListDefaultDir'] = str_replace(ABSPATH, '', $eeEnv['wpUploadDir'] . eeSFL_BASE_FileListDefaultDir); // The default file list location
-
+
$eeEnv['php_version'] = phpversion(); // PHP Version
-
+
$eeEnv['php_max_execution_time'] = ini_get('max_execution_time');
-
+
$eeEnv['php_memory_limit'] = ini_get('memory_limit');
-
+
$eeEnv['the_max_upload_size'] = $eeSFLU_BASE->eeSFL_ActualUploadMax();
-
+
$eeEnv['supported'] = get_option('eeSFL_Supported'); // Server technologies available (i.e. FFMPEG)
-
+
$eeEnv['wpUserID'] = get_current_user_id();
-
+
// Check Server technologies available (i.e. ffMpeg)
$eeSupported = get_option('eeSFL_Supported');
-
+
if(is_array($eeSupported)) {
-
- if( in_array('ImageMagick', $eeSupported) AND in_array('GhostScript', $eeSupported) ) {
+
+ if( in_array('ImageMagick', $eeSupported) AND in_array('GhostScript', $eeSupported) ) {
$eeEnv['ImkGs'] = 'YES';
}
if( in_array('ffMpeg', $eeSupported) ) {
$eeEnv['ffMpeg'] = 'YES';
}
}
-
+
ksort($eeEnv);
-
+
$this->eeEnvironment = $eeEnv;
}
-
-
- public $eeAllFiles = array();
+
+
+ public $eeAllFiles = array();
public $eeDisplayFiles = array();
-
+
public $eeIsFile = FALSE;
public $eeFilePath = FALSE;
public $eeFileURL = FALSE;
@@ -259,11 +259,11 @@
public $eeFileSubmitterName = FALSE;
public $eeFileSubmitterComments = FALSE;
public $eeFileCount = 0;
-
-
+
+
// Default File List Definition
public $eeFileTemplate = array(
-
+
0 => array( // The File ID (We copy this to the array on-the-fly when sorting)
// 'FileList' => 1, // The ID of the File List, contained in the above array.
'FilePath' => '', // Path to file, relative to the list root
@@ -280,92 +280,92 @@
'SubmitterComments' => '', // What they said
)
);
-
-
-
-
+
+
+
+
public function eeSFL_ReturnFileActions($eeFileID) {;
-
+
$eeAdmin = is_admin();
-
+
$eeOutput = '
-
+
<small class="eeSFL_ListFileActions">';
-
+
// Open Action
if($eeAdmin OR $this->eeListSettings['ShowFileOpen'] == 'YES') {
-
+
if(in_array($this->eeFileExt, $this->eeOpenableFileFormats)) {
$eeOutput .= '
- <a class="eeSFL_FileOpen" href="' . $this->eeFileURL . '" target="_blank">' . __('Open', 'ee-simple-file-list') . '</a>';
+ <a class="eeSFL_FileOpen" href="' . $this->eeFileURL . '" target="_blank">' . __('Open', 'simple-file-list') . '</a>';
}
}
-
+
// Download Action
if($eeAdmin OR $this->eeListSettings['ShowFileDownload'] == 'YES') {
-
+
$eeOutput .= '
- <a class="eeSFL_FileDownload" href="' . $this->eeFileURL . '" download="' . basename($this->eeFileURL) . '">' . __('Download', 'ee-simple-file-list') . '</a>';
-
+ <a class="eeSFL_FileDownload" href="' . $this->eeFileURL . '" download="' . basename($this->eeFileURL) . '">' . __('Download', 'simple-file-list') . '</a>';
+
}
-
+
// Copy Link Action
if($eeAdmin OR $this->eeListSettings['ShowFileCopyLink'] == 'YES') {
-
+
$eeOutput .= '
- <a class="eeSFL_CopyLinkToClipboard" onclick="eeSFL_CopyLinkToClipboard('' . $this->eeFileURL . '')" href="#">' . __('Copy Link', 'ee-simple-file-list') . '</a>';
-
+ <a class="eeSFL_CopyLinkToClipboard" onclick="eeSFL_CopyLinkToClipboard('' . $this->eeFileURL . '')" href="#">' . __('Copy Link', 'simple-file-list') . '</a>';
+
}
-
+
// Front-End Manage or Admin
- if( ($eeAdmin OR $this->eeListSettings['AllowFrontManage'] == 'YES') AND $this->eeListRun == 1) {
-
+ if( ($eeAdmin OR $this->eeListSettings['AllowFrontManage'] == 'YES') AND $this->eeListRun == 1) {
+
// <span class="eeSFL_FileManageLinks">
-
+
$eeOutput .= '
- <a href="#" onclick="eeSFL_OpenEditModal(' . $eeFileID . ')">' . __('Edit', 'ee-simple-file-list') . '</a>
- <a href="#" onclick="eeSFL_DeleteFile(' . $eeFileID . ')">' . __('Delete', 'ee-simple-file-list') . '</a>';
-
+ <a href="#" onclick="eeSFL_OpenEditModal(' . $eeFileID . ')">' . __('Edit', 'simple-file-list') . '</a>
+ <a href="#" onclick="eeSFL_DeleteFile(' . $eeFileID . ')">' . __('Delete', 'simple-file-list') . '</a>';
+
if($eeAdmin) {
-
+
$eeOutput .= '
- <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Move', 'ee-simple-file-list') . '</a>
- <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Users', 'ee-simple-file-list') . '</a>
- <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Send', 'ee-simple-file-list') . '</a>';
+ <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Move', 'simple-file-list') . '</a>
+ <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Users', 'simple-file-list') . '</a>
+ <a class="eeDisabledAction" href="' . admin_url() . 'admin.php?page=ee-simple-file-list&tab=pro" >' . __('Send', 'simple-file-list') . '</a>';
}
-
+
// $eeOutput .= '<span>';
-
+
}
-
+
$eeOutput .= '
-
+
</small>'; // Close File List Actions Links
-
+
// File Details to Pass to the Editor
$eeOutput .= '
-
+
<span class="eeHide eeSFL_FileSize">' . $this->eeFileSize . '</span>
<span class="eeHide eeSFL_FileDateAdded">' . $this->eeFileDateAdded . '</span>
<span class="eeHide eeSFL_FileDateChanged">' . $this->eeFileDateChanged . '</span>';
-
+
return $eeOutput;
-
+
}
-
-
-
+
+
+
public function eeSFL_ProcessFileArray($eeFileArray, $eeHideName = FALSE, $eeHideType = FALSE) {
-
+
if( is_admin() ) { $eeAdmin = TRUE; } else { $eeAdmin = FALSE; }
-
+
if( is_array($eeFileArray) ) {
-
+
// Deny Folder Listing
if(strpos($eeFileArray['FilePath'], '/')) { return FALSE; }
// Assign values to our properties
-
+
// The File Name
$this->eeFilePath = $eeFileArray['FilePath']; // Path relative to FileListDir
$this->eeFileName = basename($eeFileArray['FilePath']); // This name might change
@@ -378,7 +378,7 @@
} else {
$this->eeFileMIME = 'no/mime';
}
-
+
// Reset These
$this->eeFileNiceName = FALSE;
$this->eeFileDescription = FALSE;
@@ -387,10 +387,10 @@
$this->eeFileSubmitterEmail = FALSE;
$this->eeFileSubmitterName = FALSE;
$this->eeFileSubmitterComments = FALSE;
-
+
// Must Be a File
if(strpos($this->eeFilePath, '.')) { // Skip folders and hidden files
-
+
// Skip names hidden via shortcode
if($eeHideName) { // Expecting a comma deleimited string of file names
$eeArray = explode(',', $eeHideName);
@@ -399,29 +399,29 @@
if($eeValue == strtolower($this->eeFileName)) { return FALSE; } // With extension
}
}
-
+
// Skip types hidden via shortcode
if($eeHideType) { // Expecting a comma deleimited string of extensions
- if(strpos($eeHideType, $this->eeFileExt) OR strpos($eeHideType, $this->eeFileExt) === 0 ) {
+ if(strpos($eeHideType, $this->eeFileExt) OR strpos($eeHideType, $this->eeFileExt) === 0 ) {
return FALSE;
}
}
-
+
$this->eeIsFile = TRUE;
-
+
// Thumbnail
$eeThumbSet = FALSE;
$eeHasCreatedThumb = FALSE;
if( in_array($this->eeFileExt, $this->eeDynamicImageThumbFormats) AND $this->eeListSettings['GenerateImgThumbs'] == 'YES' ) { $eeHasCreatedThumb = TRUE; }
if( in_array($this->eeFileExt, $this->eeDynamicVideoThumbFormats) AND isset($this->eeEnvironment['ffMpeg']) AND $this->eeListSettings['GenerateVideoThumbs'] == 'YES' ) { $eeHasCreatedThumb = TRUE; }
if( $this->eeFileExt == 'pdf' AND isset($this->eeEnvironment['ImkGs']) AND $this->eeListSettings['GeneratePDFThumbs'] == 'YES' ) { $eeHasCreatedThumb = TRUE; }
-
+
if($eeHasCreatedThumb) { // Images use .jpg files
-
+
$eePathParts = pathinfo($this->eeFilePath);
-
+
$eeFileThumbPath = ABSPATH . $this->eeListSettings['FileListDir'] . '.thumbnails/thumb_' . $eePathParts['filename'] . '.jpg';
-
+
if( is_readable($eeFileThumbPath) ) {
$eeFileThumbURL = $this->eeListSettings['FileListURL'];
if($eePathParts['dirname']) { $eeFileThumbURL .= $eePathParts['dirname'] . '/'; }
@@ -429,18 +429,18 @@
$eeThumbSet = TRUE;
}
}
-
+
if(!$eeThumbSet) {
-
+
// Use our awesome .svg files
- if( !in_array($this->eeFileExt, $this->eeDefaultThumbFormats) ) { $eeDefaultThumb = '!default.svg'; } // What the heck is this?
+ if( !in_array($this->eeFileExt, $this->eeDefaultThumbFormats) ) { $eeDefaultThumb = 'default.svg'; } // What the heck is this?
else { $eeDefaultThumb = $this->eeFileExt . '.svg'; } // Use our sweet icon
-
+
$this->eeFileThumbURL = $this->eeEnvironment['pluginURL'] . 'images/thumbnails/' . $eeDefaultThumb;
-
+
}
-
-
+
+
// File Nice Name
if( isset($eeFileArray['FileNiceName']) ) {
if( strlen($eeFileArray['FileNiceName']) >= 1 ) {
@@ -448,37 +448,37 @@
$this->eeFileName = $eeFileArray['FileNiceName'];
}
}
-
+
if($this->eeFileNiceName === FALSE) {
-
+
// Strip the Extension?
if(!$eeAdmin AND $this->eeListSettings['ShowFileExtension'] == 'NO') {
$eePathParts = pathinfo($this->eeRealFileName);
$this->eeFileName = $eePathParts['filename'];
}
-
+
// LEGACY - Replace hyphens with spaces?
if(isset($this->eeListSettings['PreserveSpaces'])) {
if(!$eeAdmin AND $this->eeListSettings['PreserveSpaces'] == 'YES') {
- $this->eeFileName = eeSFL_BASE_PreserveSpaces($this->eeRealFileName);
+ $this->eeFileName = eeSFL_BASE_PreserveSpaces($this->eeRealFileName);
}
}
}
-
+
if( isset($eeFileArray['FileDescription']) ) {
$this->eeFileDescription = $eeFileArray['FileDescription'];
}
-
+
// File Description
- if( isset($eeFileArray['SubmitterComments']) ) {
+ if( isset($eeFileArray['SubmitterComments']) ) {
if(!$this->eeFileDescription) {
$this->eeFileDescription = $eeFileArray['SubmitterComments']; // Show the submitter comment if no desc
$this->eeFileSubmitterComments = $eeFileArray['SubmitterComments']; // Use on back-end
}
}
-
-
-
+
+
+
// File Dates and the Display Date
if($this->eeListSettings['ShowFileDateAs'] == 'Changed') {
$this->eeFileDateChanged = date_i18n( get_option('date_format'), strtotime( $eeFileArray['FileDateChanged'] ) ); // The mod date
@@ -487,11 +487,11 @@
$this->eeFileDateAdded = date_i18n( get_option('date_format'), strtotime( $eeFileArray['FileDateAdded'] ) );
$this->eeFileDate = $this->eeFileDateAdded;
}
-
-
-
+
+
+
// Submitter Info
- if( isset($eeFileArray['FileOwner']) ) {
+ if( isset($eeFileArray['FileOwner']) ) {
if(is_numeric($eeFileArray['FileOwner'])) {
$this->eeFileOwner = $eeFileArray['FileOwner']; // The User ID
$wpUserData = get_userdata($this->eeFileOwner);
@@ -500,178 +500,178 @@
$this->eeFileSubmitterName = $wpUserData->first_name . ' ' . $wpUserData->last_name;
}
}
-
+
} elseif(isset($eeFileArray['SubmitterName'])) {
-
+
$this->eeFileSubmitterName = $eeFileArray['SubmitterName'];
$this->eeFileSubmitterEmail = $eeFileArray['SubmitterEmail'];
-
+
}
-
+
$this->eeFileCount++; // Bump the file count
-
+
} else {
return FALSE; // Not an item we want to display
}
}
-
+
$eeMessages = array($eeFileArray);
do_action('eeSFL_Hook_Listed', $eeMessages);
-
+
return TRUE;
}
-
-
-
+
+
+
// Build a New File/Folder Array (for an upload or new file found)
public function eeSFL_BuildFileArray($eeFilePath) { // Path relative to ABSPATH
-
+
$eePathParts = pathinfo($eeFilePath);
-
+
if( is_readable(ABSPATH . $this->eeListSettings['FileListDir'] . $eeFilePath) ) {
-
+
$eeFileArray = $this->eeFileTemplate[0]; // Get the file array template
$eeFileArray['FilePath'] = $eeFilePath; // Path to file, relative to the list root
-
+
if(isset($eePathParts['extension'])) { $eeExt = strtolower($eePathParts['extension']); } else { $eeExt = 'folder'; }
- $eeFileArray['FileExt'] = $eeExt; // The file extension
-
+ $eeFileArray['FileExt'] = $eeExt; // The file extension
+
if(function_exists('mime_content_type')) {
$eeFileArray['FileMIME'] = mime_content_type(ABSPATH . $this->eeListSettings['FileListDir'] . $eeFilePath); // MIME Type
} else {
$eeFileArray['FileMIME'] = 'no/mime';
}
-
+
$eeFileArray['FileSize'] = filesize(ABSPATH . $this->eeListSettings['FileListDir'] . $eeFilePath);
-
+
$eeFileArray['FileDateAdded'] = date("Y-m-d H:i:s");
$eeFileArray['FileDateChanged'] = date("Y-m-d H:i:s", filemtime(ABSPATH . $this->eeListSettings['FileListDir'] . $eeFilePath));
-
+
if( strlen($eeFileArray['FilePath']) ) { // 02/21 - If FilePath is empty, sort doesn't work? But why would that be empty.
return $eeFileArray;
}
-
+
}
-
+
return FALSE;
}
-
-
-
+
+
+
public function eeSFL_UpdateFileDetail($eeFile, $eeDetail, $eeValue = FALSE) {
-
+
if($eeValue !== FALSE) {
-
+
// Get the current file array
$eeFileArray = get_option('eeSFL_FileList_1');
-
+
foreach( $eeFileArray as $eeKey => $eeThisFileArray ) {
-
+
if($eeFile == $eeThisFileArray['FilePath']) { // Look for this file
-
+
$eeFileArray[$eeKey][$eeDetail] = $eeValue;
}
}
-
+
// Save the updated array
$eeFileArray = update_option('eeSFL_FileList_1', $eeFileArray);
-
+
return $eeFileArray;
-
+
} else {
return FALSE;
}
}
-
-
-
-
-
+
+
+
+
+
// Scan the real files and create or update array as needed.
public function eeSFL_UpdateFileListArray() {
-
+
global $eeSFLU_BASE;
$eeMessages = array('Scanning the File List');
-
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - Re-Indexing the File List ...';
-
+
if(empty($this->eeListSettings)) {
$this->eeListSettings = get_option('eeSFL_Settings_1');
}
-
+
// Double-check the Disk Directory
if( !eeSFL_BASE_FileListDirCheck($this->eeListSettings['FileListDir']) ) { return FALSE; }
-
+
// Get the File List Array
$this->eeAllFiles = get_option('eeSFL_FileList_1');
if(!is_array($this->eeAllFiles)) { $this->eeAllFiles = array(); $eeMessages[] = 'No File Array Found in the Database'; }
-
+
$this->eeSFL_IndexFileListDir();
-
+
if(empty($this->eeSFL_FileScanArray)) {
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - No Files Found';
update_option('eeSFL_FileList_1', array() ); // There are no files, so clear the file array
$eeMessages[] = 'No Files Found in ' . $this->eeListSettings['FileListDir'];
- return FALSE; // Quit and leave DB alone
+ return FALSE; // Quit and leave DB alone
}
-
+
// No List in the DB, Creating New...
- if( empty($this->eeAllFiles) ) {
-
+ if( empty($this->eeAllFiles) ) {
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - No List Found! Creating from scratch...';
-
+
foreach( $this->eeSFL_FileScanArray as $eeKey => $eeFilePath) {
-
+
// Add the new item
$eeNewArray = $this->eeSFL_BuildFileArray($eeFilePath); // Path relative to FileListDir
-
+
if( isset($eeNewArray['FilePath']) ) {
-
+
if( isset($this->eeSanitizedFiles[$eeFilePath]) ) {
$eeNewArray['FileNiceName'] = basename($this->eeSanitizedFiles[$eeFilePath]);
}
-
+
$this->eeAllFiles[] = $eeNewArray;
}
}
-
-
+
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - ' . count($this->eeSFL_FileScanArray) . ' Items Added';
-
+
// echo '<pre>'; print_r($this->eeSFL_FileScanArray); echo '</pre>';
// echo '<pre>'; print_r($this->eeSanitizedFiles); echo '</pre>';
// echo '<pre>'; print_r($this->eeAllFiles); echo '</pre>';
// echo '<pre>'; print_r($this->eeLog); echo '</pre>'; exit;
-
-
+
+
} else { // Update file info
-
+
// Check to be sure each file is there...
foreach( $this->eeAllFiles as $eeKey => $eeFileSet) {
-
+
if( isset($eeFileSet['FilePath']) ) {
-
+
// Build full path
$eeFile = ABSPATH . $this->eeListSettings['FileListDir'] . $eeFileSet['FilePath'];
-
+
if( is_file($eeFile) ) { // Update file size
-
+
// Update file size
$this->eeAllFiles[$eeKey]['FileSize'] = filesize($eeFile);
-
+
} else { // Get rid of it
-
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - Removing: ' . $eeFile;
-
+
unset($this->eeAllFiles[$eeKey]);
-
+
// Custom Hook
array_unshift($eeFileSet, 'File Not Found');
do_action('eeSFL_Hook_Removed', $eeFileSet);
-
+
continue;
}
-
+
// MIME Type
if(!isset($this->eeAllFiles[$eeKey]['FileMIME'])) {
if(function_exists('mime_content_type')) {
@@ -680,271 +680,275 @@
$this->eeAllFiles[$eeKey]['FileMIME'] = 'no/mime';
}
}
-
+
// Update modification date
$this->eeAllFiles[$eeKey]['FileDateChanged'] = date("Y-m-d H:i:s", @filemtime($eeFile));
-
+
// Merge-in Default File Attributes
$this->eeAllFiles[$eeKey] = array_merge($this->eeFileTemplate[0], $this->eeAllFiles[$eeKey]);
-
+
} else {
unset($this->eeAllFiles[$eeKey]); // If no FilePath, get rid of it.
}
}
-
-
+
+
if(count($this->eeSFL_FileScanArray)) {
-
+
// Check if any new files have been added
foreach( $this->eeSFL_FileScanArray as $eeKey => $eeFile ) {
-
+
$eeFound = FALSE;
-
+
// Look for this file in our array
foreach( $this->eeAllFiles as $eeKey2 => $eeFileArray ) {
-
+
if($eeFile == $eeFileArray['FilePath']) { $eeFound = TRUE; break; } // Found this file, on to the next.
}
-
+
if($eeFound === FALSE) { // New Item Found
-
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' - New Item Found: ' . $eeFile;
-
+
// Build a new file array
$eeNewArray = $this->eeSFL_BuildFileArray($eeFile); // Path relative to FileListDir
-
+
if( isset($eeNewArray['FilePath']) ) {
-
+
if( isset($this->eeSanitizedFiles[$eeFile]) ) {
$eeNewArray['FileNiceName'] = basename($this->eeSanitizedFiles[$eeFile]);
}
-
+
$this->eeAllFiles[] = $eeNewArray;
-
+
// Custom Hook
array_unshift($eeNewArray, 'New File Found');
do_action('eeSFL_Hook_Added', $eeNewArray);
}
-
+
}
}
}
}
-
-
+
+
// Finish Up
if(!empty($this->eeAllFiles)) {
-
+
// echo '<pre>'; print_r($this->eeAllFiles); echo '</pre>'; exit;
-
+
$this->eeLog[eeSFL_BASE_Go]['notice'][] = eeSFL_BASE_noticeTimer() . ' -