1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25:
26:
27: 28: 29: 30: 31: 32: 33:
34: class Mage_Adminhtml_Block_Catalog_Product_Attribute_Grid extends Mage_Eav_Block_Adminhtml_Attribute_Grid_Abstract
35: {
36: 37: 38: 39: 40:
41: protected function _prepareCollection()
42: {
43: $collection = Mage::getResourceModel('catalog/product_attribute_collection')
44: ->addVisibleFilter();
45: $this->setCollection($collection);
46:
47: return parent::_prepareCollection();
48: }
49:
50: 51: 52: 53: 54:
55: protected function _prepareColumns()
56: {
57: parent::_prepareColumns();
58:
59: $this->addColumnAfter('is_visible', array(
60: 'header'=>Mage::helper('catalog')->__('Visible'),
61: 'sortable'=>true,
62: 'index'=>'is_visible_on_front',
63: 'type' => 'options',
64: 'options' => array(
65: '1' => Mage::helper('catalog')->__('Yes'),
66: '0' => Mage::helper('catalog')->__('No'),
67: ),
68: 'align' => 'center',
69: ), 'frontend_label');
70:
71: $this->addColumnAfter('is_global', array(
72: 'header'=>Mage::helper('catalog')->__('Scope'),
73: 'sortable'=>true,
74: 'index'=>'is_global',
75: 'type' => 'options',
76: 'options' => array(
77: Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE =>Mage::helper('catalog')->__('Store View'),
78: Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE =>Mage::helper('catalog')->__('Website'),
79: Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL =>Mage::helper('catalog')->__('Global'),
80: ),
81: 'align' => 'center',
82: ), 'is_visible');
83:
84: $this->addColumn('is_searchable', array(
85: 'header'=>Mage::helper('catalog')->__('Searchable'),
86: 'sortable'=>true,
87: 'index'=>'is_searchable',
88: 'type' => 'options',
89: 'options' => array(
90: '1' => Mage::helper('catalog')->__('Yes'),
91: '0' => Mage::helper('catalog')->__('No'),
92: ),
93: 'align' => 'center',
94: ), 'is_user_defined');
95:
96: $this->addColumnAfter('is_filterable', array(
97: 'header'=>Mage::helper('catalog')->__('Use in Layered Navigation'),
98: 'sortable'=>true,
99: 'index'=>'is_filterable',
100: 'type' => 'options',
101: 'options' => array(
102: '1' => Mage::helper('catalog')->__('Filterable (with results)'),
103: '2' => Mage::helper('catalog')->__('Filterable (no results)'),
104: '0' => Mage::helper('catalog')->__('No'),
105: ),
106: 'align' => 'center',
107: ), 'is_searchable');
108:
109: $this->addColumnAfter('is_comparable', array(
110: 'header'=>Mage::helper('catalog')->__('Comparable'),
111: 'sortable'=>true,
112: 'index'=>'is_comparable',
113: 'type' => 'options',
114: 'options' => array(
115: '1' => Mage::helper('catalog')->__('Yes'),
116: '0' => Mage::helper('catalog')->__('No'),
117: ),
118: 'align' => 'center',
119: ), 'is_filterable');
120:
121: return $this;
122: }
123: }
124: