test fonts

This commit is contained in:
Fred Tempez 2022-02-07 19:10:16 +01:00
parent 452d245e00
commit 8ea56f8ae9
2 changed files with 32 additions and 6 deletions

View File

@ -29,7 +29,8 @@ class theme extends common {
'manage' => self::GROUP_ADMIN,
'export' => self::GROUP_ADMIN,
'import' => self::GROUP_ADMIN,
'save' => self::GROUP_ADMIN
'save' => self::GROUP_ADMIN,
'fonts' => self::GROUP_ADMIN
];
public static $aligns = [
'left' => 'À gauche',
@ -412,11 +413,11 @@ class theme extends common {
$featureContent = $this->getInput('themeHeaderText', null);
$featureContent = str_replace(helper::baseUrl(false,false), './', $featureContent);
/**
/**
* Stocker les images incluses dans la bannière perso dans un tableau
*/
preg_match_all('/<img[^>]+>/i',$featureContent, $results);
foreach($results[0] as $value) {
preg_match_all('/<img[^>]+>/i',$featureContent, $results);
foreach($results[0] as $value) {
// Lire le contenu XML
$sx = simplexml_load_string($value);
// Élément à remplacer
@ -538,6 +539,20 @@ class theme extends common {
]);
}
/**
* Options des fontes
*/
public function fonts() {
// Soumission du formulaire
if($this->isPost()) {
}
// Valeurs en sortie
$this->addOutput([
'title' => 'Gestion des fontes',
'view' => 'fonts'
]);
}
/**
* Réinitialisation de la personnalisation avancée
*/
@ -795,10 +810,10 @@ class theme extends common {
// Traite les images du header perso
if (!empty($this->getData(['theme','header','featureFiles'])) ) {
foreach($this->getData(['theme','header','featureFiles']) as $value) {
$zip->addFile(self::FILE_DIR . 'source/' . $value,
$zip->addFile(self::FILE_DIR . 'source/' . $value,
self::FILE_DIR . 'source/' . $value );
}
}
}
break;
}
$ret = $zip->close();

View File

@ -0,0 +1,11 @@
<?php
$filefont = 'https://www.cdnfonts.com/sketched.font';
$doc = new DOMDocument();
$doc->loadHTMLFile($filefont, LIBXML_NOERROR);
$elements = $doc->getElementsByTagName('i');
var_dump ($elements);
foreach($elements as $element) {
if ($element->$textContent === 'http://fonts.cdnfonts.com/css/sketched') {
var_dump( $element['textContent'] );
}
}