public function render(Varien_Data_Form_Element_Abstract $element) { if ($element->getScope() == "stores") { $this->setStoreId($element->getScopeId()); } // Remove the scope information so it doesn't get printed out $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); return parent::render($element); }
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { $scope = $element->getScope(); $scope_id = $element->getScopeId(); $inherit = $element->getInherit(); $factoryName = (string) $element->getFieldConfig()->source_model; $sourceModel = Mage::getSingleton($factoryName); $optionArray = $sourceModel->toOptionArray(True, $scope, $scope_id); $element->setValues($optionArray); $html = $this->getElementHtml($element); return $html; // return parent::_getElementHtml($element); }
public function render(Varien_Data_Form_Element_Abstract $element) { // Only show the current scope hasn't been configured yet switch ($element->getScope()) { case "stores": if ($this->hasApiKeys($element->getScopeId())) { return ""; } break; case "websites": $website = Mage::app()->getWebsite($element->getScopeId()); if ($this->hasApiKeys($website->getStores())) { return ""; } break; default: if ($this->hasApiKeys()) { return ""; } } // Remove the scope information so it doesn't get printed out $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue(); return parent::render($element); }