Skip to content

Commit 63e5f77

Browse files
committed
reverted all changes to core files
1 parent ec57883 commit 63e5f77

File tree

9 files changed

+30
-57
lines changed

9 files changed

+30
-57
lines changed

app/code/core/Mage/Adminhtml/Block/Cache/Grid.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,15 @@ public function decorateStatus($value, $row, $column, $isExport)
107107
{
108108
$class = '';
109109
if (isset($this->_invalidatedTypes[$row->getId()])) {
110-
$class = self::CSS_SEVERITY_MINOR;
111-
$value = $this->__('Invalidated');
112-
} elseif ($row->getStatus()) {
113-
$class = self::CSS_SEVERITY_NOTICE;
110+
$cell = '<span class="grid-severity-minor"><span>' . $this->__('Invalidated') . '</span></span>';
114111
} else {
115-
$class = self::CSS_SEVERITY_CRITICAL;
112+
if ($row->getStatus()) {
113+
$cell = '<span class="grid-severity-notice"><span>' . $value . '</span></span>';
114+
} else {
115+
$cell = '<span class="grid-severity-critical"><span>' . $value . '</span></span>';
116+
}
116117
}
117-
return sprintf(self::PATTERN_SEVERITY, $class, $value);
118+
return $cell;
118119
}
119120

120121
/**

app/code/core/Mage/Adminhtml/Block/Permissions/OrphanedResource/Grid.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
1616
*/
1717

18-
use Mage_Adminhtml_Block_Widget_Grid_Massaction_Abstract as MassAction;
19-
2018
/**
2119
* Adminhtml permissions orphanedResource grid
2220
*
@@ -77,7 +75,7 @@ protected function _prepareMassaction()
7775
$this->setMassactionIdField('resource_id');
7876
$this->getMassactionBlock()->setFormFieldName('resource_id');
7977

80-
$this->getMassactionBlock()->addItem(MassAction::DELETE, [
78+
$this->getMassactionBlock()->addItem('delete', [
8179
'label' => Mage::helper('adminhtml')->__('Delete'),
8280
'url' => $this->getUrl('*/*/massDelete'),
8381
'confirm' => Mage::helper('adminhtml')->__('Are you sure you want to do this?'),

app/code/core/Mage/Adminhtml/Block/Widget/Grid.php

-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@
2525
*/
2626
class Mage_Adminhtml_Block_Widget_Grid extends Mage_Adminhtml_Block_Widget
2727
{
28-
public const PATTERN_SEVERITY = '<span class="%s"><span>%s</span></span>';
29-
public const CSS_SEVERITY_CRITICAL = 'grid-severity-critical';
30-
public const CSS_SEVERITY_MAJOR = 'grid-severity-major';
31-
public const CSS_SEVERITY_MINOR = 'grid-severity-minor';
32-
public const CSS_SEVERITY_NOTICE = 'grid-severity-notice';
33-
3428
/**
3529
* Columns array
3630
*

app/code/core/Mage/Cms/Block/Widget/Page/Link.php

+6-20
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public function getHref()
6868
* as parameter or retrieve page title from DB using passed identifier or page id.
6969
*
7070
* @return string
71-
* @throws Mage_Core_Model_Store_Exception
7271
*/
7372
public function getTitle()
7473
{
@@ -78,9 +77,10 @@ public function getTitle()
7877
// compare to null used here bc user can specify blank title
7978
$this->_title = $this->getData('title');
8079
} elseif ($this->getData('page_id')) {
81-
$this->_title = $this->getCmsPageTitleById($this->getData('page_id'));
80+
$this->_title = Mage::getResourceSingleton('cms/page')->getCmsPageTitleById($this->getData('page_id'));
8281
} elseif ($this->getData('href')) {
83-
$this->_title = $this->getCmsPageTitleByIdentifier($this->getData('href'));
82+
$this->_title = Mage::getResourceSingleton('cms/page')->setStore(Mage::app()->getStore())
83+
->getCmsPageTitleByIdentifier($this->getData('href'));
8484
}
8585
}
8686

@@ -93,7 +93,6 @@ public function getTitle()
9393
* if title will be blank string, page identifier will be used.
9494
*
9595
* @return string
96-
* @throws Mage_Core_Model_Store_Exception
9796
*/
9897
public function getAnchorText()
9998
{
@@ -102,27 +101,14 @@ public function getAnchorText()
102101
} elseif ($this->getTitle()) {
103102
$this->_anchorText = $this->getTitle();
104103
} elseif ($this->getData('href')) {
105-
$this->_anchorText = $this->getCmsPageTitleByIdentifier($this->getData('href'));
104+
$this->_anchorText = Mage::getResourceSingleton('cms/page')->setStore(Mage::app()->getStore())
105+
->getCmsPageTitleByIdentifier($this->getData('href'));
106106
} elseif ($this->getData('page_id')) {
107-
$this->_anchorText = $this->getCmsPageTitleById($this->getData('page_id'));
107+
$this->_anchorText = Mage::getResourceSingleton('cms/page')->getCmsPageTitleById($this->getData('page_id'));
108108
} else {
109109
$this->_anchorText = $this->getData('href');
110110
}
111111

112112
return $this->_anchorText;
113113
}
114-
115-
protected function getCmsPageTitleById(int|string $pageId): string
116-
{
117-
return Mage::getResourceSingleton('cms/page')->getCmsPageTitleById($pageId);
118-
}
119-
120-
/**
121-
* @throws Mage_Core_Model_Store_Exception
122-
*/
123-
protected function getCmsPageTitleByIdentifier(int|string $identifier): string
124-
{
125-
return Mage::getResourceSingleton('cms/page')->setStore(Mage::app()->getStore())
126-
->getCmsPageTitleByIdentifier($identifier);
127-
}
128114
}

app/code/core/Mage/Core/Helper/Array.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ public function mergeRecursiveWithoutOverwriteNumKeys(array $baseArray, array $m
3838
} else {
3939
$baseArray[$key] = $value;
4040
}
41-
} elseif ($key) {
42-
$baseArray[$key] = $value;
4341
} else {
44-
$baseArray[] = $value;
42+
if ($key) {
43+
$baseArray[$key] = $value;
44+
} else {
45+
$baseArray[] = $value;
46+
}
4547
}
4648
}
4749

app/code/core/Mage/Index/Block/Adminhtml/Process/Grid.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function __construct()
5252
* Prepare grid collection
5353
*
5454
* @return $this
55-
* @throws Exception
5655
*/
5756
protected function _prepareCollection()
5857
{
@@ -67,7 +66,6 @@ protected function _prepareCollection()
6766
* Add name and description to collection elements
6867
*
6968
* @return $this
70-
* @throws Mage_Core_Exception
7169
*/
7270
protected function _afterLoadCollection()
7371
{
@@ -91,10 +89,10 @@ protected function _afterLoadCollection()
9189
* Prepare grid columns
9290
*
9391
* @return $this
94-
* @throws Exception
9592
*/
9693
protected function _prepareColumns()
9794
{
95+
$baseUrl = $this->getUrl();
9896
$this->addColumn('indexer_code', [
9997
'header' => Mage::helper('index')->__('Index'),
10098
'width' => '180',
@@ -185,16 +183,16 @@ public function decorateStatus($value, $row, $column, $isExport)
185183
$class = '';
186184
switch ($row->getStatus()) {
187185
case Mage_Index_Model_Process::STATUS_PENDING:
188-
$class = self::CSS_SEVERITY_NOTICE;
186+
$class = 'grid-severity-notice';
189187
break;
190188
case Mage_Index_Model_Process::STATUS_RUNNING:
191-
$class = self::CSS_SEVERITY_MAJOR;
189+
$class = 'grid-severity-major';
192190
break;
193191
case Mage_Index_Model_Process::STATUS_REQUIRE_REINDEX:
194-
$class = self::CSS_SEVERITY_CRITICAL;
192+
$class = 'grid-severity-critical';
195193
break;
196194
}
197-
return sprintf(self::PATTERN_SEVERITY, $class, $value);
195+
return '<span class="' . $class . '"><span>' . $value . '</span></span>';
198196
}
199197

200198
/**
@@ -212,13 +210,13 @@ public function decorateUpdateRequired($value, $row, $column, $isExport)
212210
$class = '';
213211
switch ($row->getUpdateRequired()) {
214212
case 0:
215-
$class = self::CSS_SEVERITY_NOTICE;
213+
$class = 'grid-severity-notice';
216214
break;
217215
case 1:
218-
$class = self::CSS_SEVERITY_CRITICAL;
216+
$class = 'grid-severity-critical';
219217
break;
220218
}
221-
return sprintf(self::PATTERN_SEVERITY, $class, $value);
219+
return '<span class="' . $class . '"><span>' . $value . '</span></span>';
222220
}
223221

224222
/**

app/code/core/Mage/Index/Model/Indexer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function getProcessesCollection()
8484
* Get index process by specific id
8585
*
8686
* @param int $processId
87-
* @return Mage_Index_Model_Process|false
87+
* @return Mage_Index_Model_Process | false
8888
*/
8989
public function getProcessById($processId)
9090
{

app/code/core/Mage/Index/Model/Process.php

-6
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
* @method string getIndexCode()
2424
* @method string getIndexerCode()
2525
* @method $this setIndexerCode(string $value)
26-
* @method string getName()
27-
* @method $this setName(string $value)
28-
* @method string getDescription()
29-
* @method $this setDescription(string $value)
3026
* @method string getStatus()
3127
* @method $this setStatus(string $value)
3228
* @method string getStartedAt()
@@ -37,8 +33,6 @@
3733
* @method $this setMode(string $value)
3834
* @method bool getForcePartialReindex()
3935
* @method $this setForcePartialReindex(bool $value)
40-
* @method int getUpdateRequired()
41-
* @method $this setUpdateRequired(int $value)
4236
*/
4337
class Mage_Index_Model_Process extends Mage_Core_Model_Abstract
4438
{

app/code/core/Mage/Reports/Model/Resource/Report/Collection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Mage_Reports_Model_Resource_Report_Collection
3939
/**
4040
* Report period
4141
*
42-
* @var string
42+
* @var int
4343
*/
4444
protected $_period;
4545

@@ -76,7 +76,7 @@ protected function _construct() {}
7676
/**
7777
* Set period
7878
*
79-
* @param string $period
79+
* @param int $period
8080
* @return $this
8181
*/
8282
public function setPeriod($period)

0 commit comments

Comments
 (0)