Source for file mod.php
Documentation is available at mod.php
* @package linea21.modules
* @author linea21 <info@linea21.com>
* @license http://opensource.org/licenses/gpl-3.0.html
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
if (isset ($_GET['id'])) $id= $_GET['id'];
if (isset ($_POST['id'])) $id= $_POST['id'];
if(isset ($_POST['enregistrer'])) {
$result= $news_object->ModifyNews($id, $data_table, $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo;
if($result) header("Location: ". $link_confirm);
// Titre de l'actu en cours de modification
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $news_current_title= formatText($result[0]['news_title'],'2HTML');
// Obtention des données de la BDD
$result= $sql_object->DBSelect($req_det);
if($result== 0 || count($result)!= 1) exit;
$form_title= formatText($result[0]['news_title'], '2FIELD');
$form_header= formatText($result[0]['news_header'], '2FIELD');
$form_body= formatText($result[0]['news_body'], '2FIELD');
$form_theme= $result[0]['news_theme'];
$form_scale= $result[0]['news_scale'];
$form_level= $result[0]['news_level'];
$form_statut= $result[0]['news_statut'];
$current_statut= $result[0]['news_statut'];
$news_owner = $result[0]['news_posted_by'];
//////////// Check Droits utilisateur ////////////
if(isset ($_POST['valider'])) {
$table[0]= $_POST['news_title'];
$table[1]= $_POST['news_header'];
$table[2]= $_POST['news_body'];
$table[3]= $_POST['news_theme'];
$table[4]= $_POST['news_scale'];
$table[5]= $_POST['news_level'];
$table[6]= $_POST['news_statut'];
$integrity= $news_object->CheckDataIntegrity($table);
if(is_string($integrity)) $text_format= '2FIELD';
else $text_format= '2HTML';
$form_title= formatText($_POST['news_title'],$text_format);
$form_header= formatText($_POST['news_header'], $text_format);
$form_body= formatText($_POST['news_body'], $text_format);
$form_theme= $_POST['news_theme'];
$form_scale= $_POST['news_scale'];
$form_level= $_POST['news_level'];
$form_statut= $_POST['news_statut'];
if($_POST['news_statut']== 'D') $mask_statut_D= "checked=\"checked\""; else $mask_statut_D= '';
if($_POST['news_statut']== 'P') $mask_statut_P= "checked=\"checked\""; else $mask_statut_P= '';
include_once("../lib/input_helpers.php");
$data= $sql_object->DBSelect($req_list_theme);
// select-box des échelles
$data= $sql_object->DBSelect($req_list_scale);
// select-box des niveaux
$data= $sql_object->DBSelect($req_list_level);
if($form_statut== 'P') $mask_archive_P= ' selected="selected"';
if($form_statut== 'D') $mask_archive_D= ' selected="selected"';
if($form_statut== 'AA') $mask_archive_AA= ' selected="selected"';
if($form_statut== 'PA') $mask_archive_PA= ' selected="selected"';
$select_statut= "<select name=\"news_statut\" id=\"news_statut\">\n";
$select_statut.= "<option value=\"P\"". $mask_archive_P. ">". display_statut('P'). "</option>\n";
$select_statut.= "<option value=\"D\"". $mask_archive_D. ">". display_statut('D'). "</option>\n";
$select_statut.= "<option value=\"AA\"". $mask_archive_AA. ">". display_statut('AA'). "</option>\n";
$select_statut.= "<option value=\"PA\"". $mask_archive_PA. ">". display_statut('PA'). "</option>\n";
$select_statut.= "</select>\n";
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home'); ?></a>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>"
class="chemin_rub"> <?php echo _t('menu','news');?></a></li>
<li><span> <?php echo formatNavTitle(_t('news','mod'). ' : '. $news_current_title); ?></span>
include_once(THEME_ADMIN_PATH. "quickicons.php");
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<form id="modnews" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="news_title"> <?php echo _t('news','title'); ?> : *</label>
<input name="news_title" type="text" class="textfield" maxlength="200" id="news_title" value=" <?php echo $form_title; ?>" />
<label for="news_header"> <?php echo _t('news','header'); ?> : *</label>
<textarea id="news_header" name="news_header" class="largetextfield" <?php echo AREA_SETTINGS; ?>> <?php echo $form_header; ?></textarea>
<label for="news_body"> <?php echo _t('news','body'); ?> : *</label>
<textarea id="news_body" name="news_body" class="largetextfield" <?php echo AREA_SETTINGS; ?>> <?php echo $form_body; ?></textarea>
<label for="news_theme"> <?php echo _t('news','theme'); ?> : *</label>
<?php echo $select_theme; ?>
<label for="news_scale"> <?php echo _t('news','scale'); ?> : *</label>
<?php echo $select_scale; ?>
<label for="news_level"> <?php echo _t('news','level'); ?> : </label>
<?php echo $select_level; ?>
<label for="news_statut"> <?php echo _t('news','statut'); ?> : </label>
<?php echo $select_statut; ?>
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="valider" type="submit" value=" <?php echo _t('btn','valid'); ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $theme_denomination= formatText($result[0]['theme_name']);
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $scale_denomination= formatText($result[0]['scale_denomination']);
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $level_denomination= formatText($result[0]['level_name']);
} else $level_denomination= _t('divers','none');
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
echo "<dl class=\"dl3\">\n";
echo "<dt>". _t('news','title'). "</dt>\n";
echo "<dd>". $form_title. "</dd>\n";
echo "<dt>". _t('news','header'). "</dt>\n";
echo "<dt>". _t('news','body'). " :</dt>\n";
echo "<dt>". _t('news','theme'). " :</dt>\n";
echo "<dd>". $theme_denomination. "</dd>\n";
echo "<dt>". _t('news','scale'). " :</dt>\n";
echo "<dd>". $scale_denomination. "</dd>\n";
echo "<dt>". _t('news','level'). " :</dt>\n";
echo "<dd>". $level_denomination. "</dd>\n";
echo "<dt>". _t('divers','statut') . "</dt>\n";
<form id="modscale" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<input name="id" type="hidden" value=" <?php echo $id; ?>" id="id" />
<input name="rub" type="hidden" value=" <?php echo $rub; ?>" id="rub" />
<input name="todo" type="hidden" value=" <?php echo $todo; ?>" id="todo" />
<input name="data_table" type="hidden" value=" <?php echo $table; ?>" id="data_table" />
<input name="retour" type="button" value=" <?php echo _t('btn','preview'); ?>" class="button" id="retour" onclick="history.go(-1);" />
<input name="enregistrer" type="submit" value=" <?php echo _t('btn','save'); ?>" class="button" id="valider" />
<?php include_once($dir. "/help.php"); ?></div>
|