From 1dbe7c5339ad955fcb08d01d256f591a3c83d713 Mon Sep 17 00:00:00 2001 From: Prasath Mani Date: Sun, 24 May 2020 14:00:27 +0530 Subject: [PATCH] dark mode #352 Request: Dark mode option in the admin section. #260 --- h3k_config.php => config.php | 29 ++++++-- tinyfilemanager.php | 134 ++++++++++++++++++++--------------- translation.json | 2 +- user_config.php | 100 -------------------------- 4 files changed, 101 insertions(+), 164 deletions(-) rename h3k_config.php => config.php (89%) delete mode 100644 user_config.php diff --git a/h3k_config.php b/config.php similarity index 89% rename from h3k_config.php rename to config.php index a00f5ca..3e6ecbf 100644 --- a/h3k_config.php +++ b/config.php @@ -5,9 +5,9 @@ This is an OPTIONAL configuration file. The role of this file is to make updating of "tinyfilemanager.php" easier. So you can: --Feel free to remove completely this file and configure "tinifilemanager.php" as a single file application. +-Feel free to remove completely this file and configure "tinyfilemanager.php" as a single file application. or --Put inside this file all the static configuration you want and forgot to configure "tinifilemanager.php". +-Put inside this file all the static configuration you want and forgot to configure "tinyfilemanager.php". ################################################################################################################# */ @@ -16,6 +16,12 @@ or // Is independent from IP white- and blacklisting $use_auth = true; + +// Auth with login/password +// set true/false to enable/disable it +// Is independent from IP white- and blacklisting +$use_auth = true; + // Login user name and password // Users: array('Username' => 'Password', 'Username2' => 'Password2', ...) // Generate secure password hash - https://tinyfilemanager.github.io/docs/pwd.html @@ -24,20 +30,21 @@ $auth_users = array( 'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345 ); -// Readonly users +//set application theme +//options - 'light' and 'dark' +$theme = 'light'; + +// Readonly users // e.g. array('users', 'guest', ...) $readonly_users = array( 'user' ); -// user specific directories -// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) -$directories_users = array(); - // Enable highlight.js (https://highlightjs.org/) on view's page $use_highlightjs = true; // highlight.js style +// for dark theme use 'ir-black' $highlightjs_style = 'vs'; // Enable ace.js (https://ace.c9.io/) on view's page @@ -58,6 +65,10 @@ $root_url = ''; // Server hostname. Can set manually if wrong $http_host = $_SERVER['HTTP_HOST']; +// user specific directories +// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) +$directories_users = array(); + // input encoding for iconv $iconv_input_encoding = 'UTF-8'; @@ -94,6 +105,10 @@ $online_viewer = 'google'; // false => disable sticky header $sticky_navbar = true; + +// max upload file size +$max_upload_size_bytes = 2048; + // Possible rules are 'OFF', 'AND' or 'OR' // OFF => Don't check connection IP, defaults to OFF // AND => Connection must be on the whitelist, and not on the blacklist diff --git a/tinyfilemanager.php b/tinyfilemanager.php index 3229e87..40bac98 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -3,20 +3,19 @@ $CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}'; /** - * H3K | Tiny File Manager V2.4.2 + * H3K | Tiny File Manager V2.4.3 * CCP Programmers | ccpprogrammers@gmail.com * https://tinyfilemanager.github.io */ //TFM version -define('VERSION', '2.4.2'); +define('VERSION', '2.4.3'); //Application Title define('APP_TITLE', 'Tiny File Manager'); // --- EDIT BELOW CONFIGURATION CAREFULLY --- - // Auth with login/password // set true/false to enable/disable it // Is independent from IP white- and blacklisting @@ -30,20 +29,21 @@ $auth_users = array( 'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345 ); +//set application theme +//options - 'light' and 'dark' +$theme = 'light'; + // Readonly users // e.g. array('users', 'guest', ...) $readonly_users = array( 'user' ); -// user specific directories -// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) -$directories_users = array(); - // Enable highlight.js (https://highlightjs.org/) on view's page $use_highlightjs = true; // highlight.js style +// for dark theme use 'ir-black' $highlightjs_style = 'vs'; // Enable ace.js (https://ace.c9.io/) on view's page @@ -64,6 +64,10 @@ $root_url = ''; // Server hostname. Can set manually if wrong $http_host = $_SERVER['HTTP_HOST']; +// user specific directories +// array('Username' => 'Directory path', 'Username2' => 'Directory path', ...) +$directories_users = array(); + // input encoding for iconv $iconv_input_encoding = 'UTF-8'; @@ -100,21 +104,10 @@ $online_viewer = 'google'; // false => disable sticky header $sticky_navbar = true; - -// max upload file size -$max_upload_size_bytes = 2048; - -// if User has the customized config file, try to use it to override the default config above -$user_config_file_path = 'user_config.php'; -if(file_exists($user_config_file_path)) { - include($user_config_file_path); -} - // Maximum file upload size // Increase the following values in php.ini to work properly // memory_limit, upload_max_filesize, post_max_size -define('MAX_UPLOAD_SIZE', '2048'); - +$max_upload_size_bytes = 2048; // Possible rules are 'OFF', 'AND' or 'OR' // OFF => Don't check connection IP, defaults to OFF @@ -137,17 +130,19 @@ $ip_blacklist = array( '::' // non-routable meta ipv6 ); -// Load configuration file, if present -$config_file = 'h3k_config.php'; +// if User has the customized config file, try to use it to override the default config above +$config_file = 'config.php'; if (is_readable($config_file)) { - include($config_file); + @include($config_file); } // --- EDIT BELOW CAREFULLY OR DO NOT EDIT AT ALL --- -// Set the max upload file size +// max upload file size define('MAX_UPLOAD_SIZE', $max_upload_size_bytes); +define('FM_THEME', $theme); + // private key and session name to store to the session if ( !defined( 'FM_SESSION_ID')) { define('FM_SESSION_ID', 'filemanager'); @@ -168,7 +163,7 @@ $report_errors = isset($cfg->data['error_reporting']) ? $cfg->data['error_report // Hide Permissions and Owner cols in file-listing $hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true; -// Show Dirsize: true or speedup output: false +// Show directory size: true or speedup output: false $calc_folder = isset($cfg->data['calc_folder']) ? $cfg->data['calc_folder'] : true; //available languages @@ -308,7 +303,7 @@ if ($use_auth) {
-
+