Subversion Repositories Applications.papyrus

Rev

Rev 2100 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2100 Rev 2149
Line 85... Line 85...
85
        die('ERREUR Papyrus : cette balise ne peut avoir un contenu vide. <br />'.
85
        die('ERREUR Papyrus : cette balise ne peut avoir un contenu vide. <br />'.
86
            'Contenu : '. $content .'<br />'.
86
            'Contenu : '. $content .'<br />'.
87
            'Ligne n° : '. __LINE__ .'<br />'.
87
            'Ligne n° : '. __LINE__ .'<br />'.
88
            'Fichier : '. __FILE__);
88
            'Fichier : '. __FILE__);
89
    }
89
    }
-
 
90
}
-
 
91
 
-
 
92
/**
-
 
93
 * Stocke une <meta> du type <meta property="truc" content="chose">
-
 
94
 * @param string $id
-
 
95
 * @param string $property
-
 
96
 * @param string $content
-
 
97
 */
-
 
98
function GEN_stockerMetaProperty($id, $property, $content)
-
 
99
{
-
 
100
    if (empty($GLOBALS['_GEN_commun']['meta_property'][$id])) {
-
 
101
        $GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content);
-
 
102
    } else {
-
 
103
        die('ERREUR Papyrus : cette balise meta à déjà été enregistrée par GEN_stockerMetaProperty(). <br />'.
-
 
104
            'Identifiant : '. $id .'<br />'.
-
 
105
            'Ligne n° : '. __LINE__ .'<br />'.
-
 
106
            'Fichier : '. __FILE__);
-
 
107
    }
-
 
108
}
-
 
109
 
-
 
110
/**
-
 
111
 * Modifie une <meta> du type <meta property="truc" content="chose">
-
 
112
 * @param string $id
-
 
113
 * @param string $property
-
 
114
 * @param string $content
-
 
115
 */
-
 
116
function GEN_modifierMetaProperty($id, $property, $content)
-
 
117
{
-
 
118
    if ($property != '' && $content != '') {
-
 
119
        $GLOBALS['_GEN_commun']['meta_property'][$id] = array($property, $content);
-
 
120
    } else {
-
 
121
        die('ERREUR Papyrus : cette balise ne peut avoir une propriété ou un contenu vide. <br />'.
-
 
122
            'Contenu : '. $content .'<br />'.
-
 
123
            'Ligne n° : '. __LINE__ .'<br />'.
-
 
124
            'Fichier : '. __FILE__);
-
 
125
    }
90
}
126
}
Line 91... Line 127...
91
 
127
 
92
/** Fonction GEN_stockerMetaName() - Permet de stocker des informations pour la balise meta.
128
/** Fonction GEN_stockerMetaName() - Permet de stocker des informations pour la balise meta.
93
*
129
*
Line 206... Line 242...
206
            $sortie .= str_repeat(' ', 8).'<meta http-equiv="'.$cle.'" content="'.$valeur.'" />'."\n";
242
            $sortie .= str_repeat(' ', 8).'<meta http-equiv="'.$cle.'" content="'.$valeur.'" />'."\n";
207
        }
243
        }
208
        if (empty($sortie)) {
244
        if (empty($sortie)) {
209
            $sortie .= '<!-- Aucune balise meta http-equiv -->'."\n";
245
            $sortie .= '<!-- Aucune balise meta http-equiv -->'."\n";
210
        }
246
        }
211
    }else if ($type == 'name' && isset($GLOBALS['_GEN_commun']['meta_name'])) {
247
    } else if ($type == 'name' && isset($GLOBALS['_GEN_commun']['meta_name'])) {
212
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_name'])) {
248
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_name'])) {
213
            if (! empty($valeur['contenu'])) {
249
            if (! empty($valeur['contenu'])) {
214
                $sortie .= str_repeat(' ', 8).'<meta name="'.$cle.'" content="'.$valeur.'" />'."\n";
250
                $sortie .= str_repeat(' ', 8).'<meta name="'.$cle.'" content="'.$valeur.'" />'."\n";
215
            }
251
            }
216
        }
252
        }
217
        if (empty($sortie)) {
253
        if (empty($sortie)) {
218
            $sortie .= '<!-- Aucune balise meta name -->'."\n";
254
            $sortie .= '<!-- Aucune balise meta name -->'."\n";
219
        }
255
        }
-
 
256
    } else if ($type == 'property' && isset($GLOBALS['_GEN_commun']['meta_property'])) {
-
 
257
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_property'])) {
-
 
258
            if (! empty($valeur['contenu'])) {
-
 
259
                $sortie .= str_repeat(' ', 8).'<meta property="'.$valeur[0].'" content="'.$valeur[1].'" />'."\n";
-
 
260
            }
-
 
261
        }
-
 
262
        if (empty($sortie)) {
-
 
263
            $sortie .= '<!-- Aucune balise meta property -->'."\n";
-
 
264
        }
220
    } else if ($type == 'dc' && isset($GLOBALS['_GEN_commun']['meta_name_dc'])) {
265
    } else if ($type == 'dc' && isset($GLOBALS['_GEN_commun']['meta_name_dc'])) {
221
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_name_dc'])) {
266
        while (list($cle, $valeur) = each($GLOBALS['_GEN_commun']['meta_name_dc'])) {
222
            if (! empty($valeur['contenu'])) {
267
            if (! empty($valeur['contenu'])) {
223
                $sortie .= str_repeat(' ', 8).'<meta name="'.$cle.'" ';
268
                $sortie .= str_repeat(' ', 8).'<meta name="'.$cle.'" ';
224
                if (! empty($valeur['langue'])) {
269
                if (! empty($valeur['langue'])) {
Line 265... Line 310...
265
        if (count($GLOBALS['_GEN_commun']['meta']) > 0) {
310
        if (count($GLOBALS['_GEN_commun']['meta']) > 0) {
266
        	foreach ($GLOBALS['_GEN_commun']['meta'] as $cle => $val) {
311
        	foreach ($GLOBALS['_GEN_commun']['meta'] as $cle => $val) {
267
            	$GLOBALS['_GEN_commun']['meta'][$cle] = null;
312
            	$GLOBALS['_GEN_commun']['meta'][$cle] = null;
268
        	}
313
        	}
269
        }
314
        }
-
 
315
    } else if ($type == 'property') {
-
 
316
        if (count($GLOBALS['_GEN_commun']['meta_property']) > 0) {
-
 
317
        	foreach ($GLOBALS['_GEN_commun']['meta_property'] as $cle => $val) {
-
 
318
            	$GLOBALS['_GEN_commun']['meta_property'][$cle] = null;
-
 
319
        	}
-
 
320
        }
270
    } else if ($type == 'dc') {
321
    } else if ($type == 'dc') {
271
        if (count($GLOBALS['_GEN_commun']['meta_name_dc']) > 0) {
322
        if (count($GLOBALS['_GEN_commun']['meta_name_dc']) > 0) {
272
        	foreach ($GLOBALS['_GEN_commun']['meta_name_dc'] as $cle => $val) {
323
        	foreach ($GLOBALS['_GEN_commun']['meta_name_dc'] as $cle => $val) {
273
            	$GLOBALS['_GEN_commun']['meta_name_dc'][$cle] = null;
324
            	$GLOBALS['_GEN_commun']['meta_name_dc'][$cle] = null;
274
        	}
325
        	}