Skip to content

Commit

Permalink
Reformat code using php-cx-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
tobi-pb committed Sep 18, 2017
1 parent 0f30fec commit ec75f61
Show file tree
Hide file tree
Showing 92 changed files with 140 additions and 200 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
*
*
*/
class Webguys_Easytemplate_Block_Adminhtml_Category_Templates
extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Webguys_Easytemplate_Block_Adminhtml_Category_Templates extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* @return Webguys_Easytemplate_Model_Group
Expand All @@ -33,4 +31,4 @@ public function isInTemplateMode()
{
return ($this->getObjectOfType()->getUseEasytemplate());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ protected function _prepareForm()
$this->setForm($form);
return parent::_prepareForm();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Content
*
*/
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Content
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Content extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* Load Wysiwyg on demand and Prepare layout
Expand Down Expand Up @@ -143,4 +141,4 @@ protected function _isAllowedAction($action)
{
return Mage::getSingleton('admin/session')->isAllowed('cms/block/' . $action);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Main
*
*/
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Main
extends Mage_Adminhtml_Block_Widget_Form
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
protected function _prepareForm()
{
Expand Down Expand Up @@ -176,4 +174,4 @@ protected function _isAllowedAction($action)
{
return Mage::getSingleton('admin/session')->isAllowed('cms/block/' . $action);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Templates
*
*/
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Templates
extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Webguys_Easytemplate_Block_Adminhtml_Cms_Block_Edit_Tab_Templates extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* @return Webguys_Easytemplate_Model_Group
Expand All @@ -30,4 +28,4 @@ public function getObjectOfType()
{
return Mage::registry('cms_block');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
* Class Webguys_Easytemplate_Block_Adminhtml_Cms_Page_Edit_Tab_Templates
*
*/
class Webguys_Easytemplate_Block_Adminhtml_Cms_Page_Edit_Tab_Templates
extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template
implements Mage_Adminhtml_Block_Widget_Tab_Interface
class Webguys_Easytemplate_Block_Adminhtml_Cms_Page_Edit_Tab_Templates extends Webguys_Easytemplate_Block_Adminhtml_Edit_Template implements Mage_Adminhtml_Block_Widget_Tab_Interface
{
/**
* @return Webguys_Easytemplate_Model_Group
Expand All @@ -30,4 +28,4 @@ public function getObjectOfType()
{
return Mage::registry('cms_page');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getCloseButton($id, $position)
'onclick' => '$(\'' . $id . '_top\').hide();$(\'template_content_' . $id . '\').hide();$(\'' . $id . '\').show();',
'class' => 'easytemplate scalable back f-right ' . $position,
'title' => $this->helper('easytemplate')->__('Close'),
'style' => 'display: none;'
'style' => 'display: none;'
)
);
return $button->toHtml();
Expand All @@ -54,19 +54,18 @@ public function getDeleteButtonHtml()
{
return $this->getChildHtml('delete_button');
}
public function getColor()
{
$code = $this->getTemplateModel()->getCode();
$template = Mage::getSingleton('easytemplate/input_parser')->getTemplate($code);
$color = $template->getColor();

if (!$color)
{
$color = '#e7efef';
}

return sprintf('background: %s;', $color);
$code = $this->getTemplateModel()->getCode();
$template = Mage::getSingleton('easytemplate/input_parser')->getTemplate($code);
$color = $template->getColor();

if (!$color) {
$color = '#e7efef';
}

return sprintf('background: %s;', $color);
}

/**
Expand Down Expand Up @@ -97,7 +96,6 @@ public function _toHtml()
$html = parent::_toHtml();

if ($this->getTemplateModel() && $this->getTemplateModel()->getId()) {

foreach ($this->getTemplateModel()->getData() as $replace => $to) {
if (in_array($replace, array('valid_from', 'valid_to'))) {
$date = strftime($this->getDateStrFormat(), strtotime($to));
Expand Down Expand Up @@ -140,4 +138,4 @@ public function setTemplateModel($model)
$this->_template_model = $model;
return $this;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
*
* @method getCode
*/
class Webguys_Easytemplate_Block_Adminhtml_Edit_Renderer
extends Mage_Adminhtml_Block_Widget
class Webguys_Easytemplate_Block_Adminhtml_Edit_Renderer extends Mage_Adminhtml_Block_Widget
{
protected $_template_model;

Expand All @@ -28,7 +27,6 @@ protected function _toHtml()
{
$html = '';
if ($model = $this->getTemplateModel()) {

foreach ($model->getFields() as $field) {
/** @var $field Webguys_Easytemplate_Model_Input_Parser_Field */

Expand All @@ -45,4 +43,4 @@ protected function _toHtml()
}
return $html;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Webguys_Easytemplate_Block_Adminhtml_Edit_Selection extends Mage_Core_Bloc

/**
* searches category label out of Easytemplate XML definition
*
*
* @param string $_category - internal code name of category
* @return string - translated category name
*/
Expand Down Expand Up @@ -83,4 +83,4 @@ public function getTemplates()

return $categories;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* Class Webguys_Easytemplate_Block_Adminhtml_Edit_Template
*
*/
abstract class Webguys_Easytemplate_Block_Adminhtml_Edit_Template
extends Mage_Adminhtml_Block_Widget
abstract class Webguys_Easytemplate_Block_Adminhtml_Edit_Template extends Mage_Adminhtml_Block_Widget
{
protected $_templateBlocks = array();

Expand Down Expand Up @@ -127,4 +126,4 @@ protected function _isAllowedAction($action)
{
return Mage::getSingleton('admin/session')->isAllowed('cms/' . $this->getType() . '/' . $action);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ public function getValue()
}

abstract public function getDefaultBackendModel();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_int');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function getEntityId()
{
return $this->getValue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_varchar');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ public function getValue()
$value = parent::getValue();
return strftime($this->getDateStrFormat(), strtotime($value));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_int');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ public function getHtmlIdPrefix()
{
return 'template_field_{{id}}_';
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public function getFileUri($asPath = false)
) . DS . $this->_value;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_varchar');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ public function getEntityId()

return end(explode('/', $this->getValue()));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function isSelected($value)
$values = explode(',', $this->getValue());
return in_array($value, $values);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function getEntityId()
{
return $this->getValue();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ public function getReferenceDefaultName()
$ex = new Webguys_Easytemplate_Exception_RedirectException();
$ex->prepareRedirect('adminhtml/cms_page');
throw $ex;

}
return $configModel->getTemplate($this->getReference())->getLabel();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ public function getOptionValues()

return false;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_varchar');
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ public function getDefaultBackendModel()
{
return Mage::getModel('easytemplate/template_data_text');
}
}
}
5 changes: 2 additions & 3 deletions app/code/community/Webguys/Easytemplate/Block/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function setChildsBasedOnGroup($group, $parent = null)
$childBlock->setTemplateCode($templateCode);
$childBlock->setGroup($group);

if(!$childBlock->getCacheLifetime()) {
if (!$childBlock->getCacheLifetime()) {
$this->_cachingAllowed=false;
}

Expand All @@ -96,7 +96,6 @@ public function setChildsBasedOnGroup($group, $parent = null)

$frontendValue = $inputValidator->prepareForFrontend($template->getFieldData($fieldCode));
if ($frontendValue) {

$valueTransport = new Varien_Object();
$valueTransport->setValue($frontendValue);

Expand Down Expand Up @@ -150,4 +149,4 @@ protected function _toHtml()
{
return $this->getChildHtml();
}
}
}
3 changes: 1 addition & 2 deletions app/code/community/Webguys/Easytemplate/Block/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,4 @@ public function getCacheLifetime()
}
return $this->getData('cache_lifetime');
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ public function getIFrameLink()
preg_match('/<small>(.*)<\/small>/isU', $this->getMapUrl(), $iframe_link);
return $iframe_link[1];
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ public function getToolbarHtml()
{
return null;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ public function getProductListBlock($skuList, $separator = ',')

return $productList;
}
}
}
2 changes: 1 addition & 1 deletion app/code/community/Webguys/Easytemplate/Helper/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public function flushCache()
$cache->clean(Zend_Cache::CLEANING_MODE_MATCHING_TAG, array(self::CACHE_TAG));
}
}
}
}
3 changes: 1 addition & 2 deletions app/code/community/Webguys/Easytemplate/Helper/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function getGroupByCategoryId($id, $store_id, $store_fallback = false)

// do not use empty store view groups and also filter deactivated items
$collection->getSelect()
->joinLeft('easytemplate','easytemplate.group_id = main_table.id AND active = 1', array())
->joinLeft('easytemplate', 'easytemplate.group_id = main_table.id AND active = 1', array())
->group(array('group_id','store_id'))
->having('(count(easytemplate.group_id) > 0 AND store_id != 0) OR store_id = 0')
;
Expand Down Expand Up @@ -57,5 +57,4 @@ public function getGroupByCategoryId($id, $store_id, $store_fallback = false)
return $newItem;
}
}

}
Loading

0 comments on commit ec75f61

Please sign in to comment.