theme admin width screen

This commit is contained in:
Fred Tempez 2023-10-09 20:30:17 +02:00
parent 713b939392
commit ef43ce008e
4 changed files with 43 additions and 8 deletions

View File

@ -400,6 +400,27 @@ class core extends common
$css .= 'p, div, label, select, input, table, span {font-family:' . $fonts[$this->getData(['admin', 'fontText'])] . '}';
$css .= 'body,.row > div {font-size:' . $this->getData(['admin', 'fontSize']) . '}';
$css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $fonts[$this->getData(['admin', 'fontTitle'])] . ';color:' . $this->getData(['admin', 'colorTitle']) . ';}';
$css .= '.container {max-width:' . $this->getData(['admin', 'width']) . '}';
$margin = $this->getData(['theme', 'site', 'margin']) ? '0' : '20px';
// Marge supplémentaire lorsque le pied de page est fixe
if (
$this->getData(['theme', 'footer', 'fixed']) === true &&
$this->getData(['theme', 'footer', 'position']) === 'body'
) {
$marginBottomLarge = ((str_replace('px', '', $this->getData(['theme', 'footer', 'height'])) * 2) + 31) . 'px';
$marginBottomSmall = ((str_replace('px', '', $this->getData(['theme', 'footer', 'height'])) * 2) + 93) . 'px';
} else {
$marginBottomSmall = $margin;
$marginBottomLarge = $margin;
}
$css .= $this->getData(['admin', 'width']) === '100%'
? '@media (min-width: 769px) {#site{margin:0 auto ' . $marginBottomLarge . ' 0 !important;}}@media (max-width: 768px) {#site{margin:0 auto ' . $marginBottomSmall . ' 0 !important;}}#site.light{margin:5% auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}'
: '@media (min-width: 769px) {#site{margin: ' . $margin . ' auto ' . $marginBottomLarge . ' auto !important;}}@media (max-width: 768px) {#site{margin: ' . $margin . ' auto ' . $marginBottomSmall . ' auto !important;}}#site.light{margin: 5% auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} ';
$css .= $this->getData(['admin', 'width']) === '750px'
? '.button, button{font-size:0.8em;}'
: '';
// TinyMCE
$colors = helper::colorVariants($this->getData(['admin', 'colorText']));

View File

@ -554,8 +554,9 @@ class course extends common
&& $this->courseIsAvailable($courseId)
) {
// Récupérer la dernière page visitée par cet utilisateur si elle existe
$maxTime = max($this->getData(['enrolment', $courseId, $userId, 'history']));
if ($maxTime) {
if ($this->getData(['enrolment', $courseId, $userId, 'history']))
$maxTime = max($this->getData(['enrolment', $courseId, $userId, 'history']));
if (is_int($maxTime)) {
$redirect .= array_search($maxTime, $this->getData(['enrolment', $courseId, $userId, 'history']));
} else {
// Sinon la page d'accueil par défaut du module

View File

@ -214,7 +214,13 @@ class theme extends common
'750px' => '750 pixels',
'960px' => '960 pixels',
'1170px' => '1170 pixels',
'100%' => '100%'
'100%' => '100%',
'95%' => '95%',
'90%' => '90%',
'85%' => '85%',
'80%' => '80%',
'75%' => '75%',
'70%' => '70%',
];
public static $headerWide = [
'auto auto' => 'Automatique',
@ -269,6 +275,7 @@ class theme extends common
'fontTitle' => $this->getInput('adminFontTitle'),
'backgroundBlockColor' => $this->getInput('adminBackGroundBlockColor'),
'borderBlockColor' => $this->getInput('adminBorderBlockColor'),
'width' => $this->getInput('adminSiteWidth'),
]
]);
// Valeurs en sortie

View File

@ -32,10 +32,16 @@
<div class="row">
<div class="col12">
<div class="block">
<h4><?php echo helper::translate('Couleurs'); ?>
<h4><?php echo helper::translate('Paramètres'); ?>
</h4>
<div class="row">
<div class="col4">
<div class="col3">
<?php echo template::select('adminSiteWidth', $module::$siteWidths, [
'label' => 'Largeur',
'selected' => $this->getData(['admin', 'width'])
]); ?>
</div>
<div class="col3">
<?php echo template::text('adminBackgroundColor', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
@ -43,7 +49,7 @@
'value' => $this->getData(['admin', 'backgroundColor'])
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::text('adminColorTitle', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
@ -51,7 +57,7 @@
'value' => $this->getData(['admin', 'colorTitle'])
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::text('adminColorText', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',
@ -77,7 +83,7 @@
'value' => $this->getData(['admin', 'borderBlockColor'])
]); ?>
</div>
<div class="col3 offset1">
<div class="col4">
<?php echo template::text('adminColorHelp', [
'class' => 'colorPicker',
'help' => 'Couleur visible en l\'absence d\'une image.<br />Le curseur horizontal règle le niveau de transparence.',