Source for file add.php
Documentation is available at add.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 ////////////
<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>
$mask_statut_P= "checked=\"checked\"";
if(isset ($_POST['enregistrer'])) {
$result= $news_object->AddNews($data_table, $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo;
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[8]= ''; // date de péremption
$table[9]= 'N'; // is_national
$table[10]= $_POST['news_statut'];
$integrity= $news_object->CheckDataIntegrity($table);
$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'];
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= '';
if(!isset ($integrity) || is_string($integrity)) {
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);
include_once(THEME_ADMIN_PATH. "quickicons.php");
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<form id="addnews" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="news_title"> <?php echo _t('news','title'); ?> : *</label>
<input name="news_title" type="text" maxlength="200" id="news_title" class="textfield" 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; ?>
<div class="label"> <?php echo _t('news','statut'); ?> : </div>
<input name="news_statut" type="radio" id="statut_P" value="P" <?php echo $mask_statut_P; ?> /><label for="statut_P"> <?php echo _t('statut','public'); ?></label>
<input name="news_statut" type="radio" id="statut_D" value="D" <?php echo $mask_statut_D; ?> /><label for="statut_D"> <?php echo _t('statut','draft'); ?></label>
<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'], '2HTML');
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $scale_denomination= formatText($result[0]['scale_denomination'], '2HTML');
$result= $sql_object->DBSelect($requete);
if($result== 0 || count($result)!= 1) exit;
else $level_denomination= formatText($result[0]['level_name'], '2HTML');
}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="addscale" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<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>
|