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