erreur thunmbail4
[aidenligne_francais_universite.git] / plugins / forms_1_9_1 / forms_filtres.php
CommitLineData
c495c100
P
1<?php
2/*
3 * forms
4 * version plug-in de spip_form
5 *
6 * Auteur :
7 * Antoine Pitrou
8 * adaptation en 182e puis plugin par cedric.morin@yterium.com
9 * © 2005,2006 - Distribue sous licence GNU/GPL
10 *
11 */
12
13include_spip("base/forms");
14include_spip("inc/forms");
15
16//
17// Formulaires
18//
19
20
21 // A reintegrer dans echapper_html()
22 function Forms_forms_avant_propre($texte) {
23 static $reset;
24 //echo "forms_avant_propre::";
25 // Mecanisme de mise a jour des liens
26 $forms = array();
27 $maj_liens = ($_GET['exec']=='articles' AND $id_article = intval($_GET['id_article']));
28 if ($maj_liens) {
29 if (!$reset) {
30 $query = "DELETE FROM spip_forms_articles WHERE id_article=$id_article";
31 spip_query($query);
32 $reset = true;
33 }
34 if (preg_match_all(',<form([0-9]+)([|]([a-z_0-9]+))?'.'>,', $texte, $regs, PREG_SET_ORDER)){
35 foreach ($regs as $r) {
36 $id_form = $r[1];
37 $forms[$id_form] = $id_form;
38 }
39 }
40 if ($forms) {
41 $query = "INSERT INTO spip_forms_articles (id_article, id_form) ".
42 "VALUES ($id_article, ".join("), ($id_article, ", $forms).")";
43 spip_query($query);
44 }
45 }
46
47 return $texte;
48 }
49
50 // Hack crade a cause des limitations du compilateur
51 function _Forms_afficher_reponses_sondage($id_form) {
52 return Forms_afficher_reponses_sondage($id_form);
53 }
54
55 function Forms_affiche_droite($flux){
56 if (_request('exec')=='articles_edit'){
57 $flux['data'] .= Forms_afficher_insertion_formulaire($flux['arg']['id_article']);
58 }
59 return $flux;
60 }
61 /*function Forms_insert_head($flux){
62 $flux .= "<link rel='stylesheet' href='".find_in_path('spip_forms.css')."' type='text/css' media='all' />\n";
63 return $flux;
64 }*/
65 function Forms_header_prive($flux){
66 $flux .= "<link rel='stylesheet' href='"._DIR_PLUGIN_FORMS."spip_forms.css' type='text/css' media='all' />\n";
67 if($GLOBALS['meta']['multi_rubriques']=="oui" || $GLOBALS['meta']['multi_articles']=="oui")
68 $active_langs = "'".str_replace(",","','",$GLOBALS['meta']['langues_multilingue'])."'";
69 else
70 $active_langs = "";
71 $flux .= "<script src='".find_in_path('forms_lang.js')."' type='text/javascript'></script>\n".
72 "<script type='text/javascript'>\n".
73 "var forms_def_lang='".$GLOBALS['meta']['langue_site']."';var forms_avail_langs=[$active_langs];\n".
74 "$(forms_init_lang);\n".
75 "</script>\n";
76
77 return $flux;
78 }
79
80?>