Fix PHP CS

This commit is contained in:
VESSILLER
2023-09-28 14:18:56 +02:00
parent 20e2e86ca0
commit a85fd558ff
3 changed files with 49 additions and 55 deletions

View File

@@ -42,24 +42,23 @@ $webPortalTheme = new WebPortalTheme();
?>
[data-theme="custom"], :root{
--primary-color-hue : <?php print $webPortalTheme->primaryColorHsl['h']; ?>;
--primary-color-saturation : <?php print $webPortalTheme->primaryColorHsl['s']; ?>%;
--primary-color-lightness : <?php print $webPortalTheme->primaryColorHsl['l']; ?>%;
--banner-background : url(<?php print !empty($webPortalTheme->bannerBackground) ? $webPortalTheme->bannerBackground : '../img/banner.svg' ?>);
--primary-color-hue: <?php print $webPortalTheme->primaryColorHsl['h']; ?>;
--primary-color-saturation: <?php print $webPortalTheme->primaryColorHsl['s']; ?>%;
--primary-color-lightness: <?php print $webPortalTheme->primaryColorHsl['l']; ?>%;
--banner-background: url(<?php print !empty($webPortalTheme->bannerBackground) ? $webPortalTheme->bannerBackground : '../img/banner.svg' ?>);
}
.login-page {
<?php
if(!empty($webPortalTheme->loginBackground)){
print '--login-background: rgba(0, 0, 0, 0.4) url("'.$webPortalTheme->loginBackground.'");'."\n";
}
<?php
if (!empty($webPortalTheme->loginBackground)) {
print '--login-background: rgba(0, 0, 0, 0.4) url("'.$webPortalTheme->loginBackground.'");'."\n";
}
if(!empty($webPortalTheme->loginLogoUrl)){
print '--login-logo: url("'.$webPortalTheme->loginLogoUrl.'"); /* for relative path, must be relative od the css file or use full url starting by http:// */'."\n";
}
?>
if (!empty($webPortalTheme->loginLogoUrl)) {
print '--login-logo: url("'.$webPortalTheme->loginLogoUrl.'"); /* for relative path, must be relative od the css file or use full url starting by http:// */'."\n";
}
?>
}
<?php
print '/* Here, the content of the common custom CSS defined into Home - Setup - Display - CSS'."*/\n";

View File

@@ -166,34 +166,33 @@ if (empty($reshook)) {
<nav class="primary-top-nav container-fluid">
<ul>
<li class="brand">
<?php
$brandTitle = !empty($conf->global->WEBPORTAL_TITLE) ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >';
if(!empty($context->theme->menuLogoUrl)){
print '<img class="brand__logo-img" src="'.dol_escape_htmltag($context->theme->menuLogoUrl).'" alt="'.dol_escape_htmltag($brandTitle).'" >';
}else{
print '<span class="brand__name">'.$brandTitle.'</span>';
}
print '</a>';
?>
<?php
$brandTitle = !empty($conf->global->WEBPORTAL_TITLE) ? getDolGlobalString('WEBPORTAL_TITLE') : getDolGlobalString('MAIN_INFO_SOCIETE_NOM');
print '<a class="brand__logo-link" href="'.$context->getControllerUrl().'" >';
if (!empty($context->theme->menuLogoUrl)) {
print '<img class="brand__logo-img" src="' . dol_escape_htmltag($context->theme->menuLogoUrl) . '" alt="' . dol_escape_htmltag($brandTitle) . '" >';
} else {
print '<span class="brand__name">' . $brandTitle . '</span>';
}
print '</a>';
?>
</li>
</ul>
<ul>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navMenu)) {
// show menu
print getNav($navMenu);
}
?>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navMenu)) {
// show menu
print getNav($navMenu);
}
?>
</ul>
<ul>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navUserMenu)) {
// show menu
uasort($navUserMenu, 'menuSortInv');
print getNav($navUserMenu);
}
?>
<?php
if (empty($context->doNotDisplayMenu) && empty($reshook) && !empty($navUserMenu)) {
// show menu
uasort($navUserMenu, 'menuSortInv');
print getNav($navUserMenu);
}
?>
</ul>
</nav>

View File

@@ -733,42 +733,38 @@ class FormListWebPortal
* @param int $currentPage number of current page
* @return string
*/
public static function generatePageListNav(string $url, int $nbPages, int $currentPage){
public static function generatePageListNav(string $url, int $nbPages, int $currentPage)
{
global $langs;
$pSep = strpos($url, '?') === false ? '?' : '&amp;';
$html = '<ul class="pages-nav-list">';
if($currentPage > 1){
$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="'.dol_escape_htmltag($langs->trans('AriaPrevPage')).'" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>';
if ($currentPage > 1) {
$html .= '<li><a class="pages-nav-list__icon --prev" aria-label="' . dol_escape_htmltag($langs->trans('AriaPrevPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage - 1) . '" ' . ($currentPage <= 1 ? ' disabled' : '') . '></a></li>';
}
$maxPaginItem = min($nbPages, 5);
$minPageNum = max(1, $currentPage-3);
$maxPageNum = min($nbPages, $currentPage+3);
$minPageNum = max(1, $currentPage - 3);
$maxPageNum = min($nbPages, $currentPage + 3);
if($minPageNum > 1){
$html .= '<li><a class="pages-nav-list__link '.($currentPage==1?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', 1)).'" href="' . $url . $pSep . 'page=1" >1</a></li>';
if ($minPageNum > 1) {
$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == 1 ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', 1)) . '" href="' . $url . $pSep . 'page=1" >1</a></li>';
$html .= '<li>&hellip;</li>';
}
for($p=$minPageNum; $p <= $maxPageNum; $p++){
$html .= '<li><a class="pages-nav-list__link '.($currentPage===$p?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $p)).'" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>';
for ($p = $minPageNum; $p <= $maxPageNum; $p++) {
$html .= '<li><a class="pages-nav-list__link ' . ($currentPage === $p ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $p)) . '" href="' . $url . $pSep . 'page=' . $p . '">' . $p . '</a></li>';
}
if($maxPaginItem<$nbPages){
if ($maxPaginItem < $nbPages) {
$html .= '<li>&hellip;</li>';
$html .= '<li><a class="pages-nav-list__link '.($currentPage==$nbPages?'--active':'').'" aria-label="'.dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)).'" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>';
$html .= '<li><a class="pages-nav-list__link ' . ($currentPage == $nbPages ? '--active' : '') . '" aria-label="' . dol_escape_htmltag($langs->trans('AriaPageX', $nbPages)) . '" href="' . $url . $pSep . 'page=' . $nbPages . '">' . $nbPages . '</a></li>';
}
if($currentPage < $nbPages) {
$html .= '<li><a class="pages-nav-list__icon --next" aria-label="'.dol_escape_htmltag($langs->trans('AriaNextPage')).'" href="' . $url . $pSep . 'page='.($currentPage + 1).'" '.($currentPage >= $nbPages ? ' disabled' : '').'></a></li>';
if ($currentPage < $nbPages) {
$html .= '<li><a class="pages-nav-list__icon --next" aria-label="' . dol_escape_htmltag($langs->trans('AriaNextPage')) . '" href="' . $url . $pSep . 'page=' . ($currentPage + 1) . '" ' . ($currentPage >= $nbPages ? ' disabled' : '') . '></a></li>';
}
$html .= '</ul>';