/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Front.php

https://bitbucket.org/sunil_nextbits/magento2 · PHP · 106 lines · 56 code · 17 blank · 33 comment · 0 complexity · 7e3f4561725cbac081ad04e67d409172 MD5 · raw file

  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_Adminhtml
  23. * @copyright Copyright (c) 2012 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. * Product attribute add/edit form main tab
  28. *
  29. * @category Mage
  30. * @package Mage_Adminhtml
  31. * @author Magento Core Team <core@magentocommerce.com>
  32. */
  33. class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Front extends Mage_Adminhtml_Block_Widget_Form
  34. {
  35. protected function _prepareForm()
  36. {
  37. $model = Mage::registry('entity_attribute');
  38. $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
  39. $fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__('Frontend Properties')));
  40. $yesno = array(
  41. array(
  42. 'value' => 0,
  43. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('No')
  44. ),
  45. array(
  46. 'value' => 1,
  47. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Yes')
  48. ));
  49. $fieldset->addField('is_searchable', 'select', array(
  50. 'name' => 'is_searchable',
  51. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Use in Quick Search'),
  52. 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Use in Quick Search'),
  53. 'values' => $yesno,
  54. ));
  55. $fieldset->addField('is_visible_in_advanced_search', 'select', array(
  56. 'name' => 'is_visible_in_advanced_search',
  57. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Use in Advanced Search'),
  58. 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Use in Advanced Search'),
  59. 'values' => $yesno,
  60. ));
  61. $fieldset->addField('is_comparable', 'select', array(
  62. 'name' => 'is_comparable',
  63. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Comparable on the Frontend'),
  64. 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Comparable on the Frontend'),
  65. 'values' => $yesno,
  66. ));
  67. $fieldset->addField('is_filterable', 'select', array(
  68. 'name' => 'is_filterable',
  69. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__("Use in Layered Navigation<br/>(Can be used only with catalog input type 'Dropdown')"),
  70. 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Can be used only with catalog input type Dropdown'),
  71. 'values' => array(
  72. array('value' => '0', 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('No')),
  73. array('value' => '1', 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Filterable (with results)')),
  74. array('value' => '2', 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Filterable (no results)')),
  75. ),
  76. ));
  77. // if ($model->getIsUserDefined() || !$model->getId()) {
  78. $fieldset->addField('is_visible_on_front', 'select', array(
  79. 'name' => 'is_visible_on_front',
  80. 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Visible on Catalog Pages on Front-end'),
  81. 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Visible on Catalog Pages on Front-end'),
  82. 'values' => $yesno,
  83. ));
  84. // }
  85. $form->setValues($model->getData());
  86. $this->setForm($form);
  87. return parent::_prepareForm();
  88. }
  89. }