[SPIP] ~2.1.12 -->2.1.25
[velocampus/web/www.git] / www / ecrire / exec / synchro.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 include_spip('inc/presentation');
16 include_spip('inc/acces'); // pour low_sec (iCal)
17
18 // http://doc.spip.org/@afficher_liens_calendrier
19 function afficher_liens_calendrier($lien, $icone, $texte) {
20
21 global $spip_display;
22 $charge = icone_horizontale_display(_T('ical_methode_http'), $lien, "calendrier-24.gif","", false);
23 $abonne = icone_horizontale_display (_T('ical_methode_webcal'), preg_replace("@https?://@", "webcal://", $lien), "calendrier-24.gif", "", false);
24
25 echo debut_cadre_enfonce($icone, true);
26 echo $texte;
27 if ($spip_display == 4)
28 echo $charge,$abonne;
29 else {
30 echo "<table style='width: 100%;'><tr><td style='width: 200px;'>";
31 echo $charge;
32 echo "</td>";
33 echo "<td> &nbsp; </td>";
34 echo "<td style='width: 200px;'>";
35 echo $abonne;
36 echo "</td></tr></table>";
37 }
38 echo fin_cadre_enfonce(true);
39 }
40
41 // http://doc.spip.org/@exec_synchro_dist
42 function exec_synchro_dist()
43 {
44 ///// debut de la page
45 $commencer_page = charger_fonction('commencer_page', 'inc');
46 echo $commencer_page(_T("icone_suivi_activite"), "accueil", "synchro");
47
48 echo "<br /><br />";
49 echo gros_titre(_T("icone_suivi_activite"),'', false);
50
51 echo debut_gauche('', true);
52
53 echo debut_boite_info(true);
54
55 echo "<div class='verdana2'>";
56
57 echo _T('ical_info1').'<br /><br />';
58
59 echo _T('ical_info2', array('spipnet' => $GLOBALS['home_server']
60 . '/' . $GLOBALS['spip_lang']
61 . '_suivi'));
62
63 echo "</div>";
64
65 echo fin_boite_info(true);
66
67 $adresse_suivi_inscription=$GLOBALS['meta']["adresse_suivi_inscription"];
68
69 echo debut_droite('', true);
70
71
72 ///
73 /// Suivi par mailing-list
74 ///
75
76 if ($GLOBALS['meta']["suivi_edito"] == "oui" AND strlen($GLOBALS['meta']["adresse_suivi"]) > 3 AND strlen($adresse_suivi_inscription) > 3) {
77 echo debut_cadre_enfonce("racine-site-24.gif", true, "", _T('ical_titre_mailing'));
78 echo _T('info_config_suivi_explication'),
79 propre("<b style='text-align: center'>[->$adresse_suivi_inscription]</b>");
80 echo fin_cadre_enfonce(true);
81 }
82
83
84 ///
85 /// Suivi par agenda iCal (taches + rendez-vous)
86 ///
87
88 echo debut_cadre_relief("agenda-24.gif", true, "", _T('icone_calendrier'));
89
90 echo _T('calendrier_synchro');
91 echo '<p>'._T('ical_info_calendrier').'</p>';
92
93 $id_auteur = $GLOBALS['visiteur_session']['id_auteur'];
94
95 afficher_liens_calendrier(generer_url_public('ical'),'', _T('ical_texte_public'));
96
97 afficher_liens_calendrier(generer_url_public("ical_prive", "id_auteur=$id_auteur&arg=".afficher_low_sec($id_auteur,'ical')),'cadenas-24.gif', _T('ical_texte_prive'));
98
99 echo fin_cadre_relief(true);
100
101 ///
102 /// Suivi par RSS
103 ///
104
105 echo debut_cadre_relief("site-24.gif", true, "", _T('ical_titre_rss'));
106
107 echo _T('ical_texte_rss');
108
109 echo "<p>"._T("ical_texte_rss_articles")."</p>";
110
111 echo propre("<cadre>" . generer_url_public('backend') . "</cadre>");
112
113 echo "<p>"._T("ical_texte_rss_articles2")."</p>";
114
115 $bouton = http_img_pack( 'feed.png', 'RSS', '');
116
117 $result = sql_allfetsel("id_rubrique, titre", "spip_rubriques", 'id_parent=0','', '0+titre,titre');
118
119 $res = '';
120 foreach($result as $row){
121 $h = generer_url_public('backend', "id_rubrique=" . $row['id_rubrique']);
122 $titre_rubrique = typo($row['titre']);
123 $titre = htmlspecialchars($titre_rubrique);
124
125 $res .= "\n<li><a href='$h' title=\"$titre\">$bouton&nbsp; $titre_rubrique</a></li>";
126 }
127
128 if ($res) echo "\n<ul>", $res, "\n</ul>";
129
130 if ($GLOBALS['meta']['activer_breves'] == "oui") {
131
132 echo "<p>"._T("ical_texte_rss_breves")."</p>";
133 echo "<ul><li><a href='",
134 generer_url_public('backend-breves', ""),
135 "' title=\"",
136 _T('ical_lien_rss_breves'),
137 "\">",
138 $bouton,
139 '&nbsp; ' . _T('ical_lien_rss_breves'),
140 "</a></li></ul>";
141
142 }
143
144 echo fin_cadre_relief(true);
145
146 ///
147 /// Suivi par Javascript
148 ///
149
150 echo debut_cadre_relief("doc-24.gif", true, "", _T('ical_titre_js'));
151
152 echo _T('ical_texte_js').'<br />';
153
154 echo propre('<code>
155 <script
156 type="text/javascript"
157 src="'.generer_url_public('distrib').'">
158 </script>
159 </code>');
160
161 echo fin_cadre_relief(true);
162
163
164 echo fin_gauche(), fin_page();
165 }
166 ?>