9bcb3266a94952d5613741200e40e3760c008907
[lhc/web/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")) {
14 return;
15 }
16
17 function action_exporter_bookmarks_dist($arg = null) {
18
19 if (is_null($arg)) {
20 $securiser_action = charger_fonction('securiser_action', 'inc');
21 $arg = $securiser_action();
22 }
23
24 if (autoriser('exporter', '_sites')) {
25 list($id_parent, $exporter_publie_seulement, $exporter_avec_mots_cles) = explode("-", $arg);
26 $statut = ($exporter_publie_seulement ? array('publie') : array('prop', 'publie'));
27
28 $f = "bookmarks-" . date('Y-m-d') . ".html";
29 header('Content-Type: text/html');
30 header("Content-Disposition: attachment; filename=\"$f\";");
31 header("Content-Transfer-Encoding: 8bit");
32
33 // fix for IE catching or PHP bug issue
34 header("Pragma: public");
35 header("Expires: 0"); // set expiration time
36 header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
37 echo recuperer_fond("prive/transmettre/bookmarks",
38 array('statut' => $statut, 'id_parent' => intval($id_parent), 'tags' => $exporter_avec_mots_cles));
39 }
40 }