/** * Return available attributes * * @param bool $addRenderersCodes Whether renderers codes should be added to attributes objects * @return array */ public function getAvailableAttributes($addRenderersCodes = false, $withEditableFlag = false) { if (!is_null($this->_typeModel)) { $attributes = $this->_typeModel->getAvailableAttributes($this->getBlockType(), $withEditableFlag); if ($addRenderersCodes) { $renderers = Mage::getSingleton('customgrid/column_renderer_attribute')->getRenderersInstances(); foreach ($attributes as $code => $attribute) { $attribute->setRendererCode(null); foreach ($renderers as $name => $renderer) { if ($renderer->isAppliableToColumn($attribute, $this)) { $attribute->setRendererCode($name); break; } } } } return $attributes; } return array(); }