Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted several grids from Magento\Sales module to new layout xml config format: #488

Closed
wants to merge 11 commits into from
16 changes: 4 additions & 12 deletions app/code/Magento/Backend/Block/Catalog/Product/Tab/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,31 @@ class Container extends \Magento\Backend\Block\Template
{

/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return '';
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
return $this->getTabLabel();
}

/**
* Can show tab in tabs
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
return true;
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function isHidden()
{
Expand Down
16 changes: 4 additions & 12 deletions app/code/Magento/Backend/Block/Widget/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,39 +29,31 @@
class Tab extends \Magento\Backend\Block\Template implements TabInterface
{
/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return $this->getLabel();
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
return $this->getTitle();
}

/**
* Can show tab in tabs
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
return $this->hasCanShow() ? (bool) $this->getCanShow() : true;
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function isHidden()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ public function getAccordionHtml()
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,23 @@ abstract class AbstractTab
implements \Magento\Backend\Block\Widget\Tab\TabInterface
{
/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return $this->getTabTitle();
}

/**
* Can show tab in tabs
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
return true;
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function isHidden()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ protected function _toHtml()
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ protected function _construct()
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,15 @@ protected function _getGoogleExperiment()
protected abstract function _getEntity();

/**
* Can show tab in tabs
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
return $this->_helperData->isGoogleExperimentActive();
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function isHidden()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,15 @@ protected function _getEntity()
}

/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return __('Product View Optimization');
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,15 @@ protected function _getEntity()
}

/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return __('Page View Optimization');
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ protected function _construct()
}

/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
Expand Down
58 changes: 58 additions & 0 deletions app/code/Magento/Payment/Model/Resource/Grid/GroupsArray.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
* @package Magento_Sales
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

namespace Magento\Payment\Model\Resource\Grid;

/**
* Sales transaction types option array
*/
class GroupsArray implements \Magento\Core\Model\Option\ArrayInterface
{
/**
* Payment data
*
* @var \Magento\Payment\Helper\Data
*/
protected $_paymentData;

/**
* @param \Magento\Payment\Helper\Data $paymentData
*/
public function __construct(\Magento\Payment\Helper\Data $paymentData)
{
$this->_paymentData = $paymentData;
}

/**
* Return option array
*
* @return array
*/
public function toOptionArray()
{
return $this->_paymentData->getPaymentMethodList(true, true, true);
}
}
58 changes: 58 additions & 0 deletions app/code/Magento/Payment/Model/Resource/Grid/TypesArray.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@magentocommerce.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Magento
* @package Magento_Sales
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

namespace Magento\Payment\Model\Resource\Grid;

/**
* Sales transaction payment method types option array
*/
class TypesArray implements \Magento\Core\Model\Option\ArrayInterface
{
/**
* Payment data
*
* @var \Magento\Payment\Helper\Data
*/
protected $_paymentData;

/**
* @param \Magento\Payment\Helper\Data $paymentData
*/
public function __construct(\Magento\Payment\Helper\Data $paymentData)
{
$this->_paymentData = $paymentData;
}

/**
* Return option array
*
* @return array
*/
public function toOptionArray()
{
return $this->_paymentData->getPaymentMethodList(true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,39 +64,31 @@ public function __construct(
}

/**
* Return Tab label
*
* @return string
* {@inheritdoc}
*/
public function getTabLabel()
{
return __('General Information');
}

/**
* Return Tab title
*
* @return string
* {@inheritdoc}
*/
public function getTabTitle()
{
return __('General Information');
}

/**
* Can show tab in tabs
*
* @return boolean
* {@inheritdoc}
*/
public function canShowTab()
{
return true;
}

/**
* Tab is hidden
*
* @return boolean
* {@inheritdoc}
*/
public function isHidden()
{
Expand Down
Loading