Subversion Repositories Applications.papyrus

Rev

Rev 2149 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2149 Rev 2152
Line 87... Line 87...
87
            'Ligne n° : '. __LINE__ .'<br />'.
87
            'Ligne n° : '. __LINE__ .'<br />'.
88
            'Fichier : '. __FILE__);
88
            'Fichier : '. __FILE__);
89
    }
89
    }
90
}
90
}
Line -... Line 91...
-
 
91
 
91
 
92
 
92
/**
93
/**
93
 * Stocke une <meta> du type <meta property="truc" content="chose">
94
 * Stocke une <meta> du type <meta property="truc" content="chose">
94
 * @param string $id
95
 * @param string $id
95
 * @param string $property
96
 * @param string $property
96
 * @param string $content
97
 * @param string $content
97
 */
98
 */
98
function GEN_stockerMetaProperty($id, $property, $content)
99
function GEN_stockerMetaProperty($id, $content)
99
{
100
{
100
    if (empty($GLOBALS['_GEN_commun']['meta_property'][$id])) {
101
    if (empty($GLOBALS['_GEN_commun']['meta_property'][$id])) {
101
        $GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content);
102
        $GLOBALS['_GEN_commun']['meta_property'][$id] = $content;
102
    } else {
103
    } else {
103
        die('ERREUR Papyrus : cette balise meta à déjà été enregistrée par GEN_stockerMetaProperty(). <br />'.
104
        die('ERREUR Papyrus : cette balise meta à déjà été enregistrée par GEN_stockerMetaProperty(). <br />'.
104
            'Identifiant : '. $id .'<br />'.
105
            'Identifiant : '. $id .'<br />'.
105
            'Ligne n° : '. __LINE__ .'<br />'.
106
            'Ligne n° : '. __LINE__ .'<br />'.
106
            'Fichier : '. __FILE__);
107
            'Fichier : '. __FILE__);
107
    }
108
    }
Line 108... Line 109...
108
}
109
}
109
 
110
 
110
/**
111
/**
111
 * Modifie une <meta> du type <meta property="truc" content="chose">
112
 * Modifie une <meta> du type <meta property="truc" content="chose">
112
 * @param string $id
113
 * @param string $id
113
 * @param string $property
114
 * @param string $property
114
 * @param string $content
115
 * @param string $content
115
 */
116
 */
116
function GEN_modifierMetaProperty($id, $property, $content)
117
function GEN_modifierMetaProperty($id, $content)
117
{
118
{
118
    if ($property != '' && $content != '') {
119
    if ($content != '') {
119
        $GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content);
120
        $GLOBALS['_GEN_commun']['meta_property'][$id] = $content;
120
    } else {
121
    } else {
121
        die('ERREUR Papyrus : cette balise ne peut avoir une propriété ou un contenu vide. <br />'.
122
        die('ERREUR Papyrus : cette balise ne peut avoir un contenu vide. <br />'.
122
            'Contenu : '. $content .'<br />'.
123
            'Contenu : '. $content .'<br />'.
123
            'Ligne n° : '. __LINE__ .'<br />'.
124
            'Ligne n° : '. __LINE__ .'<br />'.
124
            'Fichier : '. __FILE__);
125
            'Fichier : '. __FILE__);
Line 125... Line 126...
125
    }
126
    }
Line 253... Line 254...
253
        if (empty($sortie)) {
254
        if (empty($sortie)) {
254
            $sortie .= '<!-- Aucune balise meta name -->'."\n";
255
            $sortie .= '<!-- Aucune balise meta name -->'."\n";
255
        }
256
        }
256
    } else if ($type == 'property' && isset($GLOBALS['_GEN_commun']['meta_property'])) {
257
    } else if ($type == 'property' && isset($GLOBALS['_GEN_commun']['meta_property'])) {
257
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_property'])) {
258
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_property'])) {
258
            if (! empty($valeur['contenu'])) {
259
            if (! empty($valeur)) {
259
                $sortie .= str_repeat(' ', 8).'<meta property="'.$valeur[0].'" content="'.$valeur[1].'" />'."\n";
260
                $sortie .= '<meta property="'.$cle.'" content="'.$valeur.'" />'."\n";
260
            }
261
            }
261
        }
262
        }
262
        if (empty($sortie)) {
263
        if (empty($sortie)) {
263
            $sortie .= '<!-- Aucune balise meta property -->'."\n";
264
            $sortie .= '<!-- Aucune balise meta property -->'."\n";
264
        }
265
        }