Create pagine per notizie in pending e rifiutate; Creati componenti grafici per mostrare Notizia, Commento e lista commenti; Bugfix e limature su amministrazione
46 lines
1.2 KiB
PHP
46 lines
1.2 KiB
PHP
<?php
|
|
/*
|
|
Author: Riccardo Di Dato
|
|
Creation Date: 25/gen/2016
|
|
*/
|
|
|
|
|
|
require_once(dirname(__FILE__)."/../../load.php");
|
|
|
|
$useModel = "NotiziaModel";
|
|
$permissionFlagRequired = AdminModel::ADMIN_TYPE_EDITORE;
|
|
$exposedFields = array(
|
|
"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;
|
|
},
|
|
"status"=>function ($data) {
|
|
switch ($data){
|
|
case NotiziaModel::STATUS_ACCEPTED:
|
|
return "<span style=\"color:green;\">".NotiziaModel::$NOTIZIA_STATUS[$data]["label"]."</span>";
|
|
case NotiziaModel::STATUS_PENDING:
|
|
return "<span style=\"color:#FF9440;\">".NotiziaModel::$NOTIZIA_STATUS[$data]["label"]."</span>";
|
|
case NotiziaModel::STATUS_REJECTED:
|
|
return "<span style=\"color:red;\">".NotiziaModel::$NOTIZIA_STATUS[$data]["label"]."</span>";
|
|
default:
|
|
return "Sconosciuto";
|
|
}
|
|
},
|
|
"about"=>array("data"=>null),
|
|
"id"=>null
|
|
);
|
|
|
|
$ret = DatatablesHelper::getResult($useModel, $permissionFlagRequired, $exposedFields,array("about.owner"=>AdminLoginManager::getLogged()->id));
|
|
echo json_encode($ret);
|
|
|
|
?>
|