Aggiunte skin light per tema

This commit is contained in:
Luca 2024-02-12 18:13:39 +01:00
parent 74ad2bd1e3
commit 571b5d2f85
5 changed files with 30 additions and 5 deletions

View File

@ -113,7 +113,11 @@ if (!empty($query)) {
$column = [];
if (!empty($r['_bg_'])) {
$column['data-background'] = $r['_bg_'];
if (preg_match('/-light$/', $r['_bg_'])) {
$column['data-background'] = substr($r['_bg_'], 0, -6); // Remove the "-light" suffix from the word
}else{
$column['data-background'] = $r['_bg_'];
}
}
// Allineamento

View File

@ -461,7 +461,17 @@ if (!function_exists('color_inverse')) {
return '#000';
}
} else {
return '#000';
switch ($start_colour) {
case 'black':
return 'white';
case 'blue':
return 'white';
case 'purple':
return 'white';
// Aggiungere altri casi per colori specifici
default:
return '#000'; // Se il colore non è specificato, restituisce il colore originale
}
}
}
}

View File

@ -28,7 +28,7 @@ include_once __DIR__.'/../../core.php';
{[ "type": "text", "label": "<?php echo tr('Nome gruppo'); ?>", "name": "nome", "required": 1, "validation": "gruppo", "help": "<?php echo tr('Compilando questo campo verrà creato un nuovo gruppo di utenti.'); ?>" ]}
</div>
<div class="col-md-3">
{[ "type": "select", "label": "<?php echo tr('Tema'); ?>", "name": "theme", "values": "list=\"\": \"<?php echo tr('Predefinito'); ?>\",\"black\": \"<?php echo tr('Nero'); ?>\",\"red\": \"<?php echo tr('Rosso'); ?>\",\"blue\": \"<?php echo tr('Blu'); ?>\",\"green\": \"<?php echo tr('Verde'); ?>\",\"yellow\": \"<?php echo tr('Giallo'); ?>\",\"purple\": \"<?php echo tr('Viola'); ?>\"", "value": "$theme$" ]}
{[ "type": "select", "label": "<?php echo tr('Tema'); ?>", "name": "theme", "values": "list=\"\": \"<?php echo tr('Predefinito'); ?>\",\"black-light\": \"<?php echo tr('Bianco'); ?>\",\"black\": \"<?php echo tr('Nero'); ?>\",\"red-light\": \"<?php echo tr('Rosso chiaro'); ?>\",\"red\": \"<?php echo tr('Rosso'); ?>\",\"blue-light\": \"<?php echo tr('Blu chiaro'); ?>\",\"blue\": \"<?php echo tr('Blu'); ?>\",\"green-light\": \"<?php echo tr('Verde chiaro'); ?>\",\"green\": \"<?php echo tr('Verde'); ?>\",\"yellow-light\": \"<?php echo tr('Giallo chiaro'); ?>\",\"yellow\": \"<?php echo tr('Giallo'); ?>\",\"purple-light\": \"<?php echo tr('Viola chiaro'); ?>\",\"purple\": \"<?php echo tr('Viola'); ?>\"", "value": "$theme$" ]}
</div>
<div class="col-md-3">
{["type":"select", "label":"<?php echo tr('Modulo iniziale'); ?>", "name":"id_module_start", "ajax-source":"moduli_gruppo", "placeholder":"<?php tr('Modulo iniziale'); ?>" ]}

View File

@ -35,7 +35,7 @@ echo '
{["type":"select", "label":"'.tr('Modulo iniziale').'", "name":"id_module_start", "ajax-source":"moduli_gruppo", "select-options": '.json_encode(['idgruppo' => $record['id']]).', "placeholder":"'.tr('Modulo iniziale').'", "value":"'.$record['id_module_start'].'" ]}
</div>
<div class="col-md-3 pull-right">
{["type":"select", "label":"'.tr('Tema').'", "name":"theme", "values":"list=\"\": \"'.tr('Predefinito').'\",\"black\": \"'.tr('Nero').'\",\"red\": \"'.tr('Rosso').'\",\"blue\": \"'.tr('Blu').'\",\"green\": \"'.tr('Verde').'\",\"yellow\": \"'.tr('Giallo').'\",\"purple\": \"'.tr('Viola').'\" ", "value":"'.$record['theme'].'" ]}
{["type":"select", "label":"'.tr('Tema').'", "name":"theme", "values":"list=\"\": \"'.tr('Predefinito').'\",\"black-light\": \"'.tr('Bianco').'\",\"black\": \"'.tr('Nero').'\",\"red-light\": \"'.tr('Rosso chiaro').'\",\"red\": \"'.tr('Rosso').'\",\"blue-light\": \"'.tr('Blu chiaro').'\",\"blue\": \"'.tr('Blu').'\",\"green-light\": \"'.tr('Verde chiaro').'\",\"green\": \"'.tr('Verde').'\",\"yellow-light\": \"'.tr('Giallo chiaro').'\",\"yellow\": \"'.tr('Giallo').'\",\"purple-light\": \"'.tr('Viola chiaro').'\",\"purple\": \"'.tr('Viola').'\" ", "value":"'.$record['theme'].'" ]}
</div>
</div>
<br>';
@ -279,12 +279,23 @@ function update_permissions(id, value, color){
);
}
var mySkins=["skin-blue","skin-black","skin-red","skin-yellow","skin-purple","skin-green","skin-blue-light","skin-black-light","skin-red-light","skin-yellow-light","skin-purple-light","skin-green-light"];
function changeSkin(cls){
$.each(mySkins,function(i){
$("body").removeClass(mySkins[i])
});
$("body").addClass("skin-"+cls);
return false;
}
$("#id_module_start").change(function(){
update_id_module_start($(this).val());
});
$("#theme").change(function(){
update_theme($(this).val());
changeSkin($(this).val());
});
function update_id_module_start(value){

View File

@ -151,7 +151,7 @@ class FileManager implements ManagerInterface
<i class="fa fa-external-link"></i> '.$file->name.'
</a>
<small> ('.$file->extension.')'.((!empty($file->size)) ? ' ('.FileSystem::formatBytes($file->size).')' : '').' '.(((setting('Logo stampe') == $file->filename) || (setting('Filigrana stampe') == $file->filename)) ? '<i class="fa fa-file-text-o"></i>' : '').'</small>'.'
<small> ('.$file->extension.')'.((!empty($file->size)) ? ' ('.FileSystem::formatBytes($file->size).')' : '').' '.(((setting('Logo stampe') == $file->filename) || (setting('Filigrana stampe') == $file->filename)) ? '<span class="tip" title="'.tr("Logo caricato correttamente").'." >✔️</span>' : '').'</small>'.'
</td>
<td>'.timestampFormat($file['created_at']).'</td>