[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / configuration / type_urls.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) return;
14
15 // Choix du type d'url
16
17 include_spip('inc/presentation');
18 include_spip('inc/config');
19
20 function configuration_type_urls_dist()
21 {
22 if ($GLOBALS['type_urls'] != 'page') // fixe par mes_options
23 return '';
24
25 $dispo = array();
26 foreach (find_all_in_path('urls/', '\w+\.php$', array()) as $f) {
27 $r = basename($f, '.php');
28 if ($r == 'index' OR strncmp('generer_',$r,8)==0) continue;
29 include_once $f;
30 $exemple = 'URLS_' . strtoupper($r) . '_EXEMPLE';
31 $exemple = defined($exemple) ? constant($exemple) : '?';
32 $dispo[$r] = "<em>$r</em> &mdash; <tt>" . $exemple . '</tt>';
33 }
34
35 $res = "<p class='verdana2'>"
36 . _T('texte_type_urls')
37 . "</p>"
38 . "<div class='verdana2'>"
39 . afficher_choix('type_urls', $GLOBALS['meta']['type_urls'], $dispo)
40 . "</div>"
41 . "<p><em>"
42 . _T('texte_type_urls_attention', array('htaccess' => '<tt>.htaccess</tt>'))
43 . "</em></p>";
44
45
46 $res = '<br />'.debut_cadre_trait_couleur("", true, "", _T('titre_type_urls').aide("confurl"))
47 . ajax_action_post('configurer', 'type_urls', 'config_fonctions', '', $res)
48 . fin_cadre_trait_couleur(true);
49
50 return ajax_action_greffe("configurer-type_urls", '', $res);
51 }
52 ?>