/** * @return Mage_Adminhtml_Block_Widget_Button */ protected function _getChooserButton() { $config = $this->getConfig(); /** @var Mage_Adminhtml_Block_Widget_Button $chooseButton */ $chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setClass('scalable add-image plugin')->setLabel($config['button']['open'])->setOnclick('MediabrowserUtility.openDialog(\'' . $this->getUrl('*/cms_wysiwyg_images/index', array('target_element_id' => $this->_dummyFieldInput->getHtmlId())) . '\')')->setStyle('display:inline;margin-top:7px'); // Check if there is a value. If yes value then we want the chooser button to be disabled if ($this->_fieldInput->getValue()) { $chooseButton->setDisabled(true); } return $chooseButton; }