[SPIP] +2.1.12
[velocampus/web/www.git] / www / ecrire / inc / documenter_objet.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/@naviguer_doc
16 function inc_documenter_objet_dist($id, $type = "article", $script, $flag_editable=true) {
17 global $spip_lang_left;
18
19 // Joindre ?
20 if ($GLOBALS['meta']["documents_$type"]=='non'
21 OR !autoriser('joindredocument', $type, $id)
22 OR !$flag_editable)
23 $res = '';
24 else {
25 $joindre = charger_fonction('joindre', 'inc');
26 $res = $joindre(array(
27 'cadre' => 'relief',
28 'icone' => 'image-24.gif',
29 'fonction' => 'creer.gif',
30 'titre' => _T('titre_joindre_document'),
31 'script' => $script,
32 'args' => "id_$type=$id",
33 'id' => $id,
34 'intitule' => _T('info_telecharger_ordinateur'),
35 'mode' => 'document',
36 'type' => $type,
37 'ancre' => '',
38 'id_document' => 0,
39 'iframe_script' => generer_url_ecrire("documenter","id_$type=$id&type=$type",true)
40 ));
41
42 // eviter le formulaire upload qui se promene sur la page
43 // a cause des position:relative incompris de MSIE
44
45 if ($GLOBALS['browser_name']!="MSIE") {
46 $res = "\n<table width='100%' cellpadding='0' cellspacing='0' border='0'>\n<tr><td>&nbsp;</td><td style='text-align: $spip_lang_left;width: 50%;'>\n$res</td></tr></table>";
47 }
48
49 $res .= http_script('',"async_upload.js")
50 . http_script('$("form.form_upload").async_upload(async_upload_portfolio_documents);');
51
52 }
53
54 $documenter = charger_fonction('documenter', 'inc');
55
56 return "<div id='portfolio'>".$documenter($id, $type, 'portfolio', $flag_editable)."</div><br />"
57 ."<div id='documents'>". $documenter($id, $type, 'documents', $flag_editable)."</div>"
58 . $res;
59 }
60
61
62 ?>