Fix di un bug relativo alla classe Translator e all'ordinamento di default delle tabelle con Datatables primitivo (Log, ...).
This commit is contained in:
Thomas Zilio 2017-08-28 12:16:14 +02:00
parent 346ac55cba
commit f17a64a1bd
3 changed files with 4 additions and 3 deletions

View File

@ -164,7 +164,7 @@ class Translator extends Util\Singleton
*/ */
public static function translate($string, $parameters = [], $domain = null, $locale = null) public static function translate($string, $parameters = [], $domain = null, $locale = null)
{ {
$translator = self::getInstance(); $translator = self::getInstance()->getTranslator();
if (!empty($translator)) { if (!empty($translator)) {
return $translator->trans($string, $parameters, $domain, $locale); return $translator->trans($string, $parameters, $domain, $locale);
} else { } else {

View File

@ -7,7 +7,7 @@ namespace Util;
*/ */
abstract class Singleton abstract class Singleton
{ {
/** @var \Util\Singleton Oggetto istanziato */ /** @var \Util\Singleton Oggetti istanziati */
protected static $instance = []; protected static $instance = [];
protected function __construct() protected function __construct()
@ -23,7 +23,7 @@ abstract class Singleton
{ {
$class = get_called_class(); // late-static-bound class name $class = get_called_class(); // late-static-bound class name
if (self::$instance[$class] === null) { if (!isset(self::$instance[$class])) {
self::$instance[$class] = new static(); self::$instance[$class] = new static();
} }

View File

@ -453,6 +453,7 @@ function start_datatables() {
ordering: true, ordering: true,
searching: true, searching: true,
paging: false, paging: false,
order: [],
lengthChange: false, lengthChange: false,
scrollY: "50vh", scrollY: "50vh",
}); });