PageRenderTime 52ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/app/code/Mage/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/Composite.php

https://github.com/JackoPlane/magento2
PHP | 71 lines | 24 code | 4 blank | 43 comment | 4 complexity | fb67ef5a2da98be4bf4b63080196e7d0 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage_DesignEditor
  23. * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. /**
  27. * Composite form element renderer
  28. */
  29. class Mage_DesignEditor_Block_Adminhtml_Editor_Form_Renderer_Composite
  30. extends Mage_DesignEditor_Block_Adminhtml_Editor_Form_Renderer_Recursive
  31. {
  32. /**
  33. * Set of templates to render
  34. *
  35. * Upper is rendered first and is inserted into next using <?php echo $this->getHtml() ?>
  36. * This templates are made of fieldset.phtml but split into several templates
  37. *
  38. * @var array
  39. */
  40. protected $_templates = array(
  41. 'Mage_DesignEditor::editor/form/renderer/composite/children.phtml',
  42. 'Mage_DesignEditor::editor/form/renderer/composite.phtml',
  43. 'Mage_DesignEditor::editor/form/renderer/composite/wrapper.phtml',
  44. );
  45. /**
  46. * Get CSS classes for element
  47. *
  48. * Used in composite.phtml
  49. *
  50. * @return array
  51. */
  52. public function getCssClasses()
  53. {
  54. /** @var $element Mage_DesignEditor_Block_Adminhtml_Editor_Form_Element_Composite_Abstract */
  55. $element = $this->getElement();
  56. $isField = $element->getFieldsetType() == 'field';
  57. $cssClasses = array();
  58. $cssClasses[] = ($isField) ? 'field' : 'fieldset';
  59. if ($element->getClass()) {
  60. $cssClasses[] = $element->getClass();
  61. }
  62. if ($isField && $element->hasAdvanced()) {
  63. $cssClasses[] = 'complex';
  64. }
  65. return $cssClasses;
  66. }
  67. }