Added option to select legacy icons

This commit is contained in:
bergware
2019-02-13 09:59:23 +01:00
parent 180cb18b75
commit f0f888a42e
13 changed files with 14 additions and 4 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ function resize(bind) {
}
<?endif;?>
function loadlist(id) {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id,check:<?=$check?>},function(d) {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{audit:id,check:<?=$check?>,legacy:<?=$display['legacy']?>},function(d) {
var data = d.split(/\0/);
var list = $('#plugin_list');
if (id) {
@@ -19,6 +19,7 @@ $system = $_GET['system'] ?? false;
$branch = $_GET['branch'] ?? false;
$audit = $_GET['audit'] ?? false;
$check = $_GET['check'] ?? false;
$legacy = $_GET['legacy'] ?? false;
$empty = true;
$updates = 0;
$builtin = ['unRAIDServer'];
@@ -64,7 +65,7 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
}
//link/icon
$launch = plugin('launch',$plugin_file);
if ($icon = plugin('icon',$plugin_file)) {
if (!$legacy && $icon = plugin('icon',$plugin_file)) {
if (substr($icon,-4)=='.png') {
if (file_exists("plugins/$name/images/$icon")) {
$icon = "plugins/$name/images/$icon";
+6
View File
@@ -257,6 +257,12 @@ Dynamix color theme:
<?endforeach;?>
</select>
Icons display:
: <select name="legacy" size="1">
<?=mk_option($display['legacy'], "0", "Modern")?>
<?=mk_option($display['legacy'], "1", "Legacy")?>
</select>
Used / Free columns:
: <select name="text" size="1">
<?=mk_option($display['text'], "0", "Text")?>
+1
View File
@@ -24,6 +24,7 @@ critical="90"
hot="45"
max="55"
theme="white"
legacy="0"
[parity]
mode="0"
hour="0 0"
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

@@ -407,18 +407,20 @@ foreach ($pages as $page) {
}
if (isset($page['Type']) && $page['Type']=='menu') {
$pgs = find_pages($page['name']);
$legacy = $display['legacy'];
foreach ($pgs as $pg) {
@eval("\$title=\"".htmlspecialchars($pg['Title'])."\";");
$link = "$path/{$pg['name']}";
$icon = $pg['Icon'] ?? "<i class='icon-app PanelIcon'></i>";
if (substr($icon,-4)=='.png') {
if ($legacy || substr($icon,-4)=='.png') {
$root = $pg['root'];
if ($legacy) $icon = ($root=='webGui' ? strtolower(preg_replace('/([a-z])([A-Z])/','$1-$2',$pg['name'])) : basename($root)).".png";
if (file_exists("$docroot/$root/images/$icon")) {
$icon = "<img src='/$root/images/$icon' class='PanelImg'>";
} elseif (file_exists("$docroot/$root/$icon")) {
$icon = "<img src='/$root/$icon' class='PanelImg'>";
} else {
$icon = "<i class='icon-app PanelIcon'></i>";
$icon = ($legacy ? "<img src='/webGui/images/default.png' class='PanelImg'>" : "<i class='icon-app PanelIcon'></i>");
}
} elseif (substr($icon,0,5)=='icon-') {
$icon = "<i class='$icon PanelIcon'></i>";