diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tab/Main.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tab/Main.php index f10b8f54570..6c2b4ed42a4 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tab/Main.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Edit/Tab/Main.php @@ -123,20 +123,6 @@ protected function _prepareForm() 'class' => 'validate-digits', )); - $fieldset->addField('is_wysiwyg_enabled', 'select', array( - 'name' => 'is_wysiwyg_enabled', - 'label' => Mage::helper('eav')->__('Enable WYSIWYG'), - 'title' => Mage::helper('eav')->__('Enable WYSIWYG'), - 'values' => $yesnoSource, - )); - - // define field dependencies - $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence') - ->addFieldMap("is_wysiwyg_enabled", 'wysiwyg_enabled') - ->addFieldMap("frontend_input", 'frontend_input_type') - ->addFieldDependence('wysiwyg_enabled', 'frontend_input_type', 'textarea') - ); - Mage::dispatchEvent("adminhtml_{$attributeObject->getEntityTypeCode()}_attribute_edit_prepare_form", array( 'form' => $form, 'attribute' => $attributeObject diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid.php index dffefac5acf..7fd63c06621 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Grid.php @@ -34,8 +34,9 @@ class Mage_Eav_Block_Adminhtml_Attribute_Grid extends Mage_Eav_Block_Adminhtml_A protected function _prepareCollection() { if ($entity_type = Mage::registry('entity_type')) { - $collection = Mage::getResourceModel($entity_type->getEntityAttributeCollection()) - ->setEntityTypeFilter($entity_type->getEntityTypeId()); + /** @var $collection Mage_Eav_Model_Resource_Entity_Attribute_Collection */ + $collection = Mage::getResourceModel($entity_type->getEntityAttributeCollection()); + $collection->setEntityTypeFilter($entity_type->getEntityTypeId()); $this->setCollection($collection); } return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Main.php b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Main.php index d3d9900bbbc..581660e4238 100644 --- a/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Main.php +++ b/app/code/core/Mage/Eav/Block/Adminhtml/Attribute/Set/Main.php @@ -191,10 +191,11 @@ public function getGroupTreeJson() $item['allowDrop'] = true; $item['allowDrag'] = true; - $nodeChildren = Mage::getResourceModel($entity_type->getEntityAttributeCollection()) - ->setEntityTypeFilter($entity_type->getEntityTypeId()) - ->setAttributeGroupFilter($node->getId()) - ->load(); + /** @var $nodeChildren Mage_Eav_Model_Entity_Attribute */ + $nodeChildren = Mage::getResourceModel($entity_type->getEntityAttributeCollection()); + $nodeChildren->setEntityTypeFilter($entity_type->getEntityTypeId()) + ->setAttributeGroupFilter($node->getId()) + ->load(); if ($nodeChildren->getSize() > 0) { $item['children'] = array(); @@ -234,10 +235,11 @@ public function getAttributeTreeJson() /* @var $entity_type Mage_Eav_Model_Entity_Type */ $entity_type = Mage::registry('entity_type'); - $collection = Mage::getResourceModel($entity_type->getEntityAttributeCollection()) - ->setEntityTypeFilter($entity_type->getEntityTypeId()) - ->setAttributeSetFilter($setId) - ->load(); + /** @var $collection Mage_Eav_Model_Resource_Entity_Attribute_Collection */ + $collection = Mage::getResourceModel($entity_type->getEntityAttributeCollection()); + $collection->setEntityTypeFilter($entity_type->getEntityTypeId()) + ->setAttributeSetFilter($setId) + ->load(); $attributesIds = array('0'); /* @var $item Mage_Eav_Model_Entity_Attribute */ @@ -245,11 +247,12 @@ public function getAttributeTreeJson() $attributesIds[] = $item->getAttributeId(); } - $attributes = Mage::getResourceModel($entity_type->getEntityAttributeCollection()) - ->setEntityTypeFilter($entity_type->getEntityTypeId()) - ->setAttributesExcludeFilter($attributesIds) - ->setOrder('attribute_code', 'asc') - ->load(); + /** @var $attributes Mage_Eav_Model_Resource_Entity_Attribute_Collection */ + $attributes = Mage::getResourceModel($entity_type->getEntityAttributeCollection()); + $attributes->setEntityTypeFilter($entity_type->getEntityTypeId()) + ->setAttributesExcludeFilter($attributesIds) + ->setOrder('attribute_code', 'asc') + ->load(); foreach ($attributes as $child) { $attr = array( @@ -355,7 +358,7 @@ public function getRenameButton() /** * Retrieve current Attribute Set object * - * @return Mage_Eav_Model_Entity_Set + * @return Mage_Eav_Model_Entity_Attribute_Set */ protected function _getAttributeSet() { @@ -392,7 +395,7 @@ public function getIsCurrentSetDefault() * Retrieve current Attribute Set object * * @deprecated use _getAttributeSet - * @return Mage_Eav_Model_Entity_Set + * @return Mage_Eav_Model_Entity_Attribute_Set */ protected function _getSetData() { diff --git a/app/code/core/Mage/Eav/controllers/Adminhtml/Attribute/AbstractController.php b/app/code/core/Mage/Eav/controllers/Adminhtml/Attribute/AbstractController.php index d92ed4eb884..42618cdff09 100644 --- a/app/code/core/Mage/Eav/controllers/Adminhtml/Attribute/AbstractController.php +++ b/app/code/core/Mage/Eav/controllers/Adminhtml/Attribute/AbstractController.php @@ -133,8 +133,10 @@ public function validateAction() $attributeCode = $this->getRequest()->getParam('attribute_code'); $attributeId = $this->getRequest()->getParam('attribute_id'); - $attribute = Mage::getModel($this->_entityType->getAttributeModel()) - ->loadByCode($this->_entityType->getEntityTypeId(), $attributeCode); + + /** @var $attribute Mage_Eav_Model_Entity_Attribute */ + $attribute = Mage::getModel($this->_entityType->getAttributeModel()); + $attribute->loadByCode($this->_entityType->getEntityTypeId(), $attributeCode); if ($attribute->getId() && !$attributeId) { Mage::getSingleton('adminhtml/session')->addError( diff --git a/app/code/core/Mage/Eav/controllers/Adminhtml/Set/AbstractController.php b/app/code/core/Mage/Eav/controllers/Adminhtml/Set/AbstractController.php index a1b9023e1dd..9923c635fb7 100644 --- a/app/code/core/Mage/Eav/controllers/Adminhtml/Set/AbstractController.php +++ b/app/code/core/Mage/Eav/controllers/Adminhtml/Set/AbstractController.php @@ -113,10 +113,10 @@ public function saveAction() /* @var $model Mage_Eav_Model_Entity_Attribute_Set */ $model = Mage::getModel('eav/entity_attribute_set') - ->setEntityTypeId($entityTypeId); + ->setEntityTypeId($entityTypeId); - /** @var $helper Mage_Adminhtml_Helper_Data */ - $helper = Mage::helper('adminhtml'); + /* @var $helper Mage_Eav_Helper_Data */ + $helper = Mage::helper('eav'); try { if ($isNewSet) {