Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

- Fixed Editor.php undefined variable notice - Fixed PHP7 compliance:… #366

Open
wants to merge 1 commit into
base: 0.9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getRowsJsonConfig()
return Mage::helper('core')->jsonEncode($config);
}

protected function _getBlockSortedColumns($block)
protected function _getBlockSortedColumns($block, $sorted = true)
{
// Get block columns, sort them if needed
$columns = $block->getColumns();
Expand Down
18 changes: 8 additions & 10 deletions app/code/community/BL/CustomGrid/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,18 @@ protected function _parseIntValue($value)
public function parseCsvIntArray($string, $unique=true, $sorted=false, $min=null, $max=null)
{
$values = array_map(array($this, '_parseIntValue'), explode(',', $string));
$filterCodes = array('!is_null($v)');

if ($unique) {
$values = array_unique($values);
}
if (!is_null($min)) {
$filterCodes[] = '($v >= '.intval($min).')';
}
if (!is_null($max)) {
$filterCodes[] = '($v <= '.intval($max).')';
}

$filterCode = 'return ('.implode(' && ', $filterCodes).');';
$values = array_filter($values, create_function('$v', $filterCode));

$_filterCsvInt = function($v) use ($min, $max) {
return !is_null($v)
&& (is_null($min) || $v >= intval($min))
&& (is_null($max) || $v <= intval($max));
};

$values = array_filter($values, $_filterCsvInt);

if ($sorted) {
sort($values, SORT_NUMERIC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,14 +327,18 @@ protected function _getCustomColumns()
'response' => $response,
'type_model' => $this,
));

$filterCallback = function($m) {
return ($m instanceof BL_CustomGrid_Model_Custom_Column_Abstract);
};

$this->_customColumns = array_filter(
array_merge(
$this->_getAdditionalCustomColumns(),
$xmlColumns,
$response->getColumns()
),
create_function('$m', 'return ($m instanceof BL_CustomGrid_Model_Custom_Column_Abstract);')
$filterCallback
);

uasort($this->_customColumns, array($this, '_sortCustomColumns'));
Expand Down