[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / exec / tourner.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2011 *
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 // http://doc.spip.org/@exec_tourner_dist
16 function exec_tourner_dist()
17 {
18 exec_tourner_args(intval(_request('id_document')), _request('type'), intval(_request('id')));
19 }
20
21 // http://doc.spip.org/@exec_tourner_args
22 function exec_tourner_args($id_document, $type, $id)
23 {
24 if (!$id_document OR !($type == 'article'
25 ? autoriser('modifier','article',$id)
26 : autoriser('publierdans','rubrique',$id))) {
27 include_spip('inc/minipres');
28 echo minipres();
29 } else {
30 include_spip('inc/actions');
31 $tourner = charger_fonction('tourner', 'inc');
32 ajax_retour($tourner($id_document, array(), _request('script'), 'ajax', $type));
33 }
34 }
35
36 ?>