Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 2151 → Rev 2152

/trunk/papyrus/bibliotheque/fonctions/pap_meta.fonct.php
87,44 → 87,45
'Ligne n° : '. __LINE__ .'<br />'.
'Fichier : '. __FILE__);
}
}
}
 
/**
* 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__);
}
 
/**
* Stocke une <meta> du type <meta property="truc" content="chose">
* @param string $id
* @param string $property
* @param string $content
*/
function GEN_stockerMetaProperty($id, $content)
{
if (empty($GLOBALS['_GEN_commun']['meta_property'][$id])) {
$GLOBALS['_GEN_commun']['meta_property'][$id] = $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, $content)
{
if ($content != '') {
$GLOBALS['_GEN_commun']['meta_property'][$id] = $content;
} else {
die('ERREUR Papyrus : cette balise ne peut avoir 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
253,15 → 254,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 == 'property' && isset($GLOBALS['_GEN_commun']['meta_property'])) {
while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_property'])) {
if (! empty($valeur)) {
$sortie .= '<meta property="'.$cle.'" content="'.$valeur.'" />'."\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'])) {
312,12 → 313,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 == '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) {
356,4 → 357,4
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>
?>