Modifiche all'helper di datatables per permettere la creazione al volo dei bottoni nell'area superiore della tabella
42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 14/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_EDITORE_SUPERVISOR)){
|
|
GUIHandler::redirect("admin/index.php");
|
|
}
|
|
|
|
MenuGenerator::generateMenu();
|
|
|
|
HTMLHelper::generateAdminHead();
|
|
$columns = array(
|
|
array("label"=>"Titolo","data"=>"titolo"),
|
|
array("label"=>"Sottotitolo","data"=>"sottotitolo"),
|
|
array("label"=>"Autore","data"=>"about.author"),
|
|
array("label"=>"Data","data"=>"about.data")
|
|
);
|
|
|
|
$buttons = array(
|
|
array("icon"=>"icon-big-blue icon-edit","page"=>"editNotizia.php")
|
|
);
|
|
|
|
?>
|
|
<div>
|
|
<?php
|
|
$details = DatatablesHelper::generateTable("notiziaTableBackend.php",$columns,array("buttons"=>$buttons));
|
|
?>
|
|
<script type="text/javascript">
|
|
$(document).ready(function() {
|
|
$("div.<?php echo $details["toolbarClass"];?>").html('<b>Custom tool bar! Text/images etc.</b>');
|
|
});
|
|
</script>
|
|
</div>
|