Files
fdn2/public/admin/tablesBackends/notizieTableBackend.php
T
Riccardo Di Dato fa648c0850 Creato sistema accetazione commenti;
Create pagine per notizie in pending e rifiutate;
Creati componenti grafici per mostrare Notizia, Commento e lista
commenti;
Bugfix e limature su amministrazione
2016-02-29 18:44:22 +01:00

43 lines
940 B
PHP

<?php
/*
Author: Riccardo Di Dato
Creation Date: 14/gen/2016
*/
require_once(dirname(__FILE__)."/../../load.php");
$useModel = "NotiziaModel";
$permissionFlagRequired = AdminModel::ADMIN_TYPE_EDITORE_SUPERVISOR;
$exposedFields = array(
"category"=>function ($data){
if (array_key_exists($data, NotiziaModel::$NOTIZIE_CATEGORY) ){
return NotiziaModel::$NOTIZIE_CATEGORY[$data]["label"];
}
else {
return "Sconosciuta";
}
},
"titolo"=>function($data){
$rval = $data;
if (strlen($rval)>80){
$rval = substr($rval, 0, 80)."...";
}
return $rval;
},
"sottotitolo"=>function($data){
$rval = $data;
if (strlen($rval)>80){
$rval = substr($rval, 0, 80)."...";
}
return $rval;
},
"about"=>array("data"=>null,"author"=>null),
"id"=>null
);
$ret = DatatablesHelper::getResult($useModel, $permissionFlagRequired, $exposedFields, array("status"=>NotiziaModel::STATUS_ACCEPTED));
echo json_encode($ret);
?>