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
<script type="text/javascript">
$(document).ready( function()
// Autocomplete initialization
var t = new $.TextboxList('#workshop_organizer', {unique: true, plugins: {autocomplete: {onlyFromValues: true}}});
$.ajax({url: '../workshop/_ajax_user_autocomplete.php?type=O', dataType: 'json', success: function(r){
t.plugins['autocomplete'].setValues(r);
include_once("../lib/input_helpers.php");
$mask_statut_D= "checked=\"checked\"";
//////////// Check Inclusion de pages ////////////
include_once("../lib/lib_common.php");
//////////// Check Droits utilisateur ////////////
if(isset ($_POST['enregistrer'])) {
$result= $workshop_object->AddWorkshop($data_table, $sql_object);
$table_organizer= @explode(',',$data_table[6]);
for ($i= 0;$i< count($table_organizer);$i++ ){
$result2= $workshop_object->AddUserWorkshop($result, trim($table_organizer[$i]), "O" , $sql_object);
$link_confirm= "confirm.php?rub=". $rub. "&todo=". $todo;
if(isset ($_POST['valider'])) {
$table[0]= $_POST['workshop_denomination'];
$table[1]= $_POST['workshop_resume'];
$table[2]= $_POST['workshop_theme'];
$table[3]= $_POST['workshop_comment'];
$table[4]= $_POST['workshop_level'];
$table[5]= $_POST['workshop_statut'];
$table[6]= $_POST['workshop_organizer'];
$integrity= $workshop_object->CheckDataIntegrity($table, $sql_object);
$form_denomination= formatText($_POST['workshop_denomination'], $text_format);
$form_resume= formatText($_POST['workshop_resume'], $text_format);
$form_theme= $_POST['workshop_theme'];
$form_level= $_POST['workshop_level'];
$form_comment= formatText($_POST['workshop_comment'], $text_format);
if($_POST['workshop_statut']== 'D') $mask_statut_D= "checked=\"checked\""; else $mask_statut_D= '';
if($_POST['workshop_statut']== 'P') $mask_statut_P= "checked=\"checked\""; else $mask_statut_P= '';
if(!isset ($integrity) || is_string($integrity)) {
$data= $sql_object->DBSelect($req_list_theme);
// select-box des niveaux
$data= $sql_object->DBSelect($req_list_level);
include_once(THEME_ADMIN_PATH. "quickicons.php");
<li><a href="index.php" class="chemin_home"> <?php echo _t('way','home') ?></a></li>
<li><a href=" <?php echo $rub_link; ?>" id="chemin_ <?php echo $rub; ?>" class="chemin_rub"> <?php echo _t('menu','workshop')?></a></li>
<li><span> <?php echo formatnavTitle(_t('workshop','add')); ?></span></li>
if(!isset ($integrity) || is_string($integrity)) {
<div class="contentcontainer"> <?php
include_once($dir. "/menurub.php");
<h2> <?php echo _t('workshop','add_title') ?></h2>
<form id="addworkshop" action=" <?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
<label for="workshop_denomination"> <?php echo _t('workshop','title'); ?> * : </label>
<input name="workshop_denomination" type="text" class="textfield" id="workshop_denomination" maxlength="255" value=" <?php echo $form_denomination; ?>" />
<label for="workshop_resume"> <?php echo _t('workshop','resume'); ?> * : </label>
<textarea id="workshop_resume" name="workshop_resume" <?php echo AREA_SETTINGS; ?> class="largetextfield"> <?php echo $form_resume; ?></textarea>
<label for="workshop_theme"> <?php echo _t('workshop','theme'); ?> * : </label>
<?php echo $select_theme; ?>
<label for="workshop_level"> <?php echo _t('workshop','level'); ?> : </label>
<?php echo $select_level; ?>
<label for="workshop_organizer"> <?php echo _t('workshop','organizer'); ?> * : </label>
<input name="workshop_organizer" type="text" class="textfield" id="workshop_organizer" maxlength="150" value=" <?php echo $form_organizer; ?>" />
<div class="label"> <?php echo _t('workshop','statut'); ?> * : </div>
<input name="workshop_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="workshop_statut" type="radio" id="statut_D" value="D" <?php echo $mask_statut_D; ?> />
<label for="statut_D"> <?php echo _t('statut','draft'); ?></label>
<label for="workshop_comment"> <?php echo _t('workshop','comment'); ?> : </label>
<textarea id="workshop_comment" name="workshop_comment" <?php echo AREA_SETTINGS; ?> class="largetextfield"> <?php echo $form_comment; ?></textarea>
<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 $level_denomination= formatText($result[0]['level_name'], '2HTML');
} else $level_denomination= _t('divers','none');
$display_form_resume= empty_nc($form_resume);
$display_form_comment= empty_nc($form_comment);
<div class="contentcontainer">
include_once($dir. "/menurub.php");
<h2> <?php echo _t('recap','title') ?></h2>
echo "<dl class=\"dl3\">\n";
echo "<dt>". _t('workshop','title'). "</dt>\n";
echo "<dd>". $form_denomination. "</dd>\n";
echo "<dt>". _t('workshop','resume'). "</dt>\n";
echo "<dd>". $display_form_resume. "</dd>\n";
echo "<dt>". _t('workshop','theme'). " :</dt>\n";
echo "<dd>". $theme_denomination. "</dd>\n";
echo "<dt>". _t('workshop','level'). " :</dt>\n";
echo "<dd>". $level_denomination. "</dd>\n";
echo "<dt>". _t('workshop','organizer'). " :</dt>\n";
echo "<dd>". $form_organizer. "</dd>\n";
echo "<dt>". _t('divers','statut') . "</dt>\n";
echo "<dt>". _t('workshop','comment') . "</dt>\n";
echo "<dd>". $display_form_comment. "</dd>\n";
<form id="addworkshop" 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>
|