1 | <?php |
---|
2 | // |
---|
3 | // ajout bouton |
---|
4 | $p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__)))); |
---|
5 | define('_DIR_PLUGIN_MALETTRE',(_DIR_PLUGINS.end($p))); |
---|
6 | |
---|
7 | function malettre_ajouterBoutons($boutons_admin) { |
---|
8 | // si on est admin (deactive) |
---|
9 | if ($GLOBALS['connect_statut'] == "0minirezo" && $GLOBALS["connect_toutes_rubriques"]) { // admin full |
---|
10 | // on voit le bouton dans la barre "naviguer" |
---|
11 | $boutons_admin['naviguer']->sousmenu['malettre']= new Bouton( |
---|
12 | "../"._DIR_PLUGIN_MALETTRE."/img/icon_malettre.png", // icone |
---|
13 | _T("malettre:ma_lettre") // titre |
---|
14 | ); |
---|
15 | } |
---|
16 | return $boutons_admin; |
---|
17 | } |
---|
18 | |
---|
19 | // |
---|
20 | // functions |
---|
21 | function malettre_get_contents($patron,$id_edito=0,$selection,$lang) { |
---|
22 | // inspi: spip-listes: exec/import_patron.php (merci booz) |
---|
23 | $date = date('Y-m-d'); |
---|
24 | |
---|
25 | $contexte_patron = array('date' => $date, |
---|
26 | 'id_edito'=>$id_edito, |
---|
27 | 'selection'=>$selection, |
---|
28 | 'lang'=>$lang); |
---|
29 | // on utilise recupere_page et pas recupere fond pour eviter d'avoir des adresses privees (redirect) |
---|
30 | $url = generer_url_public("$patron",'',true); |
---|
31 | foreach ($contexte_patron as $k=>$v) |
---|
32 | $url = parametre_url($url,$k,$v,'&'); |
---|
33 | $texte_patron = recuperer_page($url) ; |
---|
34 | |
---|
35 | // passer tout ca en unicode pour eviter certains problemes |
---|
36 | //include_spip('inc/charsets'); |
---|
37 | //$texte_patron = charset2unicode($texte_patron); |
---|
38 | |
---|
39 | return $texte_patron; |
---|
40 | |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | ?> |
---|