X-Git-Url: http://git.cyclocoop.org/?p=velocampus%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Finc%2Fjoindre.php;fp=www%2Fecrire%2Finc%2Fjoindre.php;h=80012975d53ba4484f7a767cace821d4e592033a;hp=0000000000000000000000000000000000000000;hb=80b4d3e85f78d402ed2e73f8f5d1bf4c19962eed;hpb=aaf970bf4cdaf76689ecc10609048e18d073820c
diff --git a/www/ecrire/inc/joindre.php b/www/ecrire/inc/joindre.php
new file mode 100644
index 0000000..8001297
--- /dev/null
+++ b/www/ecrire/inc/joindre.php
@@ -0,0 +1,217 @@
+".$res."\n";
+ $att = " enctype='multipart/form-data' class='form_upload'";
+ $args = (intval($v['id']) .'/' .intval($v['id_document']) . "/".$v['mode'].'/'.$v['type']);
+ $script = $v['script'];
+
+ // si espace prive, $v a une signification speciale (pas clair)
+ if (test_espace_prive())
+ return redirige_action_post('joindre', $args, $script, $v['args'], $res, $att);
+ else return generer_action_auteur('joindre', $args, $script, $res, "$att method='post'");
+}
+
+// http://doc.spip.org/@joindre_formulaire
+function joindre_formulaire(&$v) {
+ global $spip_lang_right;
+ $depliable = false;
+
+ $mode = $v['mode'];
+ $vignette_de_doc = ($mode == 'vignette' AND $v['id_document']>0);
+ $distant = (($mode == 'document' OR $mode == 'choix') AND $v['type']);
+
+ # indiquer un choix d'upload FTP
+ $dir_ftp = '';
+ if (test_espace_prive()
+ AND ($mode == 'document' OR $mode == 'choix') # si c'est pour un document
+ AND !$vignette_de_doc # pas pour une vignette (NB: la ligne precedente suffit, mais si on la supprime il faut conserver ce test-ci)
+ AND $GLOBALS['flag_upload']) {
+ if ($dir = determine_upload('documents')) {
+ // quels sont les docs accessibles en ftp ?
+ $l = texte_upload_manuel($dir, $mode);
+ // s'il n'y en a pas, on affiche un message d'aide
+ // en mode document, mais pas en mode image
+ if ($l OR ($mode == 'document' OR $mode=='choix'))
+ $dir_ftp = afficher_transferer_upload($l, $dir);
+ }
+ }
+
+ // Add the redirect url when uploading via iframe
+
+ $iframe = "";
+ if($v['iframe_script'])
+ $iframe = "\n";
+
+ // Un menu depliant si on a une possibilite supplementaire
+
+ if ($dir_ftp OR $distant OR $vignette_de_doc) {
+ $bloc = "ftp_". $mode .'_'. intval($v['id_document']);
+
+ if ($vignette_de_doc)
+ $debut = bouton_block_depliable($v['intitule'],false,$bloc);
+ else
+ $debut = $v['intitule'];
+
+ $milieu = debut_block_depliable(false,$bloc);
+ $fin = "\n\t" . fin_block();
+ $v['titre'] = bouton_block_depliable($v['titre'],false,$bloc);
+
+ } else
+ $debut = $milieu = $fin = '';
+
+ // Lien document distant, jamais en mode image
+ if ($distant) {
+ $distant = "
\n