*/ class Mage_Adminhtml_Model_System_Config_Clone_Media_Image extends Mage_Core_Model_Config_Data { /** * Get fields prefixes * * @return array */ public function getPrefixes() { //$entityType = Mage::getModel('eav/entity_type'); /* @var $entityType Mage_Eav_Model_Entity_Type */ //$entityTypeId = $entityType->loadByCode('catalog_product')->getEntityTypeId(); // use cached eav config $entityTypeId = Mage::getSingleton('eav/config')->getEntityType(Mage_Catalog_Model_Product::ENTITY)->getId(); /* @var $collection Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Attribute_Collection */ $collection = Mage::getResourceModel('catalog/product_attribute_collection'); $collection->setEntityTypeFilter($entityTypeId); $collection->setFrontendInputTypeFilter('media_image'); $prefixes = array(); foreach ($collection as $attribute) { /* @var $attribute Mage_Eav_Model_Entity_Attribute */ $prefixes[] = array( 'field' => $attribute->getAttributeCode() . '_', 'label' => $attribute->getFrontend()->getLabel(), ); } return $prefixes; } }