diff --git a/ecrire/configuration/documents.php b/ecrire/configuration/documents.php index 558d84400fd520c5859cceeef76dc92cce3f67d9..6bff2d428c112bdab4b1d8c96548a0947b63eb16 100644 --- a/ecrire/configuration/documents.php +++ b/ecrire/configuration/documents.php @@ -24,6 +24,7 @@ function configuration_documents_dist(){ $documents_rubrique = $GLOBALS['meta']["documents_rubrique"]; $documents_article = $GLOBALS['meta']["documents_article"]; + $documents_date = $GLOBALS['meta']["documents_date"]; $res = "<table border='0' cellspacing='1' cellpadding='3' width=\"100%\">"; $res .= "<tr><td class='verdana2'>"; @@ -40,6 +41,10 @@ function configuration_documents_dist(){ $res .= afficher_choix('documents_rubrique', $documents_rubrique, array('oui' => _T('item_autoriser_documents_joints_rubriques'), 'non' => _T('item_non_autoriser_documents_joints_rubriques')), "<br />\n"); + $res .= "<br /><br />\n"; + $res .= afficher_choix('documents_date', $documents_date, + array('oui' => _L('Pouvoir sélectionner la date de mise en ligne de chaque document'), + 'non' => _L('Ne pas pouvoir changer manuellement la date des documents')), "<br />\n"); $res .= "</td></tr>"; $res .= "</table>\n"; @@ -50,3 +55,5 @@ function configuration_documents_dist(){ return ajax_action_greffe('configurer-documents', '', $res); } ?> + + diff --git a/ecrire/inc/config.php b/ecrire/inc/config.php index a5d6126ee791e518064e8fb4ff37b0e0f1da0d91..bf3c752fd9f0fb9553b988da4c046221002bc4d4 100644 --- a/ecrire/inc/config.php +++ b/ecrire/inc/config.php @@ -83,6 +83,7 @@ function liste_metas() 'documents_article' => 'non', 'documents_rubrique' => 'non', + 'documents_date' => 'non', 'syndication_integrale' => 'oui', 'charset' => _DEFAULT_CHARSET, 'dir_img' => substr(_DIR_IMG,strlen(_DIR_RACINE)), diff --git a/ecrire/inc/documents.php b/ecrire/inc/documents.php index 8317b308dc493781bf142b3581287b4c689ac88d..cc3f38b717d88486e2623276ef3f4d84ed0f0637 100644 --- a/ecrire/inc/documents.php +++ b/ecrire/inc/documents.php @@ -330,7 +330,8 @@ function est_inclus($id_document) { // http://doc.spip.org/@afficher_case_document function afficher_case_document($id_document, $id, $script, $type, $deplier=false) { global $spip_lang_right; - + $documents_date = $GLOBALS['meta']["documents_date"]; + $table = 'spip_documents_' . $type . 's'; $prim = id_table_objet($table); if (!$prim) return ''; diff --git a/ecrire/inc/legender.php b/ecrire/inc/legender.php index 6ad0720a4d76d863bb2a5fb275d180a4141f8396..d70daab27b119398b0ff9dc2772566f72d07408d 100644 --- a/ecrire/inc/legender.php +++ b/ecrire/inc/legender.php @@ -89,7 +89,7 @@ function inc_legender_dist($id_document, $document, $script, $type, $id, $ancre, "<input type='text' name='titre_document' id='titre_document$id_document' class='formo' value=\"".entites_html($titre). "\" size='40' onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\" /><br />\n" . date_formulaire_legender($date, $id_document) . - "<br />\n<label for='descriptif_document$id_document'><b>". + "<label for='descriptif_document$id_document'><b>". _T('info_description_2'). "</b></label><br />\n" . "<textarea name='descriptif_document' id='descriptif_document$id_document' rows='4' class='formo' cols='*' onfocus=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\">" . @@ -231,6 +231,7 @@ function formulaire_taille($document) { // http://doc.spip.org/@date_formulaire_legender function date_formulaire_legender($date, $id_document) { + $documents_date = $GLOBALS['meta']["documents_date"]; if (preg_match(",([0-9]{4})-([0-9]{2})-([0-9]{2}) ([0-9]{2}):([0-9]{2}),", $date, $regs)){ $mois = $regs[2]; @@ -239,13 +240,18 @@ function date_formulaire_legender($date, $id_document) { $heure = $regs[4]; $minute = $regs[5]; } - return "<b>"._T('info_mise_en_ligne')."</b><br />\n" . - afficher_jour($jour, "name='jour_doc' id='jour_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\"") . - afficher_mois($mois, "name='mois_doc' id='mois_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\"") . - afficher_annee($annee, "name='annee_doc' id='annee_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . - afficher_heure($heure, "name='heure_doc' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . - afficher_minute($minute, "name='minute_doc' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . - "<br />\n"; + if ($documents_date != "oui") $style = " style='display: none;'"; + + return "<div $style><b>"._T('info_mise_en_ligne')."</b><br />\n" . + afficher_jour($jour, "name='jour_doc' id='jour_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\"") . + afficher_mois($mois, "name='mois_doc' id='mois_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block');\"") . + afficher_annee($annee, "name='annee_doc' id='annee_doc$id_document' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . + "<br />". + afficher_heure($heure, "name='heure_doc' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . + " : ". + afficher_minute($minute, "name='minute_doc' size='1' class='fondl spip_xx-small'\n\tonchange=\"changeVisible(true, 'valider_doc$id_document', 'block', 'block')\"") . + "<br /><br /></div>\n"; + } ?>