remove json lib. depriciate Tools::json function use php function
This commit is contained in:
@@ -43,19 +43,19 @@ class GridHtml extends ModuleGridEngine
|
||||
$this->version = '1.3.1';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
|
||||
Module::__construct();
|
||||
|
||||
|
||||
$this->displayName = $this->l('Simple HTML table display');
|
||||
$this->description = $this->l('Allows the statistics system to display data in a grid.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function install()
|
||||
{
|
||||
return (parent::install() AND $this->registerHook('GridEngine'));
|
||||
}
|
||||
|
||||
|
||||
public static function hookGridEngine($params, $grider)
|
||||
{
|
||||
self::$_columns = $params['columns'];
|
||||
@@ -112,7 +112,7 @@ class GridHtml extends ModuleGridEngine
|
||||
$("#grid_1 tbody").append("<tr><td class=\"center\" colspan=\"" + '.count($params['columns']).' + "\">'.$params['emptyMsg'].'</td></tr>");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function gridNextPage(url)
|
||||
{
|
||||
var from = url.match(/&start=[0-9]+/i);
|
||||
@@ -123,7 +123,7 @@ class GridHtml extends ModuleGridEngine
|
||||
url = url.replace(/&start=[0-9]+/i, "") + from;
|
||||
getGridData(url);
|
||||
}
|
||||
|
||||
|
||||
function gridPrevPage(url)
|
||||
{
|
||||
var from = url.match(/&start=[0-9]+/i);
|
||||
@@ -145,46 +145,46 @@ class GridHtml extends ModuleGridEngine
|
||||
</script>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
||||
public function setColumnsInfos(&$infos)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function setValues($values)
|
||||
{
|
||||
$this->_values = $values;
|
||||
}
|
||||
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->_title = $title;
|
||||
}
|
||||
|
||||
|
||||
public function setSize($width, $height)
|
||||
{
|
||||
$this->_width = $width;
|
||||
$this->_height = $height;
|
||||
}
|
||||
|
||||
|
||||
public function setTotalCount($totalCount)
|
||||
{
|
||||
$this->_totalCount = $totalCount;
|
||||
}
|
||||
|
||||
|
||||
public function setLimit($start, $limit)
|
||||
{
|
||||
$this->_start = (int)$start;
|
||||
$this->_limit = (int)$limit;
|
||||
}
|
||||
|
||||
|
||||
public function render()
|
||||
{
|
||||
echo Tools::jsonEncode(array(
|
||||
echo json_encode(array(
|
||||
'total' => $this->_totalCount,
|
||||
'from' => min($this->_start + 1, $this->_totalCount),
|
||||
'to' => min($this->_start + $this->_limit, $this->_totalCount),
|
||||
'values' => $this->_values
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user