Skip to content
Extraits de code Groupes Projets
Valider af1381a6 rédigé par ARNO*'s avatar ARNO*
Parcourir les fichiers

Date de publication des documents passe en optionnel (desactive par defaut)

parent 8a96a818
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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&eacute;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);
}
?>
......@@ -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)),
......
......@@ -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 '';
......
......@@ -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";
}
?>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter