source: trunk/spip/esqueleto-redcta/plugins/agenda/1_9_2/agenda.php @ 30

Last change on this file since 30 was 30, checked in by sebas, 17 years ago

nueva importacion del codigo del esqueleto de redcta con los plugins

File size: 3.0 KB
Line 
1<?php
2
3function Agenda_ajouter_onglets($flux) {
4  if($flux['args']=='calendrier')
5  {
6                $flux['data']['evenements']= new Bouton(
7                                                                                                                                 '../'._DIR_PLUGIN_AGENDA.'/img_pack/agenda-24.png', _T('agenda:evenements'),
8                                                                                                                                generer_url_ecrire("calendrier","type=semaine"));
9       
10                $flux['data']['editorial']= new Bouton(
11                                                                                                                         'cal-rv.png', _T('agenda:activite_editoriale'),
12                                                                                                                                 generer_url_ecrire("calendrier","mode=editorial&type=semaine"));
13  }
14        return $flux;
15}
16function Agenda_header_prive($flux) {
17        $exec = _request('exec');
18        // les CSS
19        if ($exec == 'calendrier'){
20                $flux .= '<link rel="stylesheet" href="' ._DIR_PLUGIN_AGENDA . '/img_pack/calendrier.css" type="text/css" />'. "\n";
21                $flux .= '<link rel="stylesheet" href="' ._DIR_PLUGIN_AGENDA . '/img_pack/agenda.css" type="text/css" />'. "\n";
22        }
23        if ($exec == 'articles'){
24                $flux .= '<link rel="stylesheet" href="' ._DIR_PLUGIN_AGENDA . '/img_pack/agenda_articles.css" type="text/css" />'. "\n";
25        }
26
27
28        return $flux;
29}
30
31function Agenda_exec_init($flux) {
32        $exec =  $flux['args']['exec'];
33        if (($exec == 'calendrier')||($exec=='articles')){
34                include_spip('inc/calendar');
35                if (!function_exists('WCalendar_ajoute_lies')){
36                        echo ('Erreur Wcalendar manquant');
37                        return $flux;
38                }
39                // Reserver les widgets agenda
40                WCalendar_ajoute_lies(_T('agenda:evenement_date_debut'),'_evenement_debut',_T('agenda:evenement_date_fin'),'_evenement_fin');
41                WCalendar_ajoute_statique(_T('agenda:evenement_repetitions'),'_repetitions');
42        }
43        return $flux;
44}
45
46function Agenda_affiche_milieu($flux) {
47        $exec =  $flux['args']['exec'];
48        if ($exec=='articles'){
49                include_spip('inc/calendar');
50                include_spip('inc/agenda_gestion');
51                $id_article = $flux['args']['id_article'];
52                $flux['data'] .= Agenda_formulaire_article($id_article, article_editable($id_article),'articles');
53        }
54        return $flux;
55}
56
57function Agenda_rendu_boite($titre,$descriptif,$lieu,$type='ics'){
58        $texte = "<span class='calendrier-verdana10'><span  style='font-weight: bold;'>";
59        $texte .= wordwrap($sum=typo($titre),15)."</span>";
60        $texte .= "<span class='survol'>";
61        $texte .= "<strong>$sum</strong><br />";
62        $texte .= $lieu ? propre($lieu).'<br />':'';
63        $texte .= propre($descriptif);
64        $texte .= "</span>";
65        if ($type=='ics'){     
66                $texte .= (strlen($lieu.$descriptif)?"<hr/>":"").$lieu.(strlen($lieu)?"<br/>":"");
67                $texte .= $descriptif;
68        }
69        $texte .= "</span>";
70
71        return $texte;
72}
73function Agenda_rendu_evenement($flux) {
74        global $couleur_claire;
75        $evenement = $flux['args']['evenement'];
76
77       
78        $url = $evenement['URL']; 
79        $texte = Agenda_rendu_boite($evenement['SUMMARY'],$evenement['DESCRIPTION'],$evenement['LOCATION'],$flux['args']['type']);
80        if (is_string($url))
81                $texte = http_href(quote_amp($url), $texte, '', '', '', '');
82        else if (is_array($url))
83                $texte = ajax_action_auteur(
84                        $url['action'], $url['id'], $url['script'], 
85                        isset($url['args'])?$url['args']:'', 
86                        array($texte,""),
87                        isset($url['args_ajax'])?$url['args_ajax']:'', 
88                        isset($url['fct_ajax'])?$url['fct_ajax']:'');
89       
90        $flux['data'] = $texte;
91        return $flux;
92}
93
94?>
Note: See TracBrowser for help on using the repository browser.