89,6 → 89,42 |
} |
} |
|
/** |
* Stocke une <meta> du type <meta property="truc" content="chose"> |
* @param string $id |
* @param string $property |
* @param string $content |
*/ |
function GEN_stockerMetaProperty($id, $property, $content) |
{ |
if (empty($GLOBALS['_GEN_commun']['meta_property'][$id])) { |
$GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content); |
} else { |
die('ERREUR Papyrus : cette balise meta à déjà été enregistrée par GEN_stockerMetaProperty(). <br />'. |
'Identifiant : '. $id .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier : '. __FILE__); |
} |
} |
|
/** |
* Modifie une <meta> du type <meta property="truc" content="chose"> |
* @param string $id |
* @param string $property |
* @param string $content |
*/ |
function GEN_modifierMetaProperty($id, $property, $content) |
{ |
if ($property != '' && $content != '') { |
$GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content); |
} else { |
die('ERREUR Papyrus : cette balise ne peut avoir une propriété ou un contenu vide. <br />'. |
'Contenu : '. $content .'<br />'. |
'Ligne n° : '. __LINE__ .'<br />'. |
'Fichier : '. __FILE__); |
} |
} |
|
/** Fonction GEN_stockerMetaName() - Permet de stocker des informations pour la balise meta. |
* |
* Papyrus permet à une application donnée de stocker les balises meta contenant l'attribut name |
217,6 → 253,15 |
if (empty($sortie)) { |
$sortie .= '<!-- Aucune balise meta name -->'."\n"; |
} |
} else if ($type == 'property' && isset($GLOBALS['_GEN_commun']['meta_property'])) { |
while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_property'])) { |
if (! empty($valeur['contenu'])) { |
$sortie .= str_repeat(' ', 8).'<meta property="'.$valeur[0].'" content="'.$valeur[1].'" />'."\n"; |
} |
} |
if (empty($sortie)) { |
$sortie .= '<!-- Aucune balise meta property -->'."\n"; |
} |
} else if ($type == 'dc' && isset($GLOBALS['_GEN_commun']['meta_name_dc'])) { |
while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_name_dc'])) { |
if (! empty($valeur['contenu'])) { |
267,6 → 312,12 |
$GLOBALS['_GEN_commun']['meta'][$cle] = null; |
} |
} |
} else if ($type == 'property') { |
if (count($GLOBALS['_GEN_commun']['meta_property']) > 0) { |
foreach ($GLOBALS['_GEN_commun']['meta_property'] as $cle => $val) { |
$GLOBALS['_GEN_commun']['meta_property'][$cle] = null; |
} |
} |
} else if ($type == 'dc') { |
if (count($GLOBALS['_GEN_commun']['meta_name_dc']) > 0) { |
foreach ($GLOBALS['_GEN_commun']['meta_name_dc'] as $cle => $val) { |