[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / plugins-dist / sites / action / exporter_bookmarks.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
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 action_exporter_bookmarks_dist($arg=null){
16
17 if (is_null($arg)){
18 $securiser_action = charger_fonction('securiser_action', 'inc');
19 $arg = $securiser_action();
20 }
21
22 if (autoriser('exporter','_bookmarks')){
23 list($id_parent,$exporter_publie_seulement,$exporter_avec_mots_cles) = explode("-",$arg);
24 $statut = ($exporter_publie_seulement?array('publie'):array('prop','publie'));
25
26 $f = "bookmarks-".date('Y-m-d').".html";
27 header('Content-Type: text/html');
28 header("Content-Disposition: attachment; filename=\"$f\";");
29 header("Content-Transfer-Encoding: 8bit");
30
31 // fix for IE catching or PHP bug issue
32 header("Pragma: public");
33 header("Expires: 0"); // set expiration time
34 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
35 echo recuperer_fond("prive/transmettre/bookmarks",array('statut'=>$statut,'id_parent'=>intval($id_parent),'tags'=>$exporter_avec_mots_cles));
36 }
37 }