mirror of
https://github.com/prasathmani/tinyfilemanager
synced 2024-06-08 00:42:19 +02:00
Added theme option.
This commit is contained in:
parent
a11c3d0963
commit
efe64963fe
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
//Default Configuration
|
//Default Configuration
|
||||||
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false}';
|
$CONFIG = '{"lang":"en","error_reporting":false,"show_hidden":false,"hide_Cols":false,"calc_folder":false,"theme":"light"}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* H3K | Tiny File Manager V2.4.4
|
* H3K | Tiny File Manager V2.4.4
|
||||||
|
@ -29,10 +29,6 @@ $auth_users = array(
|
||||||
'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345
|
'user' => '$2y$10$Fg6Dz8oH9fPoZ2jJan5tZuv6Z4Kp7avtQ9bDfrdRntXtPeiMAZyGO' //12345
|
||||||
);
|
);
|
||||||
|
|
||||||
//set application theme
|
|
||||||
//options - 'light' and 'dark'
|
|
||||||
$theme = 'light';
|
|
||||||
|
|
||||||
// Readonly users
|
// Readonly users
|
||||||
// e.g. array('users', 'guest', ...)
|
// e.g. array('users', 'guest', ...)
|
||||||
$readonly_users = array(
|
$readonly_users = array(
|
||||||
|
@ -154,8 +150,6 @@ define('MAX_HEX_DUMP', 4096);
|
||||||
// max upload file size
|
// max upload file size
|
||||||
define('MAX_UPLOAD_SIZE', $max_upload_size_bytes);
|
define('MAX_UPLOAD_SIZE', $max_upload_size_bytes);
|
||||||
|
|
||||||
define('FM_THEME', $theme);
|
|
||||||
|
|
||||||
// private key and session name to store to the session
|
// private key and session name to store to the session
|
||||||
if ( !defined( 'FM_SESSION_ID')) {
|
if ( !defined( 'FM_SESSION_ID')) {
|
||||||
define('FM_SESSION_ID', 'filemanager');
|
define('FM_SESSION_ID', 'filemanager');
|
||||||
|
@ -179,6 +173,11 @@ $hide_Cols = isset($cfg->data['hide_Cols']) ? $cfg->data['hide_Cols'] : true;
|
||||||
// Show directory size: 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;
|
$calc_folder = isset($cfg->data['calc_folder']) ? $cfg->data['calc_folder'] : true;
|
||||||
|
|
||||||
|
// Theme
|
||||||
|
$theme = isset($cfg->data['theme']) ? $cfg->data['theme'] : 'light';
|
||||||
|
|
||||||
|
define('FM_THEME', $theme);
|
||||||
|
|
||||||
//available languages
|
//available languages
|
||||||
$lang_list = array(
|
$lang_list = array(
|
||||||
'en' => 'English'
|
'en' => 'English'
|
||||||
|
@ -484,7 +483,7 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
||||||
|
|
||||||
// Save Config
|
// Save Config
|
||||||
if (isset($_POST['type']) && $_POST['type'] == "settings") {
|
if (isset($_POST['type']) && $_POST['type'] == "settings") {
|
||||||
global $cfg, $lang, $report_errors, $show_hidden_files, $lang_list, $hide_Cols, $calc_folder;
|
global $cfg, $lang, $report_errors, $show_hidden_files, $lang_list, $hide_Cols, $calc_folder, $theme;
|
||||||
$newLng = $_POST['js-language'];
|
$newLng = $_POST['js-language'];
|
||||||
fm_get_translations([]);
|
fm_get_translations([]);
|
||||||
if (!array_key_exists($newLng, $lang_list)) {
|
if (!array_key_exists($newLng, $lang_list)) {
|
||||||
|
@ -495,6 +494,7 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
||||||
$shf = isset($_POST['js-show-hidden']) && $_POST['js-show-hidden'] == "true" ? true : false;
|
$shf = isset($_POST['js-show-hidden']) && $_POST['js-show-hidden'] == "true" ? true : false;
|
||||||
$hco = isset($_POST['js-hide-cols']) && $_POST['js-hide-cols'] == "true" ? true : false;
|
$hco = isset($_POST['js-hide-cols']) && $_POST['js-hide-cols'] == "true" ? true : false;
|
||||||
$caf = isset($_POST['js-calc-folder']) && $_POST['js-calc-folder'] == "true" ? true : false;
|
$caf = isset($_POST['js-calc-folder']) && $_POST['js-calc-folder'] == "true" ? true : false;
|
||||||
|
$te3 = $_POST['js-theme-3'];
|
||||||
|
|
||||||
if ($cfg->data['lang'] != $newLng) {
|
if ($cfg->data['lang'] != $newLng) {
|
||||||
$cfg->data['lang'] = $newLng;
|
$cfg->data['lang'] = $newLng;
|
||||||
|
@ -520,6 +520,10 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
||||||
$cfg->data['calc_folder'] = $caf;
|
$cfg->data['calc_folder'] = $caf;
|
||||||
$calc_folder = $caf;
|
$calc_folder = $caf;
|
||||||
}
|
}
|
||||||
|
if ($cfg->data['theme'] != $te3) {
|
||||||
|
$cfg->data['theme'] = $te3;
|
||||||
|
$theme = $te3;
|
||||||
|
}
|
||||||
$cfg->save();
|
$cfg->save();
|
||||||
echo true;
|
echo true;
|
||||||
}
|
}
|
||||||
|
@ -1430,6 +1434,16 @@ if (isset($_GET['settings']) && !FM_READONLY) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="js-3-1" class="col-sm-3 col-form-label"><?php echo lng('Theme') ?></label>
|
||||||
|
<div class="col-sm-5">
|
||||||
|
<select class="form-control" id="js-3-0" name="js-theme-3" style="width:100px;">
|
||||||
|
<option value='light' <?php if($theme == "light"){echo "selected";} ?>><?php echo lng('light') ?></option>
|
||||||
|
<option value='dark' <?php if($theme == "dark"){echo "selected";} ?>><?php echo lng('dark') ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<button type="submit" class="btn btn-success"> <i class="fa fa-check-circle"></i> <?php echo lng('Save'); ?></button>
|
<button type="submit" class="btn btn-success"> <i class="fa fa-check-circle"></i> <?php echo lng('Save'); ?></button>
|
||||||
|
@ -1772,7 +1786,7 @@ if (isset($_GET['edit'])) {
|
||||||
<button data-cmd="none" data-option="help" class="btn btn-sm btn-outline-secondary" id="js-ace-goLine" title="Help"><i class="fa fa-question" title="Help"></i></button>
|
<button data-cmd="none" data-option="help" class="btn btn-sm btn-outline-secondary" id="js-ace-goLine" title="Help"><i class="fa fa-question" title="Help"></i></button>
|
||||||
<select id="js-ace-mode" data-type="mode" title="Select Document Type" class="btn-outline-secondary border-left-0 d-none d-md-block"><option>-- Select Mode --</option></select>
|
<select id="js-ace-mode" data-type="mode" title="Select Document Type" class="btn-outline-secondary border-left-0 d-none d-md-block"><option>-- Select Mode --</option></select>
|
||||||
<select id="js-ace-theme" data-type="theme" title="Select Theme" class="btn-outline-secondary border-left-0 d-none d-lg-block"><option>-- Select Theme --</option></select>
|
<select id="js-ace-theme" data-type="theme" title="Select Theme" class="btn-outline-secondary border-left-0 d-none d-lg-block"><option>-- Select Theme --</option></select>
|
||||||
<select id="js-ace-fontSize" data-type="fontSize" title="Selct Font Size" class="btn-outline-secondary border-left-0 d-none d-lg-block"><option>-- Select Font Size --</option></select>
|
<select id="js-ace-fontSize" data-type="fontSize" title="Select Font Size" class="btn-outline-secondary border-left-0 d-none d-lg-block"><option>-- Select Font Size --</option></select>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue