* @version $Id$ * @access public * @license http://opensource.org/licenses/gpl-3.0.html */ //////////// Check Inclusion de pages //////////// if (!class_exists('auth')) { include_once("../lib/lib_common.php"); ReloadIndex('admin'); } //////////// //////////// Check Droits utilisateur //////////// if (!$l21auth->hasRight('news')) ReloadIndex('admin'); //////////// ?>
AddNews($data_table, $sql_object); // if attached tags are provided we store them in db if(!empty($data_table['10']) && is_numeric($result)) { include_once('../class/class.tag.php'); $otag = new tag(); $otag->addTags('news', $result, $data_table['10']); } $link_confirm="confirm.php?rub=".$rub."&todo=".$todo; if(is_numeric($result)) header("Location: ".$link_confirm); else system_error(); } 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]=0; //range $table[6]=$l21auth->GetSessionElement('id'); // ID posteur $table[7]=''; // date de péremption $table[8]='N'; // is_national $table[9]=$_POST['news_statut']; $table[10]=$_POST['news_tags']; $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_tags=$_POST['news_tags']; 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=''; $table=urlencode(serialize($table)); } if(!isset($integrity) || is_string($integrity)) { include_once("../lib/input_helpers.php"); // select-box de thèmes $data=$sql_object->DBSelect($req_list_theme); $select_theme=ThemeSelectBox($data, "news_theme", $form_theme); // select-box des échelles $data=$sql_object->DBSelect($req_list_scale); $select_scale=ScaleSelectBox($data, "news_scale", $form_scale); } ?>