69 lines
1.9 KiB
PHP
69 lines
1.9 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 25/gen/2016
|
|
*/
|
|
|
|
|
|
require_once(dirname(__FILE__)."/../load.php");
|
|
|
|
GUIHandler::generateHtmlHeaders(array(),true);
|
|
|
|
if (!AdminLoginManager::isLogged()){
|
|
GUIHandler::redirect("admin/login.php");
|
|
}
|
|
else if (!AdminLoginManager::getLogged()->hasRole(AdminModel::ADMIN_TYPE_NORMALADMIN)){
|
|
GUIHandler::redirect("admin/index.php");
|
|
}
|
|
|
|
MenuGenerator::generateMenu();
|
|
|
|
HTMLHelper::generateAdminHead();
|
|
|
|
$saved = false;
|
|
$action = PostHandler::get("action");
|
|
if (!is_null($action) && strcmp("", $action)!=0){
|
|
if (strcmp("save", $action)==0){
|
|
|
|
if (PostHandler::get(SimpleConfig::VARIE_LABEL)) {
|
|
GlobalVariables::get("cfg")->setValue(SimpleConfig::VARIE_LABEL, PostHandler::get(SimpleConfig::VARIE_LABEL));
|
|
}
|
|
|
|
$saved = true;
|
|
}
|
|
}
|
|
|
|
?>
|
|
<div>
|
|
<?php
|
|
if ($saved){
|
|
echo '<div style="color:green;">Dati salvati con successo</div>';
|
|
}
|
|
?>
|
|
<form id="taskForm" method="POST" action="">
|
|
<input type="hidden" name="action" value="" />
|
|
<div><span class="label"> </span><b>Tasks</b></div>
|
|
<?php
|
|
printf(
|
|
'<div><span class="label">Varie (home)</span><input type="text" name="%s" value="%s" /><br/>',
|
|
SimpleConfig::VARIE_LABEL,
|
|
GlobalVariables::get("cfg")->hasValue(SimpleConfig::VARIE_LABEL) ? GlobalVariables::get("cfg")->getValue(SimpleConfig::VARIE_LABEL) : ""
|
|
)
|
|
?>
|
|
</form>
|
|
<div class="formBtns">
|
|
<a href="#" id="taskForm_salva" >Salva</a>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
$(document).ready(function(event){
|
|
$("#taskForm_salva").click(function(event){
|
|
$("form#taskForm input[type=hidden][name=action]").val("save");
|
|
$("form#taskForm").submit();
|
|
});
|
|
$("#taskForm_annulla").click(function(event){
|
|
$("form#taskForm input[type=hidden][name=action]").val("cancel");
|
|
$("form#taskForm").submit();
|
|
});
|
|
});
|
|
</script>
|