[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / sites / formulaires / editer_site_fonctions.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
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')) {
14 return;
15 }
16
17 function saisie_url_syndic($url_syndic, $name = 'url_syndic', $id = 'url_syndic') {
18 $res = "";
19 if (strlen($url_syndic) < 8) {
20 $url_syndic = "http://";
21 }
22
23 // cas d'une liste de flux detectee par feedfinder : menu
24 if (preg_match(',^select: (.+),', $url_syndic, $regs)) {
25 $feeds = explode(' ', $regs[1]);
26 $res .= "<select name='$name' id='$id'>\n";
27 foreach ($feeds as $feed) {
28 $res .= '<option value="' . entites_html($feed) . '">' . $feed . "</option>\n";
29 }
30 $res .= "</select>\n";
31 } else {
32 $res .= "<input type='text' class='text' name='$name' id='$id' value=\"$url_syndic\" size='40' />\n";
33 }
34
35 return $res;
36 }