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

Mage_Widget - DOC block update #743

Merged
merged 1 commit into from
Jun 27, 2020
Merged
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
11 changes: 9 additions & 2 deletions app/code/core/Mage/Widget/Block/Adminhtml/Widget/Chooser.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@
* @category Mage
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setConfig(Varien_Object $value)
* @method $this setElement(Varien_Data_Form_Element_Abstract $value)
* @method $this setFieldsetId(string $value)
* @method string getLabel()
* @method $this setTranslationHelper(Mage_Core_Helper_Abstract $value)
* @method $this setSourceUrl(string $value)
* @method $this setUniqId(string $value)
*/

class Mage_Widget_Block_Adminhtml_Widget_Chooser extends Mage_Adminhtml_Block_Template
{
/**
Expand Down Expand Up @@ -143,7 +150,7 @@ public function getHiddenEnabled()
protected function _toHtml()
{
$element = $this->getElement();
/* @var $fieldset Varien_Data_Form_Element_Fieldset */
/* @var Varien_Data_Form_Element_Fieldset $fieldset */
$fieldset = $element->getForm()->getElement($this->getFieldsetId());
$chooserId = $this->getUniqId();
$config = $this->getConfig();
Expand Down
1 change: 1 addition & 0 deletions app/code/core/Mage/Widget/Block/Adminhtml/Widget/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ protected function _getWidgetSelectAfterHtml()
/**
* Return array of available widgets based on configuration
*
* @param bool $withEmptyElement
* @return array
*/
protected function _getAvailableWidgets($withEmptyElement = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getWidgetInstance()
* Prepare layout.
* Adding save_and_continue button
*
* @return $this
* @inheritDoc
*/
protected function _preparelayout()
{
Expand Down Expand Up @@ -88,8 +88,7 @@ public function getHeaderText()
{
if ($this->getWidgetInstance()->getId()) {
return Mage::helper('widget')->__('Widget "%s"', $this->escapeHtml($this->getWidgetInstance()->getTitle()));
}
else {
} else {
return Mage::helper('widget')->__('New Widget Instance');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,25 @@
* @category Mage
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setArea(string $value)
* @method $this setPackage(string $value)
* @method string getSelected()
* @method $this setSelected(string $value)
* @method $this setTheme(string $value)
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block
extends Mage_Adminhtml_Block_Widget
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Block extends Mage_Adminhtml_Block_Widget
{
protected $_layoutHandlesXml = null;

/**
* @var Varien_Simplexml_Element[]
*/
protected $_layoutHandleUpdates = array();

/**
* @var SimpleXMLElement
*/
protected $_layoutHandleUpdatesXml = null;

protected $_layoutHandle = array();
Expand Down Expand Up @@ -170,13 +181,12 @@ protected function _toHtml()
public function getBlocks()
{
if (empty($this->_blocks)) {
/* @var $update Mage_Core_Model_Layout_Update */
$update = Mage::getModel('core/layout')->getUpdate();
/* @var $layoutHandles Mage_Core_Model_Layout_Element */
$this->_layoutHandlesXml = $update->getFileLayoutUpdatesXml(
$this->getArea(),
$this->getPackage(),
$this->getTheme());
$this->getTheme()
);
$this->_collectLayoutHandles();
$this->_collectBlocks();
array_unshift($this->_blocks, array(
Expand All @@ -189,7 +199,6 @@ public function getBlocks()

/**
* Merging layout handles and create xml of merged layout handles
*
*/
protected function _collectLayoutHandles()
{
Expand Down Expand Up @@ -224,7 +233,7 @@ public function _mergeLayoutHandles($handle)
protected function _collectBlocks()
{
if ($blocks = $this->_layoutHandleUpdatesXml->xpath('//block/label/..')) {
/* @var $block Mage_Core_Model_Layout_Element */
/* @var Mage_Core_Model_Layout_Element $block */
foreach ($blocks as $block) {
if ((string)$block->getAttribute('name') && $this->_filterBlock($block)) {
$helper = Mage::helper(Mage_Core_Model_Layout::findTranslationModuleName($block));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@
* @category Mage
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setArea(string $value)
* @method $this setPackage(string $value)
* @method string getSelectName()
* @method $this setSelectName(string $value)
* @method $this setTheme(string $value)
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Layout
extends Mage_Adminhtml_Block_Widget
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Layout extends Mage_Adminhtml_Block_Widget
{
protected $_layoutHandles = array();

Expand Down Expand Up @@ -133,7 +138,8 @@ protected function _toHtml()
->setOptions($this->getLayoutHandles(
$this->getArea(),
$this->getPackage(),
$this->getTheme()));
$this->getTheme()
));
return parent::_toHtml().$selectBlock->toHtml();
}

Expand All @@ -148,7 +154,7 @@ protected function _toHtml()
public function getLayoutHandles($area, $package, $theme)
{
if (empty($this->_layoutHandles)) {
/* @var $update Mage_Core_Model_Layout_Update */
/* @var Mage_Core_Model_Layout_Update $update */
$update = Mage::getModel('core/layout')->getUpdate();
$this->_layoutHandles[''] = Mage::helper('widget')->__('-- Please Select --');
$this->_collectLayoutHandles($update->getFileLayoutUpdatesXml($area, $package, $theme));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
* @category Mage
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*
* @method string getSelected()
* @method $this setSelected(string $value)
* @method array getWidgetTemplates()
* @method $this setWidgetTemplates(array $value)
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Template
extends Mage_Adminhtml_Block_Widget
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Chooser_Template extends Mage_Adminhtml_Block_Widget
{
/**
* Prepare html output
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Form extends Mage_Adminht
/**
* Prepare form before rendering HTML
*
* @return $this
* @inheritDoc
*/
protected function _prepareForm()
{
Expand All @@ -45,5 +45,4 @@ protected function _prepareForm()
$this->setForm($form);
return parent::_prepareForm();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Internal constructor
Expand Down Expand Up @@ -88,7 +86,7 @@ public function isHidden()
/**
* Getter
*
* @return Widget_Model_Widget_Instance
* @return Mage_Widget_Model_Widget_Instance
*/
public function getWidgetInstance()
{
Expand All @@ -98,7 +96,7 @@ public function getWidgetInstance()
/**
* Prepare form before rendering HTML
*
* @return $this
* @inheritDoc
*/
protected function _prepareForm()
{
Expand All @@ -109,7 +107,8 @@ protected function _prepareForm()
'method' => 'post'
));

$fieldset = $form->addFieldset('base_fieldset',
$fieldset = $form->addFieldset(
'base_fieldset',
array('legend' => Mage::helper('widget')->__('Frontend Properties'))
);

Expand Down Expand Up @@ -168,11 +167,11 @@ protected function _prepareForm()
'note' => Mage::helper('widget')->__('Sort Order of widget instances in the same block reference')
));

/* @var $layoutBlock Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout */
$layoutBlock = $this->getLayout()
->createBlock('widget/adminhtml_widget_instance_edit_tab_main_layout')
->setWidgetInstance($widgetInstance);
$fieldset = $form->addFieldset('layout_updates_fieldset',
$fieldset = $form->addFieldset(
'layout_updates_fieldset',
array('legend' => Mage::helper('widget')->__('Layout Updates'))
);
$fieldset->addField('layout_updates', 'note', array(
Expand Down Expand Up @@ -207,7 +206,7 @@ public function getPackegeThemeOptionsArray()
/**
* Initialize form fileds values
*
* @return $this
* @inheritDoc
*/
protected function _initFormValues()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
* @category Mage
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*
* @method Mage_Widget_Model_Widget_Instance getWidgetInstance()
* @method $this setWidgetInstance(Mage_Widget_Model_Widget_Instance $value)
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout
extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Main_Layout extends Mage_Adminhtml_Block_Template implements Varien_Data_Form_Element_Renderer_Interface
{
/**
* @var Varien_Data_Form_Element_Abstract
Expand All @@ -51,6 +53,7 @@ protected function _construct()
/**
* Render given element (return html of element)
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
* @category Mage
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*
* @method $this setWidgetType(string $value)
* @method $this setWidgetValues(array $value)
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Properties
extends Mage_Widget_Block_Adminhtml_Widget_Options
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Properties extends Mage_Widget_Block_Adminhtml_Widget_Options implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Prepare label for tab
Expand Down Expand Up @@ -78,7 +79,7 @@ public function isHidden()
/**
* Getter
*
* @return age_Widget_Model_Widget_Instance
* @return Mage_Widget_Model_Widget_Instance
*/
public function getWidgetInstance()
{
Expand All @@ -89,7 +90,7 @@ public function getWidgetInstance()
* Prepare block children and data.
* Set widget type and widget parameters if available
*
* @return $this
* @inheritDoc
*/
protected function _preparelayout()
{
Expand All @@ -102,7 +103,7 @@ protected function _preparelayout()
* Add field to Options form based on option configuration
*
* @param Varien_Object $parameter
* @return Varien_Data_Form_Element_Abstract
* @return Varien_Data_Form_Element_Abstract|false
*/
protected function _addField($parameter)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
* @package Mage_Widget
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Settings
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Mage_Widget_Block_Adminhtml_Widget_Instance_Edit_Tab_Settings extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected function _construct()
{
Expand Down Expand Up @@ -94,7 +92,7 @@ public function getWidgetInstance()
/**
* Prepare form before rendering HTML
*
* @return $this
* @inheritDoc
*/
protected function _prepareForm()
{
Expand All @@ -105,7 +103,8 @@ protected function _prepareForm()
'method' => 'post'
));

$fieldset = $form->addFieldset('base_fieldset',
$fieldset = $form->addFieldset(
'base_fieldset',
array('legend'=>Mage::helper('widget')->__('Settings'))
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ protected function _construct()
/**
* Prepare grid collection object
*
* @return $this
* @inheritDoc
*/
protected function _prepareCollection()
{
/* @var $collection Mage_Widget_Model_Mysql4_Widget_Instance_Collection */
/* @var Mage_Widget_Model_Mysql4_Widget_Instance_Collection $collection */
$collection = Mage::getModel('widget/widget_instance')->getCollection();
$this->setCollection($collection);
return parent::_prepareCollection();
Expand All @@ -61,7 +61,7 @@ protected function _prepareCollection()
/**
* Prepare grid columns
*
* @return $this
* @inheritDoc
*/
protected function _prepareColumns()
{
Expand Down Expand Up @@ -143,6 +143,7 @@ public function getPackageThemeOptionsArray()
/**
* Row click url
*
* @param Mage_Widget_Model_Widget_Instance $row
* @return string
*/
public function getRowUrl($row)
Expand Down
Loading