* @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->isSuperAdmin()) ReloadIndex('admin'); //////////// include_once("../lib/input_helpers.php"); include_once(override('../level/mysql.inc.php', THEME_ADMIN_PATH)); ?>
GetSessionElement('login'); $mask_statut_P=''; $mask_statut_D="checked=\"checked\""; $publication_object= new publication; if(isset($_POST['enregistrer'])) { $data_table=unserialize(urldecode($_POST['data_table'])); $result=$publication_object->AddPublication($data_table, $sql_object); // if attached tags are provided we store them in db if(!empty($data_table['7']) && is_numeric($result)) { include_once('../class/class.tag.php'); $otag = new tag(); $otag->addTags('publication', $result, $data_table['7']); } $link_confirm="confirm.php?rub=".$rub."&todo=".$todo; if(is_numeric($result)) header("Location: ".safe_redirect($link_confirm)); else system_error(); } if(isset($_POST['valider'])) { $table = array(); $table[0]=$_POST['publi_title']; $table[1]=$_POST['publi_resume']; $table[2]=$_POST['publi_level']; $table[3]=$_POST['publi_scale']; $table[4]=$_POST['publi_author']; $table[5]=$_POST['publi_comment']; $table[6]=$_POST['publi_statut']; $table[7]=$_POST['publi_tags']; $integrity=$publication_object->CheckDataIntegrity($table, $sql_object); if(is_string($integrity)) { $text_format='2FIELD'; } else { $text_format='2HTML'; $table[4]=$integrity['user_id']; } $form_title=formatText($_POST['publi_title'], $text_format); $form_resume=formatText($_POST['publi_resume'], $text_format); $form_level=$_POST['publi_level']; $form_scale=$_POST['publi_scale']; $form_author=formatText($_POST['publi_author'], $text_format); $form_comment=formatText($_POST['publi_comment'], $text_format); $form_tags=formatText($_POST['publi_tags'], $text_format); if($_POST['publi_statut']=='D') $mask_statut_D="checked=\"checked\""; else $mask_statut_D=''; if($_POST['publi_statut']=='P') $mask_statut_P="checked=\"checked\""; else $mask_statut_P=''; $table=urlencode(serialize($table)); } if(!isset($integrity) || is_string($integrity)) { // select-box des niveaux $data=$sql_object->DBSelect(SQL_getLevelsList()); $select_level=LevelSelectBox($data, "publi_level", $form_level); // select-box des échelles $data=$sql_object->DBSelect($req_list_scale); $select_scale=ScaleSelectBox($data, "publi_scale", $form_scale); } ?>