1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/admin/design_themes.php
Daniel 2a9630258f https://github.com/WWBN/AVideo/issues/6345#issuecomment-1067056556
Also check the lang in case insensitive
2022-03-14 14:28:38 -03:00

54 lines
2.4 KiB
PHP

<div class="row">
<?php
$savedTheme = $config->getTheme();
$delay = 0.2;
foreach (glob("{$global['systemRootPath']}view/css/custom/*.css") as $filename) {
//echo "$filename size " . filesize($filename) . "\n";
$file = basename($filename); // $file is set to "index.php"
$fileEx = basename($filename, ".css"); // $file is set to "index"
?>
<div class="col-xs-4 <?php echo getCSSAnimationClassAndStyle('animate__fadeInUp', 'themess', $delay); ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php echo ucfirst($fileEx); ?>
<div class="material-switch pull-right">
<input class="themeSwitch" data-toggle="toggle" type="checkbox" value="<?php echo($fileEx); ?>" id="themeSwitch<?php echo($fileEx); ?>" <?php echo ($fileEx == $savedTheme) ? "checked" : ""; ?>>
<label for="themeSwitch<?php echo($fileEx); ?>" class="label-primary"></label>
</div>
</div>
<div class="panel-body">
<img src="<?php echo $global['webSiteRootURL'], "view/css/custom/", $fileEx, ".png"; ?>" class="img-responsive">
</div>
</div>
</div>
<?php
}
?>
</div>
<script>
function checkSwitch() {
var defaultSwitch = $('#defaultSwitch').is(":checked");
var netflixSwitch = $('#netflixSwitch').is(":checked");
var gallerySwitch = $('#gallerySwitch').is(":checked");
if (!defaultSwitch && !netflixSwitch && !gallerySwitch) {
$('#netflixSwitch').prop('checked', false);
$('#gallerySwitch').prop('checked', false);
$('#defaultSwitch').prop('checked', true);
}
}
$(document).ready(function () {
$('.themeSwitch').change(function (e) {
modal.showPleaseWait();
$('.themeSwitch').not(this).prop('checked', false);
$.ajax({
url: '<?php echo $global['webSiteRootURL']; ?>admin/themeUpdate.json.php',
data: {"theme": $(this).val()},
type: 'post',
success: function (response) {
modal.hidePleaseWait();
}
});
});
});
</script>