Commit ef29af17 authored by Aiguille's avatar Aiguille

add preview button to news edition

parent 5dbe1ed7
......@@ -63,16 +63,19 @@ if ( isset($_REQUEST["id_nouvelle"]) )
}
// Ajout des dates
if ( ($_REQUEST["action"] == "adddate") && $can_edit )
{
if ( $_REQUEST["debut"] && ( $_REQUEST["debut"] < $_REQUEST["fin"] ) )
$news->add_date($_REQUEST["debut"],$_REQUEST["fin"]);
}
// Suppression des dates
else if ( ($_REQUEST["action"] == "delete") && isset($_REQUEST["id_dates_nvl"]) && $can_edit )
{
$news->delete_date($_REQUEST["id_dates_nvl"]);
}
// Suppression de la nouvelle
elseif ( ($_REQUEST["action"] == "delete") && !isset($_REQUEST["id_dates_nvl"]) && $can_edit )
{
if ( $site->is_sure("accueil","Supprimer la nouvelle ?","delnws".$news->id) )
......@@ -83,143 +86,182 @@ elseif ( ($_REQUEST["action"] == "delete") && !isset($_REQUEST["id_dates_nvl"])
"avec succ&egrave;s</p>");
}
}
elseif ( ($_REQUEST["action"] == "save") && $can_edit )
{
$modere = false;
$lieu->load_by_id($_REQUEST["id_lieu"]);
if ( $_REQUEST["title"] && $_REQUEST["content"] && $_REQUEST['resume'] )
{
$news->save_news(
$_REQUEST['id_asso'],
$_REQUEST['title'],
$_REQUEST['resume'],
$_REQUEST['content'],
false,null,$_REQUEST["type"],$lieu->id,NEWS_CANAL_SITE);
$news->set_tags($_REQUEST["tags"]);
if ( isset($_REQUEST['automodere']) ) {
if ($site->user->is_in_group("moderateur_site") && $_REQUEST['automodere'] ) {
$news->validate($site->user->id);
nouvelle::expire_cache_content ();
}
}
}
}
if ( $_REQUEST["page"] == "edit" && $can_edit )
// Visualisation d'une nouvelle
if ( $news->id > 0 && $_REQUEST["action"] != "save" && $_REQUEST["page"] != "edit")
{
$site->start_page ("services", $news->titre);
$cts = new contents("Editer");
$frm = new form ("editnews","news.php",false,"POST","Edition d'une nouvelle");
$frm->add_hidden("action","save");
$frm->add_hidden("id_nouvelle",$news->id);
$frm->add_info("<b>ATTENTION</b> La nouvelle sera soumise &agrave; nouveau &agrave; mod&eacute;ration");
$frm->add_select_field ("type",
"Type de nouvelle",
array(NEWS_TYPE_APPEL => "Appel/concours",
NEWS_TYPE_EVENT => "Événement ponctuel",
NEWS_TYPE_HEBDO => "Séance hebdomadaire",
NEWS_TYPE_NOTICE => "Info/resultat")
,$news->type);
if ((!$can_edit) && (!$news->modere))
$site->error_forbidden("accueil");
$frm->add_text_field("title", "Titre",$news->titre,true);
$frm->add_entity_select("id_asso", "Association concern&eacute;e", $site->db, "asso",$news->id_asso,true);
$frm->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",$news->id_lieu,true);
$frm->add_text_field("tags", "Tags",$news->get_tags());
$frm->add_text_area ("resume","Resume",$news->resume);
$frm->add_dokuwiki_toolbar('content');
$frm->add_text_area ("content", "Contenu",$news->contenu,80,10,true);
if( $site->user->is_in_group("moderateur_site") )
$frm->add_checkbox("automodere", "<b>Auto-modération</b>", true);
$site->start_page ("accueil", $news->titre);
$site->set_side_boxes("right",array("calendrier","lastnews"),"news_left");
$cts = $news->get_contents();
$frm->add_submit("valid","Enregistrer");
$cts->puts("<div class=\"clearboth\"></div>");
$site->add_contents ($frm);
if ( $site->user->is_in_group("gestion_ae"))
{
$user1 = new utilisateur($site->db);
$user2 = new utilisateur($site->db);
$user1->load_by_id($news->id_utilisateur);
$user2->load_by_id($news->id_utilisateur_moderateur);
$cts->add_title(2,"");
$cts->add_paragraph("Post&eacute; par : ".$user1->get_html_link());
$req = new requete ( $site->db,"SELECT * FROM nvl_dates WHERE id_nouvelle='".$news->id."' ORDER BY date_debut_eve");
if ( $user2->is_valid() )
$cts->add_paragraph("Valid&eacute; par : ".$user2->get_html_link());
}
$cts = new contents("Dates");
$cts->add(new reactonforum ( $site->db, $site->user, $news->titre, array("id_nouvelle"=>$news->id), $news->id_asso, true ));
if ( $req->lines > 0 )
{
$tbl = new sqltable(
"listsalles",
"Liste actuelle", $req, "news.php?page=edit&id_nouvelle=".$news->id,
"id_dates_nvl",
array("date_debut_eve"=>"De","date_fin_eve"=>"Au"),
array("delete"=>"Supprimer"), array(),array()
);
$cts->add($tbl,true);
}
$site->add_contents ($cts);
$frm = new form("selectdateresa","news.php?page=edit&id_nouvelle=".$news->id,false,"POST","Associer une date");
$frm->add_hidden("action","adddate");
$frm->add_datetime_field("debut","Date et heure de d&eacute;but");
$frm->add_datetime_field("fin","Date et heure de fin");
$frm->add_submit("valid","Ajouter");
$cts->add($frm,true);
if ( $can_edit )
{
$cts = new contents("Edition");
$cts->add_paragraph("<a href=\"news.php?page=edit&amp;id_nouvelle=".$news->id."\">Modifier</a> (la nouvelle sera de nouveau soumise &agrave; mod&eacute;ration)");
$cts->add_paragraph("<a href=\"news.php?action=delete&amp;id_nouvelle=".$news->id."\">Supprimer</a>");
$site->add_contents($cts);
}
$site->add_contents($cts);
$site->end_page ();
exit();
}
$site->add_contents (new wikihelp());
$site->end_page ();
// Page d'erreur
if ( !$site->user->is_valid() )
{
header("Location: 403.php?reason=session");
exit();
}
if ( $news->id > 0 )
// Validation ou prévisualisation de la modification d'une nouvelle
elseif ( (($_REQUEST["action"] == "save") && $can_edit) || (isset($_REQUEST["preview"]) && ( $_REQUEST["page"] == "edit") && $can_edit))
{
if ((!$can_edit) && (!$news->modere))
$site->error_forbidden("accueil");
$site->start_page ("accueil", $news->titre);
$site->set_side_boxes("right",array("calendrier","lastnews"),"news_left");
$cts = $news->get_contents();
$cts->puts("<div class=\"clearboth\"></div>");
$modere = false;
$lieu->load_by_id($_REQUEST["id_lieu"]);
if ( $site->user->is_in_group("gestion_ae"))
// Si le formulaire est valide
if ( $_REQUEST["title"] && $_REQUEST["content"] && $_REQUEST['resume'] )
{
$user1 = new utilisateur($site->db);
$user2 = new utilisateur($site->db);
$user1->load_by_id($news->id_utilisateur);
$user2->load_by_id($news->id_utilisateur_moderateur);
$cts->add_title(2,"");
$cts->add_paragraph("Post&eacute; par : ".$user1->get_html_link());
if ( $user2->is_valid() )
$cts->add_paragraph("Valid&eacute; par : ".$user2->get_html_link());
// Prévisualisation de la nouvelle
if (isset($_REQUEST["preview"]))
{
$asso = new asso($site->db);
$asso->load_by_id($_REQUEST["id_asso"]);
$cts = new contents($_REQUEST["title"]);
$img = "data/img/logos/".$asso->nom_unix.".small.png";
if ( !file_exists("/var/www/ae2/".$img) )
$img = "images/default/news.small.png";
$cts->add(new image($asso->nom, $img, "newsimg"));
$cts->add(new wikicontents(false,$_REQUEST["content"]));
if ( $asso->id > 0 )
{
$cts->add_title(2,"");
$cts->add_paragraph($asso->get_html_link());
}
$site->add_contents ($cts);
}
// Sauvegarde de la nouvelle
else
{
$news->save_news(
$_REQUEST['id_asso'],
$_REQUEST['title'],
$_REQUEST['resume'],
$_REQUEST['content'],
false,null,$_REQUEST["type"],$lieu->id,NEWS_CANAL_SITE);
$news->set_tags($_REQUEST["tags"]);
if ( isset($_REQUEST['automodere']) ) {
if ($site->user->is_in_group("moderateur_site") && $_REQUEST['automodere'] ) {
$news->validate($site->user->id);
nouvelle::expire_cache_content ();
}
}
}
}
$cts->add(new reactonforum ( $site->db, $site->user, $news->titre, array("id_nouvelle"=>$news->id), $news->id_asso, true ));
$site->add_contents ($cts);
if ( $can_edit )
else
{
$cts = new contents("Edition");
$cts->add_paragraph("<a href=\"news.php?page=edit&amp;id_nouvelle=".$news->id."\">Modifier</a> (la nouvelle sera de nouveau soumise &agrave; mod&eacute;ration)");
$cts->add_paragraph("<a href=\"news.php?action=delete&amp;id_nouvelle=".$news->id."\">Supprimer</a>");
$site->add_contents($cts);
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
}
$site->end_page ();
exit();
}
if ( !$site->user->is_valid() )
// Modification d'une nouvelle
if ( $_REQUEST["page"] == "edit" && $can_edit )
{
header("Location: 403.php?reason=session");
exit();
$site->start_page ("services", $news->titre);
$cts = new contents("Editer");
$frm = new form ("editnews","news.php",false,"POST","Edition d'une nouvelle");
if ( $news_error )
$frm->error($news_error);
$frm->add_hidden("page","edit");
$frm->add_hidden("action","save");
$frm->add_hidden("id_nouvelle",$news->id);
$frm->add_info("<b>ATTENTION</b> La nouvelle sera soumise &agrave; nouveau &agrave; mod&eacute;ration");
$frm->add_select_field ("type",
"Type de nouvelle",
array(NEWS_TYPE_APPEL => "Appel/concours",
NEWS_TYPE_EVENT => "Événement ponctuel",
NEWS_TYPE_HEBDO => "Séance hebdomadaire",
NEWS_TYPE_NOTICE => "Info/resultat")
,$news->type);
$frm->add_text_field("title", "Titre",$news->titre,true);
$frm->add_entity_select("id_asso", "Association concern&eacute;e", $site->db, "asso",$news->id_asso,true);
$frm->add_entity_select("id_lieu", "Lieu", $site->db, "lieu",$news->id_lieu,true);
$frm->add_text_field("tags", "Tags",$news->get_tags());
$frm->add_text_area ("resume","Resume",$news->resume);
$frm->add_dokuwiki_toolbar('content');
$frm->add_text_area ("content", "Contenu",$news->contenu,80,10,true);
if( $site->user->is_in_group("moderateur_site") )
$frm->add_checkbox("automodere", "<b>Auto-modération</b>", true);
$frm->add_submit ("preview","Pr&eacute;visualiser");
$frm->add_submit("valid","Enregistrer");
$site->add_contents ($frm);
$req = new requete ( $site->db,"SELECT * FROM nvl_dates WHERE id_nouvelle='".$news->id."' ORDER BY date_debut_eve");
$cts = new contents("Dates");
if ( $req->lines > 0 )
{
$tbl = new sqltable(
"listsalles",
"Liste actuelle", $req, "news.php?page=edit&id_nouvelle=".$news->id,
"id_dates_nvl",
array("date_debut_eve"=>"De","date_fin_eve"=>"Au"),
array("delete"=>"Supprimer"), array(),array()
);
$cts->add($tbl,true);
}
$frm = new form("selectdateresa","news.php?page=edit&id_nouvelle=".$news->id,false,"POST","Associer une date");
$frm->add_hidden("action","adddate");
$frm->add_datetime_field("debut","Date et heure de d&eacute;but");
$frm->add_datetime_field("fin","Date et heure de fin");
$frm->add_submit("valid","Ajouter");
$cts->add($frm,true);
$site->add_contents($cts);
$site->add_contents (new wikihelp());
$site->end_page ();
exit();
}
require_once($topdir."include/entities/files.inc.php");
require_once($topdir."include/entities/folder.inc.php");
......@@ -229,135 +271,136 @@ $site->start_page ("accueil", "Accueil Nouvelles");
$suitable = false;
// Si la nouvelle à été soumise ou s'il y a prévisualisation
if ( isset($_REQUEST["preview"]) || isset($_REQUEST["submit"]) )
{
if ( isset($_FILES['affiche_file']) && $_FILES['affiche_file']['error'] == 0 )
{
$asso = new asso($site->db);
$asso->load_by_id($_REQUEST["id_asso"]);
$folder= new dfolder ($site->db, $site->dbrw);
$folder->create_or_load ( "Affiches", $asso->id );
if ( $folder->is_valid() )
{
$file->herit($folder);
$file->id_utilisateur = $site->user->id;
$file->add_file ( $_FILES["affiche_file"], $_REQUEST["title"], $folder->id, "Affiche de ".$_REQUEST["title"], $asso->id );
}
else
$news_error = "Erreur interne lors de la creation du dossier \"Affiches\".";
}
elseif ( $_FILES['affiche_file']['error'] != UPLOAD_ERR_NO_FILE )
$news_error = "Erreur lors du transfert de l'affiche.";
elseif ( isset($_REQUEST["id_file"]) )
$file->load_by_id($_REQUEST["id_file"]);
if ( $file->is_valid() )
{
$_REQUEST["content"] = str_replace("{{@affiche|","{{dfile://".$file->id."/preview|",$_REQUEST["content"]);
$_REQUEST["content"] = str_replace("[[@affiche|","[[dfile://".$file->id."]",$_REQUEST["content"]);
if ( !ereg("\{\{dfile\:\/\/([0-9]*)\/preview\|(.*)\}\}",$_REQUEST["content"]) )
{
$_REQUEST["content"] .= "\n\n{{dfile://".$file->id."/preview|Affiche}}\n\n[[dfile://".$file->id."|Version HD de l'affiche]]";
}
}
if ( !$_REQUEST["title"] || !$_REQUEST["content"] || !$_REQUEST['resume'] )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 3 &&
(!$_REQUEST["t3_debut"] || !$_REQUEST["t3_fin"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 1 &&
(!$_REQUEST["t1_debut"] || !$_REQUEST["t1_fin"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 2 &&
(!$_REQUEST["t2_debut"] || !$_REQUEST["t2_fin"] || !$_REQUEST["t2_until"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 3 && ( $_REQUEST["t3_debut"] >= $_REQUEST["t3_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 1 && ( $_REQUEST["t1_debut"] >= $_REQUEST["t1_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 2 && ( $_REQUEST["t2_debut"] >= $_REQUEST["t2_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 2 && ( $_REQUEST["t2_fin"] >= $_REQUEST["t2_until"] ) )
$news_error = "Dates invalides";
elseif ( $_REQUEST["type"] == 2 && $_REQUEST["seldates"] != 1 )
{
$h = intval(date("H",$_REQUEST["t2_debut"]));
for($debut=$_REQUEST["t2_debut"];$debut<$_REQUEST["t2_until"];$debut+=60*60*24*7)
{
$debut += ($h-intval(date("H",$debut)))*(60*60);
$fin = $debut+($_REQUEST["t2_fin"]-$_REQUEST["t2_debut"]);
$_REQUEST["t2_dates"]["$debut:$fin"] = true;
}
}
elseif ( $_REQUEST["type"] == 1 && $_REQUEST["t1_vpi"] != 1 )
$news_error = "Veuillez vérifier avec la salle avec le VPI avant de poster la nouvelle";
elseif ( $_REQUEST["type"] == 2 && $_REQUEST["t2_vpi"] != 1 )
$news_error = "Veuillez vérifier avec la salle avec le VPI avant de poster la nouvelle";
elseif ( $_REQUEST["type"] == 1 && $_REQUEST["t1_doublon"] != 1 )
$news_error = "Veuillez vérifier qu'il n'y a pas de doublon avant de poster la nouvelle";
else
$suitable = true;
// Gestion du fichier
if ( isset($_FILES['affiche_file']) && $_FILES['affiche_file']['error'] == 0 )
{
$asso = new asso($site->db);
$asso->load_by_id($_REQUEST["id_asso"]);
$folder= new dfolder ($site->db, $site->dbrw);
$folder->create_or_load ( "Affiches", $asso->id );
if ( $folder->is_valid() )
{
$file->herit($folder);
$file->id_utilisateur = $site->user->id;
$file->add_file ( $_FILES["affiche_file"], $_REQUEST["title"], $folder->id, "Affiche de ".$_REQUEST["title"], $asso->id );
}
else
$news_error = "Erreur interne lors de la creation du dossier \"Affiches\".";
}
elseif ( $_FILES['affiche_file']['error'] != UPLOAD_ERR_NO_FILE )
$news_error = "Erreur lors du transfert de l'affiche.";
elseif ( isset($_REQUEST["id_file"]) )
$file->load_by_id($_REQUEST["id_file"]);
if ( $file->is_valid() )
{
$_REQUEST["content"] = str_replace("{{@affiche|","{{dfile://".$file->id."/preview|",$_REQUEST["content"]);
$_REQUEST["content"] = str_replace("[[@affiche|","[[dfile://".$file->id."]",$_REQUEST["content"]);
if ( !ereg("\{\{dfile\:\/\/([0-9]*)\/preview\|(.*)\}\}",$_REQUEST["content"]) )
{
$_REQUEST["content"] .= "\n\n{{dfile://".$file->id."/preview|Affiche}}\n\n[[dfile://".$file->id."|Version HD de l'affiche]]";
}
}
// Vérification des champs du formulaire
if ( !$_REQUEST["title"] || !$_REQUEST["content"] || !$_REQUEST['resume'] )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 3 &&
(!$_REQUEST["t3_debut"] || !$_REQUEST["t3_fin"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 1 &&
(!$_REQUEST["t1_debut"] || !$_REQUEST["t1_fin"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 2 &&
(!$_REQUEST["t2_debut"] || !$_REQUEST["t2_fin"] || !$_REQUEST["t2_until"]) )
$news_error = "Un ou plusieurs champs obligatoires n'ont pas &eacute;t&eacute; remplis";
elseif ( $_REQUEST["type"] == 3 && ( $_REQUEST["t3_debut"] >= $_REQUEST["t3_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 1 && ( $_REQUEST["t1_debut"] >= $_REQUEST["t1_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 2 && ( $_REQUEST["t2_debut"] >= $_REQUEST["t2_fin"] ) )
$news_error = "Date de debut et date de fin erron&eacute;s";
elseif ( $_REQUEST["type"] == 2 && ( $_REQUEST["t2_fin"] >= $_REQUEST["t2_until"] ) )
$news_error = "Dates invalides";
elseif ( $_REQUEST["type"] == 2 && $_REQUEST["seldates"] != 1 )
{
$h = intval(date("H",$_REQUEST["t2_debut"]));
for($debut=$_REQUEST["t2_debut"];$debut<$_REQUEST["t2_until"];$debut+=60*60*24*7)
{
$debut += ($h-intval(date("H",$debut)))*(60*60);
$fin = $debut+($_REQUEST["t2_fin"]-$_REQUEST["t2_debut"]);
$_REQUEST["t2_dates"]["$debut:$fin"] = true;
}
}
elseif ( $_REQUEST["type"] == 1 && $_REQUEST["t1_vpi"] != 1 )
$news_error = "Veuillez vérifier avec la salle avec le VPI avant de poster la nouvelle";
elseif ( $_REQUEST["type"] == 2 && $_REQUEST["t2_vpi"] != 1 )
$news_error = "Veuillez vérifier avec la salle avec le VPI avant de poster la nouvelle";
elseif ( $_REQUEST["type"] == 1 && $_REQUEST["t1_doublon"] != 1 )
$news_error = "Veuillez vérifier qu'il n'y a pas de doublon avant de poster la nouvelle";
else
$suitable = true;
}
// Validation de l'ajout d'une nouvelle
if ( $suitable && isset($_REQUEST["submit"]) )
{
$lieu->load_by_id($_REQUEST["id_lieu"]);
$news->add_news($site->user->id,
$_REQUEST['id_asso'],
$_REQUEST['title'],
$_REQUEST['resume'],
$_REQUEST['content'],
$_REQUEST['type'],$lieu->id,NEWS_CANAL_SITE);
$news->set_tags($_REQUEST["tags"]);
if ( $_REQUEST["type"] == 3 )
$news->add_date($_REQUEST["t3_debut"],$_REQUEST["t3_fin"]);
elseif ( $_REQUEST["type"] == 1 )
$news->add_date($_REQUEST["t1_debut"],$_REQUEST["t1_fin"]);
elseif ( $_REQUEST["type"] == 2 )
{
foreach ( $_REQUEST["t2_dates"] as $seq => $on )
{
list($debut,$fin)=explode(":",$seq);
$news->add_date($debut,$fin);
}
}
if ( isset($_REQUEST['automodere']) ) {
if ($site->user->is_in_group("moderateur_site") && $_REQUEST['automodere']) {
$news->validate($site->user->id);
nouvelle::expire_cache_content ();
}
}
unset($_REQUEST["dates"]);
unset($_REQUEST["debut"]);
unset($_REQUEST["fin"]);
unset($_REQUEST["id_asso"]);
unset($_REQUEST["title"]);
unset($_REQUEST["resume"]);
unset($_REQUEST["content"]);
unset($_REQUEST["type"]);
$site->add_contents(new contents("Ajout de nouvelles",
"<p>Votre nouvelle a &eacute;t&eacute; ajout&eacute;e ".
"avec succ&egrave;s</p>"));
$lieu->load_by_id($_REQUEST["id_lieu"]);
$news->add_news($site->user->id,
$_REQUEST['id_asso'],
$_REQUEST['title'],
$_REQUEST['resume'],
$_REQUEST['content'],
$_REQUEST['type'],$lieu->id,NEWS_CANAL_SITE);
$news->set_tags($_REQUEST["tags"]);
if ( $_REQUEST["type"] == 3 )
$news->add_date($_REQUEST["t3_debut"],$_REQUEST["t3_fin"]);
elseif ( $_REQUEST["type"] == 1 )
$news->add_date($_REQUEST["t1_debut"],$_REQUEST["t1_fin"]);
elseif ( $_REQUEST["type"] == 2 )
{
foreach ( $_REQUEST["t2_dates"] as $seq => $on )
{
list($debut,$fin)=explode(":",$seq);
$news->add_date($debut,$fin);
}
}
if ( isset($_REQUEST['automodere']) ) {
if ($site->user->is_in_group("moderateur_site") && $_REQUEST['automodere']) {
$news->validate($site->user->id);
nouvelle::expire_cache_content ();
}
}
unset($_REQUEST["dates"]);
unset($_REQUEST["debut"]);
unset($_REQUEST["fin"]);
unset($_REQUEST["id_asso"]);
unset($_REQUEST["title"]);
unset($_REQUEST["resume"]);
unset($_REQUEST["content"]);
unset($_REQUEST["type"]);
$site->add_contents(new contents("Ajout de nouvelles",
"<p>Votre nouvelle a &eacute;t&eacute; ajout&eacute;e ".
"avec succ&egrave;s</p>"));
}
// Prévisualisation d'une nouvelle
if ( $suitable && isset($_REQUEST["preview"]) )
{
$asso = new asso($site->db);
......@@ -404,6 +447,7 @@ elseif ( !isset($_REQUEST["preview"]) )
$site->add_contents($page->get_contents());
}
// Formulaire d'ajout d'une nouvelle
$frm = new form ("addnews_frm","news.php",false,"POST","Proposition d'une nouvelle");
if ( $news_error )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment