AEOS/admin/base.php
2026-08-26 17:23:29 +02:00

905 lines
No EOL
41 KiB
PHP

<?php (SECURITY)?die():FALSE; ?>
<?php ob_start(); ?>
<body>
<div id="General">
<div id="Left">
<!--
<div id="SurHeader">
<h1><?php echo AEOS_NAME; ?> [<?php echo AEOS_DESC; ?>]</h1>
<h6>
<ul class="NotificationZone">
<li>
<a href="#"><img src="../themes/system/images/notification.png" alt="Notification (<?php echo $_SESSION['_NOTIFICATIONS']; ?>)" />
<?php
if($_SESSION['_NOTIFICATIONS']) { ?><span class="Notifications">!</span><?php }
?>
</a>
<ul>
<?php
$notifications = lecture_xml('notifications.xml');
for($i=0; $i<count($notifications['notifications']['message']); $i++)
{
?>
<li>
<a href="<?php echo $notifications['notifications']['message'][$i]['lien']['#text']; ?>">
<img src="../themes/system/images/icones/<?php echo $notifications['notifications']['message'][$i]['type']['#text']; ?>.png" alt="<?php echo $notifications['notifications']['message'][$i]['type']['#text']; ?>" />
&nbsp; <?php echo $notifications['notifications']['message'][$i]['contenu']['#text']; ?>
</a>
</li>
<?php
}
?>
</ul>
</li>
</ul>
Version actuelle : <?php echo AEOS_VERSION; ?>
<?php //if (checkVersion()) echo '<span class="erreur"><a href="'.AEOS_REAL_URL.'">Nouvelle version disponible</a></span>'; ?>
</h6>
</div>
-->
<div id="Logo">
<a href="index.php"><img src="../themes/system/images/aeos_logo_A_blanc.png" alt="Logo AEOS" alt="Logo AEOS" /></a>
</div>
<div id="Identification">
<img src="<?php echo $subdir.AEOS_AVATAR;?>" alt="Avatar" />
<span class="Option1"><?php echo AEOS_FIRSTNAME." ".AEOS_LASTNAME; ?></span><br />
<span class="Option2"><?php echo AEOS_ROLE; ?></span>
</div>
<ul class="Menu">
<?php
$menu = array(
"dashboard" => array("text" => $lang["admin_Dashboard"], "img" => "th-list"),
"pages" => array("text" => $lang["admin_Pages"], "img" => "doc-inv", "sub" => array("addPage" => $lang["admin_addPage"])),
"addons" => array("text" => $lang["admin_Addons"], "img" => "puzzle", "sub" => array("addAddon" => $lang["admin_addAddon"])),
"plugins" => array("text" => $lang["admin_Plugins"], "img" => "cubes", "sub" => array("addPlugin" => $lang["admin_addPlugin"])),
"themes" => array("text" => $lang["admin_Themes"], "img" => "magic", "sub" => array("addTheme" => $lang["admin_addTheme"])),
"settings" => array("text" => $lang["admin_Settings"], "img" => "cog", "sub" => array("general" => $lang['admin_General'], "connexion" => $lang["admin_Connexion"], "maintenance" => $lang["admin_Maintenance"], "system" => $lang["admin_System"])),
"trash" => array("text" => $lang["admin_Trashbin"], "img" => "recycle", "sub" => array("emptyTrashbin" => $lang["admin_EmptyTrashbin"])),
"logout" => array("text" => $lang["admin_Logout"], "img" => "logout")
);
foreach ($menu as $menuKey => $menuValue)
{
echo "<a href='index.php?tab=".$menuKey."'><li ";
if ($tab==$menuKey) echo "class='selected'>"; else echo ">";
echo "<i class='icon-".$menuValue["img"]."'></i> ".$menuValue["text"];
echo "</li></a>";
if($tab==$menuKey)
{
if(isset($menu[$menuKey]['sub']))
{
foreach ($menu[$menuKey]['sub'] as $subMenuKey => $subMenuValue)
{
echo '<a href="?tab='.$menuKey.'&opt='.$subMenuKey.'"><li class="middleMenu ';
if($opt==$subMenuKey) {echo "middleMenuSelected";}
echo '"> '.$subMenuValue."</li></a>";
}
}
}
}
?>
</ul>
<?php //echo checkVersion(); ?>
<div id="Update">
<img src="../themes/system/images/logo_mini.png" alt="Logo" />
<p>AEOS v<?php echo AEOS_VERSION; ?> - <?php echo AEOS_CODENAME; ?></p>
<hr /><h5><?php echo AEOS_BRANCH; ?>/version_<?php echo AEOS_UPDATE; ?>.zip</h5>
<!--<p class="update"><a href="<?php echo AEOS_REAL_URL; ?>"><?php echo $lang['admin_updateAvailable']; ?></a></p>-->
</div>
</div>
<div id="Right">
<div id="SideMenu">
<ul>
<?php
echo '<li class="headerMenu"><a href="?tab='.$tab.'"><i class="icon-'.$menu[$tab]["img"].'"></i> '.$menu[$tab]["text"].'</a>';
if(isset($_['opt']) && $_['opt']!="" && isset($menu[$tab]['sub'][$_['opt']])) echo ' / <a href="'.ADMIN_REQUEST_URL.'">'.$menu[$tab]['sub'][$_['opt']].'</a>';
echo '</li>';
?>
</ul>
</div>
<div id="Content">
<?php
switch ($tab)
{
case "dashboard": // Tab DASHBOARD
if (isset($_['suppresion']) && $_['suppresion']=="install")
{
removeFolder("../install/");
echo showNotification($lang['admin_msg_installFolderDeleted'], 'valide', 'icon-emo-happy');
}
elseif (file_exists("../install"))
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;suppresion=install" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_msg_installFolderStill']; ?></p>
<input type="submit" value="<?php echo $lang['admin_input_DeleteFolder']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
?>
<div class="ZoneTexte">
<h4><?php echo $lang['admin_title_welcome']; ?></h4>
<p><?php echo $lang['admin_text_welcome_1']; ?></p>
<p><?php echo $lang['admin_text_welcome_2']; ?></p>
</div>
<?php
break;
case "pages": // Tab PAGES
switch($opt)
{
case "addPage":
if(!isset($_['Send']) && !isset($_['act']))
{
if(isset($_['act']) && $_['act']!='new') break; ?>
<button class="button_basic"><i class="icon-plus"></i><?php echo $lang['admin_addPage']; ?></button>
<form class="flex" action="<?php echo ADMIN_REQUEST_URL; ?>&amp;act=new" method="POST" >
<div class="select_basic">
<select name="type">
<?php
$list = listing_dossier("../modules/");
foreach ($list as $pages)
{ ?>
<option value="<?php echo $pages; ?>"><?php echo $pages;?></option><?php
} ?>
</select>
</div>
<input type="submit" value="<?php echo $lang['text_add']; ?>" class="input_basic" />
</form><?php
}
break;
default:
}
if(isset($_['act']))
{
switch($_['act'])
{
case 'display':
ecriture_xml('../data/pages/'.$lecture_pages[$_['id']].'.xml', array('page/etat'=>$_['aff']));
echo showNotification($lang['admin_page_display'], 'valide', 'icon-emo-happy');
break;
case 'up':
ksort($ordre_pages);
$previousValue = getValueArray($ordre_pages, $_['sort'], -1);
$previousValueArray = lecture_xml("../data/pages/".$previousValue);
$previousOrder = $previousValueArray['page']['ordre']['#text'];
ecriture_xml('../data/pages/'.$previousValue, array('page/ordre'=>$_['sort']));
ecriture_xml('../data/pages/'.$ordre_pages[$_['sort']], array('page/ordre'=>$previousOrder));
echo showNotification($lang['admin_page_order'], 'valide', 'icon-emo-happy');
break;
case 'down':
ksort($ordre_pages);
$previousValue = getValueArray($ordre_pages, $_['sort'], +1);
$previousValueArray = lecture_xml("../data/pages/".$previousValue);
$previousOrder = $previousValueArray['page']['ordre']['#text'];
ecriture_xml('../data/pages/'.$previousValue, array('page/ordre'=>$_['sort']));
ecriture_xml('../data/pages/'.$ordre_pages[$_['sort']], array('page/ordre'=>$previousOrder));
echo showNotification($lang['admin_page_order'], 'valide', 'icon-emo-happy');
break;
case 'new':
include("../modules/".$_['type']."/edition.php");
break;
case 'edit':
$page = lecture_xml("../data/pages/".$lecture_pages[$_['id']].".xml");
include("../modules/".$page['page']['type']['#text']."/edition.php");
break;
case 'delete':
if($_['id']==HOME_PAGE) echo showNotification($lang['admin_page_cantDeleteHome'], 'error', 'icon-emo-unhappy');
else
{
if (isset($_['del']))
{
$tmpTrashbin = explode('#', $lecture_pages[$_['id']]);
rename ("../data/pages/".$lecture_pages[$_['id']].".xml", "../data/corbeille/".date("d-m-Y G\hi\ms\s")."_@@@".$tmpTrashbin[1].".xml");
echo showNotification($lang['admin_page_confimedDelete'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;act=delete&amp;id=<?php echo $_['id']; ?>&amp;del" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_page_confirmDelete']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
}
break;
}
}
?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=addPage">
<button class="button_basic"><i class="icon-plus"></i><?php echo $lang['admin_addPage']; ?></button>
</a>
<h3><?php echo $lang["admin_page_pageManagement"]; ?></h3>
<table>
<?php
$list=listing_ordre();
foreach ($list as &$pages)
{
$page = lecture_xml(DATA_PAGES.$pages); ?>
<tr>
<td><?php echo $page['page']['nom']['#text']; ?><br /><span class="small"><i class="icon-right"></i> <?php echo $page['page']['type']['#text']; ?></span></td>
<td class="text-right">
<?php
if ($pages==reset($list)) echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=down&amp;id='.$page['page']['id']['#text'].'&amp;sort='.$page['page']['ordre']['#text'].'"><i class="icon-down-big"></i></a>';
elseif ($pages==end($list)) echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=up&amp;id='.$page['page']['id']['#text'].'&amp;sort='.$page['page']['ordre']['#text'].'"><i class="icon-up-big"></i></a>';
else
{
echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=down&amp;id='.$page['page']['id']['#text'].'&amp;sort='.$page['page']['ordre']['#text'].'"><i class="icon-down-big"></i></a>';
echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=up&amp;id='.$page['page']['id']['#text'].'&amp;sort='.$page['page']['ordre']['#text'].'"><i class="icon-up-big"></i></a>';
} ?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;act=edit&amp;id=<?php echo $page['page']['id']['#text']; ?>"><i class="icon-pencil"></i></a>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;act=delete&amp;id=<?php echo $page['page']['id']['#text']; ?>"><i class="icon-cancel"></i></a>
<?php
if($page['page']['id']['#text']==HOME_PAGE) echo '| <i class="icon-home"></i>';
else if ($page['page']['etat']['#text']==1) echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=display&amp;aff=2&amp;id='.$page['page']['id']['#text'].'">| <i class="icon-circle valide"></i></a>';
else if ($page['page']['etat']['#text']==2) echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=display&amp;aff=0&amp;id='.$page['page']['id']['#text'].'">| <i class="icon-circle basic"></i></a>';
else echo '<a href="'.ADMIN_REQUEST_URL.'&amp;act=display&amp;aff=1&amp;id='.$page['page']['id']['#text'].'">| <i class="icon-circle error"></i></a>';
?>
</td>
</tr>
<?php
}
?>
</table>
<div class="ZoneTexte">
<p>
<i class="icon-home"></i> <?php echo $lang['admin_page_home']; ?>
<i class="icon-circle valide"></i> <?php echo $lang['admin_input_activated']; ?>
<i class="icon-circle error"></i> <?php echo $lang['admin_input_desactivated']; ?>
<i class="icon-circle standby"></i> <?php echo $lang['admin_input_standby']; ?>
</p>
</div>
<?php
break;
case "addons": // Page modules
switch(@$_['opt'])
{
case 'addAddon':
if(@$_FILES["zip_file"]["name"])
{
switch(upload_unzip($_FILES["zip_file"], "../modules/", "module"))
{
case 0: echo showNotification($lang['admin_addons_installed'], 'valide', 'icon-emo-happy'); break;
case 2: echo showNotification($lang['admin_addons_alreadyInstalled'], 'error', 'icon-emo-unhappy'); break;
case 3: echo showNotification($lang['admin_fileNotZip'], 'error', 'icon-emo-unhappy'); break;
case 1: default: echo showNotification($lang['text_errorOccurred'], 'error', 'icon-emo-unhappy'); break;
}
}
else {
if(@$_['Send']!=1)
{
if(isset($_['action']) && $_['action']!='ajouter') break; ?>
<form enctype="multipart/form-data" method="POST" action="<?php echo ADMIN_REQUEST_URL; ?>&amp;action=ajouter">
<label for="zip_file" class="input_basic input_normal" class="label-file"><?php echo $lang['text_choose_file']; ?></label>
<input class="hidden" type="file" id="zip_file" name="zip_file" />
<input class="input_basic" type="submit" class="input_button" name="submit" value="<?php echo $lang['text_install']; ?>" />
<p class="italic"><?php echo $lang['admin_addons_fileMustBeZip']; ?></p>
</form>
<?php
}
}
break;
case 'edit':
include("../modules/".$_['dossier']."/edition.php");
break;
case 'delete':
if (isset($_['del']))
{
removeFolder("../modules/".$_['folder']);
echo showNotification($lang['admin_addons_deleted'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;folder=<?php echo $_['folder']; ?>&amp;del" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_addons_confirmDelete']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
break;
}
?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=addAddon">
<button class="button_basic"><i class="icon-plus"></i><?php echo $lang['admin_addAddon']; ?></button>
</a>
<h3><?php echo $lang["admin_addons_addonsManagement"]; ?></h3>
<table>
<?php
$list=listing_dossier("../modules/");
if (!empty($list))
{
foreach ($list as &$pages)
{
$page = lecture_xml("../modules/".$pages."/config.xml"); ?>
<tr>
<td><?php echo $page['configuration']['nom']['#text']; ?><br /><span class="small"><i class="icon-right"></i><?php echo $page['configuration']['description']['#text']; ?></span></td>
<td class="text-right">
<?php
if(is_file("../modules/".$pages."/edit.xml"))
{ ?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=edit&amp;dossier=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-pencil"></i></a>
<?php
}
?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=delete&amp;folder=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-cancel"></i></a>
| <a href="#" title="<?php echo $lang['text_author']; ?>: <?php echo $page['configuration']['auteurs']['#text']; ?>&#xA;<?php echo $lang['text_version']; ?>: <?php echo $page['configuration']['version']['#text']; ?>"><i class="icon-info"></i></a>
</td>
</tr><?php
}
} ?>
</table>
<?php
break;
case "plugins": // Page plugins
switch(@$_['opt'])
{
case 'addAddon':
if(@$_FILES["zip_file"]["name"])
{
switch(upload_unzip($_FILES["zip_file"], "../plugins/", "module"))
{
case 0: echo showNotification($lang['admin_plugins_installed'], 'valide', 'icon-emo-happy'); break;
case 2: echo showNotification($lang['admin_plugins_alreadyInstalled'], 'error', 'icon-emo-unhappy'); break;
case 3: echo showNotification($lang['admin_fileNotZip'], 'error', 'icon-emo-unhappy'); break;
case 1: default: echo showNotification($lang['text_errorOccurred'], 'error', 'icon-emo-unhappy'); break;
}
}
else {
if(@$_['Send']!=1)
{
if(isset($_['action']) && $_['action']!='ajouter') break; ?>
<form enctype="multipart/form-data" method="POST" action="<?php echo ADMIN_REQUEST_URL; ?>&amp;action=ajouter">
<label for="zip_file" class="input_basic input_normal" class="label-file"><?php echo $lang['text_choose_file']; ?></label>
<input class="hidden" type="file" id="zip_file" name="zip_file" />
<input class="input_basic" type="submit" class="input_button" name="submit" value="<?php echo $lang['text_install']; ?>" />
<p class="italic"><?php echo $lang['admin_plugins_fileMustBeZip']; ?></p>
</form>
<?php
}
}
break;
case 'edit':
if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
$position = Array("General", "Header", "Corps", "Footer");
$compoConfig = lecture_xml("../plugins/".$_['dossier']."/config.xml");
//if(checkMultilangModuleAvailable(donnee_xml($subdir."plugins/".basename(__DIR__)."/config.xml", 'multilang'))) require_once($subdir.'plugins/'.basename(__DIR__).'/lang/'.detectLang().".php");
include("../plugins/".$_['dossier']."/inc/edit.php");
break;
case 'display':
ecriture_xml('../plugins/'.$_['folder'].'/config.xml', array('configuration/activation'=>$_['aff']));
echo showNotification($lang['admin_plugins_display'], 'valide', 'icon-emo-happy');
break;
case 'delete':
if (isset($_['del']))
{
removeFolder("../plugins/".$_['folder']);
echo showNotification($lang['admin_plugins_deleted'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;folder=<?php echo $_['folder']; ?>&amp;del" method="GET">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_plugins_confirmDelete']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
break;
}
?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=addPlugin">
<button class="button_basic"><i class="icon-plus"></i><?php echo $lang['admin_addPlugin']; ?></button>
</a>
<h3><?php echo $lang["admin_plugins_addonsManagement"]; ?></h3>
<table>
<?php
$list=listing_dossier("../plugins/");
if (!empty($list))
{
foreach ($list as &$pages)
{
$page = lecture_xml("../plugins/".$pages."/config.xml"); ?>
<tr>
<td><?php echo $page['configuration']['nom']['#text']; ?><br /><span class="small"><i class="icon-right"></i><?php echo $page['configuration']['description']['#text']; ?></span></td>
<td class="text-right">
<?php
if(isset($page['configuration']['edition']))
{ ?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=edit&amp;dossier=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-pencil"></i></a> | <?php
}
if ($page['configuration']['activation']['#text']==1) echo '<a href="'.ADMIN_REQUEST_URL.'&amp;opt=display&amp;aff=0&amp;folder='.$page['configuration']['dossier']['#text'].'"><i class="icon-circle valide"></i></a>';
else echo '<a href="'.ADMIN_REQUEST_URL.'&amp;opt=display&amp;aff=1&amp;folder='.$page['configuration']['dossier']['#text'].'"><i class="icon-circle error"></i></a>';
?>
| <a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=delete&amp;folder=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-cancel"></i></a>
| <a href="#" title="<?php echo $lang['text_author']; ?>: <?php echo $page['configuration']['auteurs']['#text']; ?>&#xA;<?php echo $lang['text_version']; ?>: <?php echo $page['configuration']['version']['#text']; ?>"><i class="icon-info"></i></a>
</td>
</tr><?php
}
}
else echo "<tr><td>".$lang['admin_plugins_empty']."</td></tr>";
?>
</table>
<?php
break;
case "themes": // Page thèmes
switch(@$_['opt'])
{
case 'display':
ecriture_xml('../data/config.xml', array('configuration/theme'=>$_['folder']));
echo showNotification($lang['admin_themes_changed'], 'valide', 'icon-emo-happy');
include('../lib/config.lib.php');
break;
case 'edit':
include("../themes/".$_['dossier']."/edition.php");
break;
case 'delete':
if (isset($_['del']))
{
removeFolder("../themes/".$_['folder']);
echo showNotification($lang['admin_themes_deleted'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;folder=<?php echo $_['folder']; ?>&amp;del" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_themes_confirmDelete']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
break;
case 'addTheme':
if(@$_FILES["zip_file"]["name"])
{
switch(upload_unzip($_FILES["zip_file"], "../themes/", "theme"))
{
case 0: echo showNotification($lang['admin_themes_installed'], 'valide', 'icon-emo-happy'); break;
case 2: echo showNotification($lang['admin_themes_alreadyInstalled'], 'error', 'icon-emo-unhappy'); break;
case 3: echo showNotification($lang['admin_fileNotZip'], 'error', 'icon-emo-unhappy'); break;
case 1: default: echo showNotification($lang['text_errorOccurred'], 'error', 'icon-emo-unhappy'); break;
}
}
else {
if(@$_['Send']!=1)
{
if(isset($_['action']) && $_['action']!='ajouter') break; ?>
<form enctype="multipart/form-data" method="POST" action="<?php echo ADMIN_REQUEST_URL; ?>&amp;action=ajouter">
<label for="zip_file" class="input_basic input_normal" class="label-file"><?php echo $lang['text_choose_file']; ?></label>
<input class="hidden" type="file" id="zip_file" name="zip_file" />
<input class="input_basic" type="submit" class="input_button" name="submit" value="<?php echo $lang['text_install']; ?>" />
<p class="italic"><?php echo $lang['admin_themes_fileMustBeZip']; ?></p>
</form>
<?php
}
}
break;
}
?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=addTheme">
<button class="button_basic"><i class="icon-plus"></i><?php echo $lang['admin_addTheme']; ?></button>
</a>
<h3><?php echo $lang['admin_themes_themesManagement']; ?></h3>
<table>
<?php
$list=listing_dossier("../themes/");
foreach ($list as &$pages) {
$page = lecture_xml("../themes/".$pages."/config.xml");
?>
<tr>
<td><?php echo $page['configuration']['nom']['#text']; ?><br /><span class="small"><i class="icon-right"></i><?php echo $page['configuration']['description']['#text']; ?></span></td>
<td class="text-right">
<?php
if (is_file("../themes/".$pages."/edit.xml"))
{ ?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=edit&amp;dossier=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-pencil"></i></a>
<?php
}
if($page['configuration']['dossier']['#text']!="defaut" && $page['configuration']['dossier']['#text']!="system") { ?><a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=delete&amp;folder=<?php echo $page['configuration']['dossier']['#text']; ?>"><i class="icon-cancel"></i></a><?php } ?>
<?php
if($page['configuration']['dossier']['#text']!="system")
{
if ($config['configuration']['theme']['#text']==$page['configuration']['dossier']['#text']) echo '<i class="icon-circle valide"></i>';
else echo '<a href="'.ADMIN_REQUEST_URL.'&amp;opt=display&amp;folder='.$page['configuration']['dossier']['#text'].'&amp;set"> <i class="icon-circle basic"></i></a>';
}
?>
| <a hr7ef="#" title="<?php echo $lang['text_author']; ?>: <?php echo $page['configuration']['auteurs']['#text']; ?>&#xA;<?php echo $lang['text_version']; ?>: <?php echo $page['configuration']['version']['#text']; ?>"><i class="icon-info"></i></a>
</td>
</tr><?php
} ?>
</table><?php
break;
case "settings": // Settings
switch(@$_['opt'])
{
case "general":
// For allowed the settings refresh
if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
else if(isset($_['Send']) && $_['Send']=='1')
{
ecriture_xml('../data/config.xml', array('configuration/nom_site'=>$_['nom_site'], 'configuration/description_site'=>$_['description_site'], 'configuration/footer'=>$_['footer_site']));
//echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
header("Location: ".ADMIN_REQUEST_URL."&updated");
die();
}
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>" method="POST">
<h3><?php echo $lang['admin_settings_commonSettings']; ?></h3>
<table>
<tr>
<td><?php echo $lang['admin_settings_siteTitle']; ?> :</td>
<td><input type="text" name="nom_site" class="field_basic" value="<?php echo AEOS_NAME; ?>" /></td>
</tr>
<tr>
<td><?php echo $lang['admin_settings_siteDescription']; ?> :</td>
<td><input type="text" name="description_site" class="field_basic" value="<?php echo AEOS_DESC; ?>" /></td>
</tr>
<tr>
<td><?php echo $lang['admin_settings_siteFooter']; ?> :</td>
<td><input type="text" name="footer_site" class="field_basic" value="<?php echo br2nl(AEOS_FOOTER); ?>" /></td>
</tr>
</table>
<input type="hidden" value="1" name="Send" />
<input type="submit" value="<?php echo $lang['update']; ?>" class="input_basic" />
</form>
<?php
break;
case "connexion":
if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
else if(isset($_['Send']) && $_['Send']=='1')
{
ecriture_xml('../data/config.xml', array(
'configuration/users/'.$_SESSION['_LOGIN'].'/firstname'=>$_['firstName'],
'configuration/users/'.$_SESSION['_LOGIN'].'/lastname'=>$_['lastName'],
'configuration/users/'.$_SESSION['_LOGIN'].'/email'=>$_['email'],
'configuration/users/'.$_SESSION['_LOGIN'].'/language'=>$_['language']
));
if($_['password']!="password" && $_['password']!="") ecriture_xml('../data/config.xml', array('configuration/users/'.$_SESSION['_LOGIN'].'/password'=>password_hash($_['password'],PASSWORD_DEFAULT)));
if($_FILES['photo_file']['name']!="")
{
$nameTmp = generateEasyPassword(6).'_'.$_FILES['photo_file']['name'];
move_uploaded_file($_FILES['photo_file']['tmp_name'], '../data/images/'.basename($nameTmp));
ecriture_xml('../data/config.xml', array('configuration/users/'.$_SESSION['_LOGIN'].'/avatar'=>'data/images/'.$nameTmp));
}
header("Location: ".ADMIN_REQUEST_URL."&updated");
}
?>
<form enctype="multipart/form-data" action="<?php echo ADMIN_REQUEST_URL; ?>" method="POST">
<h3><?php echo $lang['admin_settings_connexionProfil']; ?></h3>
<table>
<tr>
<td class="fixedRow" rowspan="5">
<h4><?php echo $lang['admin_settings_connexionProfilPicture']; ?></h4>
<img src="<?php echo $subdir.AEOS_AVATAR; ?>" class="avatar" alt="Avatar" /><br />
<label for="photo_file" class="input_basic" class="label-file"><?php echo $lang['admin_settings_connexionChangePicture']; ?></label>
<input class="hidden" type="file" id="photo_file" name="photo_file" />
</td>
</tr>
<tr>
<td><?php echo $lang['firstName']; ?> :</td>
<td><input type="text" name="firstName" class="field_basic" value="<?php echo AEOS_FIRSTNAME; ?>" /></td>
</tr>
<tr>
<td><?php echo $lang['lastName']; ?> :</td>
<td><input type="text" name="lastName" class="field_basic" value="<?php echo AEOS_LASTNAME; ?>" /></td>
</tr>
<tr>
<td><?php echo $lang['mailAddress']; ?> :</td>
<td><input type="text" name="email" class="field_basic" value="<?php echo AEOS_MAIL; ?>" /></td>
</tr>
<tr>
<td><?php echo $lang['language']; ?> :</td>
<td><div class="select_basic">
<select name="language">
<?php
foreach($config["configuration"]["lang_available"]["langs"] as $key => $value)
{
?><option value="<?php echo $value['code']["#text"]; ?>" name="<?php echo $value['code']["#text"]; ?>" <?php if(AEOS_USER_LANG == $value['code']["#text"]) echo "selected" ?>><?php echo $value['name']["#text"]; ?></option><?php
}
?>
</select></div></td>
</tr>
</table>
<h3><?php echo $lang['admin_settings_connexionOptions']; ?></h3>
<table>
<tr>
<td><?php echo $lang['login_Password']; ?> :</td>
<td><input type="password" name="password" class="field_basic" value="password" /></td>
</tr>
</table>
<input type="hidden" value="1" name="Send" />
<input type="submit" value="<?php echo $lang['update']; ?>" class="input_basic" />
</form>
<?php
break;
case 'maintenance':
if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
if(isset($_['Send']) && $_['Send']=='1')
{
if(isset($_['maintenance'])){$tmpMaintenance="TRUE";} else {$tmpMaintenance="FALSE";}
ecriture_xml('../data/config.xml', array(
'configuration/maintenanceMode'=>$tmpMaintenance,
'configuration/maintenanceMessage#CDATA'=>$_['message']
));
header("Location: ".ADMIN_REQUEST_URL."&updated");
}
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>" method="POST">
<h3><?php echo $lang['admin_settings_maintenance']; ?></h3>
<table>
<tr>
<td><?php echo $lang['admin_settings_maintenanceExplain']; ?></td>
<td><input type="checkbox" name="maintenance" id="switchMaintenance" <?php if(AEOS_MAINTENANCE=="TRUE"){echo "checked";} ?> /><label class="checkbox" for="switchMaintenance">Toggle</label></td>
</tr>
<tr>
<td colspan="2">
<div class="owEditor">
<textarea id="input" name="message"><?php echo AEOS_MAINTMSG; ?></textarea>
</div>
<?php include('../lib/wysiwyg.lib.php'); ?>
</td>
</tr>
</table>
<input type="hidden" value="1" name="Send" />
<input type="submit" value="<?php echo $lang['update']; ?>" class="input_basic" />
</form>
<?php
break;
case 'system':
if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy');
if(isset($_['Send']) && $_['Send']=='1')
{
if(isset($_['debugmode'])){$tmpDebug="TRUE";} else {$tmpDebug="FALSE";}
if(isset($_['urlrewmode'])){$tmpRew="TRUE";} else {$tmpRew="FALSE";}
($_['urlrew']=='')?$_['urlrew']='':$_['urlrew']=$_['urlrew'].'-';
ecriture_xml('../data/config.xml', array(
'configuration/debugMode'=>$tmpDebug,
'configuration/urlrewriting'=>$tmpRew,
'configuration/urlrewriting_key'=>$_['urlrew'],
'configuration/lang'=>$_['language']
));
header("Location: ".ADMIN_REQUEST_URL."&updated");
}
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>" method="POST">
<h3><?php echo $lang['admin_settings_systemSystem']; ?></h3>
<table>
<tr>
<td><?php echo $lang['admin_settings_systemLanguage']; ?></td>
<td><div class="select_basic">
<select name="language">
<?php
foreach($config["configuration"]["lang_available"]["langs"] as $key => $value)
{
?><option value="<?php echo $value['code']["#text"]; ?>" name="<?php echo $value['code']["#text"]; ?>" <?php if(AEOS_LANG == $value['code']["#text"]) echo "selected" ?>><?php echo $value['name']["#text"]; ?></option><?php
}
?>
</select></div>
</td>
</tr>
<tr>
<?php echo AEOS_REWMODE ?>
<td><?php echo $lang['admin_settings_systemURLRewriting']; ?></td>
<td><input type="checkbox" name="urlrewmode" id="switchRew" <?php if(AEOS_REWMODE==1){echo "checked";} ?> /><label class="checkbox" for="switchRew">Toggle</label></td>
</tr>
<tr>
<td><?php echo $lang['admin_settings_systemURLRewritingKey']; ?><a href="#" title="<?php echo $lang['admin_settings_systemURLRewritingInfo']; ?>"><i class="icon-info"></i></a></td>
<td>
<input type="text" name="urlrew" class="field_basic" value="<?php echo substr(AEOS_REWKEY, 0, -1); ?>" />
</td>
</tr>
<tr>
<td><?php echo $lang['admin_settings_systemDebugMode']; ?><a href="#" title="<?php echo $lang['admin_settings_systemDebugModeInfo']; ?>"><i class="icon-info"></i></a></td>
<td><input type="checkbox" name="debugmode" id="switchDebug" <?php if(DEBUG_MODE==1){echo "checked";} ?> /><label class="checkbox" for="switchDebug">Toggle</label></td>
</tr>
</table>
<input type="hidden" value="1" name="Send" />
<input type="submit" value="<?php echo $lang['update']; ?>" class="input_basic" />
</form>
<?php
break;
default:
?>
<div class="ZoneTexte">
<h4><?php echo $lang['admin_settings_welcome_title']; ?></h4>
<p><?php echo $lang['admin_settings_welcomte_text']; ?></p>
</div>
<?php
}
break;
case 'trash': // Page corbeille
if(isset($_['opt']))
{
switch(@$_['opt'])
{
case 'restore':
$oldFile = DATA_TRASH.$_['file'];
$newFile = DATA_PAGES.LAST_KEY.'#'.str_replace("\'", " ", explode('@@@', $_['file'])[1]);
echo "Copy: ".$oldFile." To: ".$newFile;
copy($oldFile, $newFile);
unlink($oldFile);
ecriture_xml($newFile, array(
'page/etat'=>0,
'page/id'=>LAST_KEY,
'page/ordre'=>LAST_ORDER
));
header("Location: ".ADMIN_REQUEST_URL."&updated");
break;
case 'delete':
if (isset($_['del']))
{
unlink(DATA_TRASH.$_['file']);
echo showNotification($lang['admin_settings_trashDeleteOK'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=delete&amp;file=<?php echo $_['file']; ?>&amp;del" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_settings_trashDeleteConfirm']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
break;
case 'emptyTrashbin':
if (isset($_['del']))
{
clearFolder(DATA_TRASH);
echo showNotification($lang['admin_settings_trashEmptyConfirm'], 'valide', 'icon-emo-happy');
}
else
{
?>
<form action="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=emptyTrashbin&amp;del" method="post">
<div class='notification error'>
<p><i class="icon-emo-unhappy"></i> <?php echo $lang['admin_settings_trashEmptyDeleteConfirm']; ?></p>
<input type="submit" value="<?php echo $lang['text_yes']; ?>" class="button_erreur" />
</div>
</form>
<?php
}
break;
}
}
?>
<?php if(isset($_['updated'])) echo showNotification($lang['updateSuccessfull'], 'valide', 'icon-emo-happy'); ?>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=emptyTrashbin">
<button class="button_basic"><i class="icon-recycle"></i><?php echo $lang['admin_settings_trashEmpty']; ?></button>
</a>
<h3><?php echo $lang["admin_settings_trashHad"]; ?></h3>
<table>
<?php
$list=listing_dossier(DATA_TRASH);
if(!$list)
{
?><tr><td><?php echo $lang["admin_settings_trashNoFile"]; ?></td></tr><?php
}
else
{
foreach ($list as &$pages)
{
$page = lecture_xml(DATA_TRASH.$pages);
$fileDate = explode('_', $pages);
?>
<tr>
<td><?php echo $page['page']['nom']['#text']; ?><br /><span class="small"><i class="icon-right"></i> <?php echo $page['page']['type']['#text']; ?> </td>
<td class="text-right">
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=restore&amp;file=<?php echo $fileDate[0]."_".$fileDate[1]; ?>" title="<?php echo $lang["admin_settings_trashRestore"]; ?>" ><i class="icon-ccw"></i></a>
<a href="<?php echo ADMIN_REQUEST_URL; ?>&amp;opt=delete&amp;file=<?php echo $fileDate[0]."_".$fileDate[1]; ?>"><i class="icon-cancel" title="<?php echo $lang["admin_settings_trashDelete"]; ?>" ></i></a> |
<a href="#" title="<?php echo $lang["admin_settings_trashInfo"]." ".$fileDate[0]; ?>"><i class="icon-info"></i></a>
</td>
</tr>
<?php
}
}
?>
</table>
<div class="ZoneTexte">
<p>
<i class="icon-home"></i> <?php echo $lang['admin_page_home']; ?>
<i class="icon-circle valide"></i> <?php echo $lang['admin_input_activated']; ?>
<i class="icon-circle error"></i> <?php echo $lang['admin_input_desactivated']; ?>
<i class="icon-circle standby"></i> <?php echo $lang['admin_input_standby']; ?>
</p>
</div>
<?php
break;
case 'logout': // Page déconnexion
session_destroy();
header('Location: index.php');
break;
} ?>
</div>
<div id="Footer">
<p>
<?php require_once('../core/footer.php'); ?>
</p>
</div>
<div class="clear"></div>
</div>
</body>
<?php ob_end_flush(); ?>