forked from ZwiiCMS-Team/ZwiiCMS
Validité des fontes
This commit is contained in:
parent
66cb645700
commit
bd1a174272
@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version 11.4.02
|
||||||
|
### Modifications :
|
||||||
|
- Liste des aperçus de fontes, contrôle de validité amélioré.
|
||||||
|
|
||||||
## Version 11.4.01
|
## Version 11.4.01
|
||||||
### Corrections :
|
### Corrections :
|
||||||
- Défaut de chargement des fontes locales (ex: fichiers woff).
|
- Défaut de chargement des fontes locales (ex: fichiers woff).
|
||||||
|
@ -1190,16 +1190,19 @@ class theme extends common {
|
|||||||
*/
|
*/
|
||||||
$gf = false;
|
$gf = false;
|
||||||
$fileContent = '<!-- Fontes personnalisées -->';
|
$fileContent = '<!-- Fontes personnalisées -->';
|
||||||
foreach ($this->getData(['fonts', 'imported']) as $fontId => $fontValue) {
|
if ( is_array($this->getData(['fonts', 'imported'])) &&
|
||||||
if (
|
!empty($this->getData(['fonts', 'imported'])) ) {
|
||||||
( $scope === 'user' && in_array($fontId, $fontsInstalled) )
|
foreach ($this->getData(['fonts', 'imported']) as $fontId => $fontValue) {
|
||||||
|| $scope === 'all'
|
if (
|
||||||
) {
|
( $scope === 'user' && in_array($fontId, $fontsInstalled) )
|
||||||
//Pré chargement à revoir
|
|| $scope === 'all'
|
||||||
//$fileContent .= '<link rel="preload" href="' . $fontValue['resource'] . '" crossorigin="anonymous" as="style">';
|
) {
|
||||||
$fileContent .= '<link href="' . $fontValue['resource'] .'" rel="stylesheet">';
|
//Pré chargement à revoir
|
||||||
// Pré connect pour api.google
|
//$fileContent .= '<link rel="preload" href="' . $fontValue['resource'] . '" crossorigin="anonymous" as="style">';
|
||||||
$gf = strpos($fontValue['resource'], 'fonts.googleapis.com') === false ? $gf || false : $gf || true;
|
$fileContent .= '<link href="' . $fontValue['resource'] .'" rel="stylesheet">';
|
||||||
|
// Pré connect pour api.google
|
||||||
|
$gf = strpos($fontValue['resource'], 'fonts.googleapis.com') === false ? $gf || false : $gf || true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1213,22 +1216,26 @@ class theme extends common {
|
|||||||
* Fontes installées localement
|
* Fontes installées localement
|
||||||
*/
|
*/
|
||||||
$fileContentCss = '';
|
$fileContentCss = '';
|
||||||
foreach ($this->getData(['fonts', 'files']) as $fontId => $fontValue) {
|
$fileContent = '<!-- Fontes personnalisées -->';
|
||||||
if (
|
if ( is_array($this->getData(['fonts', 'files'])) &&
|
||||||
( $scope === 'user' && in_array($fontId, $fontsInstalled) )
|
!empty($this->getData(['fonts', 'files'])) ) {
|
||||||
|| $scope === 'all'
|
foreach ($this->getData(['fonts', 'files']) as $fontId => $fontValue) {
|
||||||
) {
|
if (
|
||||||
if (file_exists(self::DATA_DIR . 'fonts/' . $fontValue['resource']) ) {
|
( $scope === 'user' && in_array($fontId, $fontsInstalled) )
|
||||||
// Extension
|
|| $scope === 'all'
|
||||||
$path_parts = pathinfo(helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontValue['resource']);
|
) {
|
||||||
// Chargement de la police
|
if (file_exists(self::DATA_DIR . 'fonts/' . $fontValue['resource']) ) {
|
||||||
$fileContentCss .= '@font-face {' ;
|
// Extension
|
||||||
$fileContentCss .= 'font-family:"' . $fontValue['name'] . '";';
|
$path_parts = pathinfo(helper::baseUrl(false) . self::DATA_DIR . 'fonts/' . $fontValue['resource']);
|
||||||
$fileContentCss .= 'src: url("' . $fontValue['resource'] . '") format("' . $path_parts['extension'] . '");';
|
// Chargement de la police
|
||||||
$fileContentCss .= '}' ;
|
$fileContentCss .= '@font-face {' ;
|
||||||
// Préchargement
|
$fileContentCss .= 'font-family:"' . $fontValue['name'] . '";';
|
||||||
//$fileContent = '<link rel="preload" href="' . self::DATA_DIR . 'fonts/' . $fontValue['resource'] . '" type="font/woff" crossorigin="anonymous" as="font">' . $fileContent;
|
$fileContentCss .= 'src: url("' . $fontValue['resource'] . '") format("' . $path_parts['extension'] . '");';
|
||||||
}
|
$fileContentCss .= '}' ;
|
||||||
|
// Préchargement
|
||||||
|
//$fileContent = '<link rel="preload" href="' . self::DATA_DIR . 'fonts/' . $fontValue['resource'] . '" type="font/woff" crossorigin="anonymous" as="font">' . $fileContent;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user