AEOS Calvarium v0.5
This commit is contained in:
parent
57b531cb62
commit
1fa8b9e152
177 changed files with 2936 additions and 3386 deletions
98
modules/owSimple/edition.php
Executable file → Normal file
98
modules/owSimple/edition.php
Executable file → Normal file
|
|
@ -2,67 +2,77 @@
|
|||
/* *************************************
|
||||
Titre: Module Simple
|
||||
Auteur: NNS Production
|
||||
Version: 1.2
|
||||
Version: 1.60
|
||||
----------- Changelog ------------------
|
||||
14/08/2011 - Modification d'une variable défectueuse.
|
||||
05/06/2013 - Changement de la structure pour plus de lisibilité
|
||||
03/10/2018 - Réécriture complète du module
|
||||
13/07/1010 - Réécriture complète du module et changement du WYSIWYG
|
||||
************************************* */
|
||||
if(checkMultilangModuleAvailable(donnee_xml($subdir."modules/".basename(__DIR__)."/config.xml", 'multilang'))) require_once($subdir.'modules/'.basename(__DIR__).'/lang/'.detectLang().".php");
|
||||
|
||||
if (@$_['Send']==1)
|
||||
{
|
||||
if (empty($_['titre']) || $_['titre']=="") echo "<div class='update_valide'><span class='erreur'>Merci d'indiquer un nom de page.</span></div>";
|
||||
if(checkEmptyField($_['titre']))
|
||||
{
|
||||
echo showNotification($lang_owSimple['_incorrectTitle'], 'error', 'icon-emo-unhappy');
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch($_['action'])
|
||||
switch($_['act'])
|
||||
{
|
||||
|
||||
case 'ajouter':
|
||||
$xml_file = cleanName(LAST_KEY.'#'.str_replace("\'", " ", $_['titre']).'.xml');
|
||||
case 'new':
|
||||
$xml_file = LAST_KEY.'#'.cleanName($_['titre'].'.xml');
|
||||
copy('../modules/'.$_['type'].'/base.xml', '../data/pages/'.$xml_file);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'nom', $_['titre']);
|
||||
$input = preg_replace("<<br>>", "<br />", $_['input']);
|
||||
$input = str_replace(" ", "", $_['input']);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'contenu', $input, TRUE);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'id', LAST_KEY);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'ordre', LAST_ORDER);
|
||||
(@$_['affichage']=="on")?ecriture_xml('../data/pages/'.$xml_file, 'etat', 1):ecriture_xml('../data/pages/'.$xml_file, 'etat', 0);
|
||||
$input = str_replace(" ", "", preg_replace("<<br>>", "<br />", $_['input']));
|
||||
(@$_['affichage']=="on")?$display=1:$display=0;
|
||||
ecriture_xml('../data/pages/'.$xml_file, array('page/ordre'=>LAST_ORDER, 'page/id'=>LAST_KEY, 'page/nom'=>$_['titre'], 'page/affichage'=>$display, 'page/contenu#CDATA'=>$input));
|
||||
//$header = changeParameterRequestURL($_SERVER['QUERY_STRING'], array('act'=>'edit', 'id'=>LAST_KEY));
|
||||
//header('Location: index.php?'.$header);
|
||||
break;
|
||||
|
||||
|
||||
case 'modifier':
|
||||
$xml_file = cleanName($_['id'].'#'.str_replace("\'", " ", $_['titre']).'.xml');
|
||||
case 'edit':
|
||||
$xml_file = $_['id'].'#'.cleanName($_['titre'].'.xml');
|
||||
rename('../data/pages/'.$lecture_pages[$_['id']].'.xml', '../data/pages/'.$xml_file);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'nom', $_['titre']);
|
||||
$input = preg_replace("<<br>>", "<br />", $_['input']);
|
||||
$input = str_replace(" ", "", $_['input']);
|
||||
ecriture_xml('../data/pages/'.$xml_file, 'contenu', $input, TRUE);
|
||||
//$input = str_replace(" ", "", preg_replace("<<br>>", "<br />", $_['input']));
|
||||
$input = $_['input'];
|
||||
ecriture_xml('../data/pages/'.$xml_file, array('page/nom'=>$_['titre'], 'page/contenu#CDATA'=>$input));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo "<div class='update_valide'><span class='valide'>Page sauvegardée</span></div>";
|
||||
echo showNotification($lang_owSimple['_pageSaved'], 'valide', 'icon-emo-happy');
|
||||
|
||||
}
|
||||
}
|
||||
if($_['action']=='modifier') { ?><h3>Edition de la page <i><?php echo $page['page']['nom']['#text']; ?></i></h3><?php } ?>
|
||||
<form action="<?php echo ADMIN_REQUEST_URL; ?>&action=<?php echo $_['action']; if($_['action']=="modifier"){echo "&id=".$lecture_pages[$_['id']];}?>" method="POST">
|
||||
<h4>Nom de la page</h4>
|
||||
<input type="text" name="titre" class="input_text" value="<?php if(isset($_['titre'])){ echo stripslashes($_['titre']); } else { echo @$page['page']['nom']['#text']; } ?>" />
|
||||
|
||||
<h4>Contenu de la page</h4>
|
||||
<div class="owEditor">
|
||||
<textarea id="input" name="input" >
|
||||
<?php if(isset($_['input'])){ echo stripslashes($_['input']); } else { echo @$page['page']['contenu']['#text']; } ?>
|
||||
</textarea>
|
||||
if(!isset($_['Send']) || $_['act']=='edit')
|
||||
{
|
||||
if($_['act']=='edit'){ ?><h3><?php echo $lang_owSimple['_editPage']; ?></h3><?php }
|
||||
else { ?><h3><?php echo $lang_owSimple['_addPage']; ?></h3><?php } ?>
|
||||
<div id="Module">
|
||||
<form action="<?php echo ADMIN_REQUEST_URL."&act=".$_['act']; if($_['act']=="edit"){echo "&id=".$lecture_pages[$_['id']];}?>" method="POST">
|
||||
<input type="text" placeholder="<?php echo $lang_owSimple['_fillTitle']; ?>" name="titre" class="field_basic" value="<?php if(isset($_['titre'])){ echo stripslashes($_['titre']); } else { echo @$page['page']['nom']['#text']; } ?>" />
|
||||
|
||||
<div class="owEditor">
|
||||
<div id="editor" class="pell" ></div>
|
||||
<textarea name="input" id="html-output"></textarea>
|
||||
</div><br />
|
||||
|
||||
<input type="submit" value="<?php echo $lang_owSimple['_save']; ?>" class="input_basic" />
|
||||
<a href="index.php?tab=pages">
|
||||
<input type="button" value="<?php echo $lang_owSimple['_cancel']; ?>" class="input_basic" />
|
||||
</a>
|
||||
|
||||
<input type="hidden" name="type" value="<?php echo @$_['type']; ?>" />
|
||||
<input type="hidden" name="Send" value="1" />
|
||||
<input type="hidden" name="sid" value="1" />
|
||||
|
||||
<?php include('../lib/wysiwyg.lib.php'); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<input type="submit" value="Sauvegarder" class="input_button" />
|
||||
<a href="index.php?pid=<?php echo $_['pid']; ?>">
|
||||
<input type="button" value="Annuler" class="input_button" />
|
||||
</a>
|
||||
|
||||
<input type="hidden" name="type" value="<?php echo @$_['type']; ?>" />
|
||||
<input type="hidden" name="Send" value="1" />
|
||||
<input type="hidden" name="sid" value="1" />
|
||||
|
||||
<?php include('../lib/wysiwyg.lib.php'); ?>
|
||||
</form>
|
||||
<div id="Options" class="Bloc">
|
||||
<p>
|
||||
<?php echo $lang_owSimple['_noMoreOption']; ?>
|
||||
</p>
|
||||
</div><?php
|
||||
} ?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue