*/ abstract class Mage_Connect_Block_Adminhtml_Extension_Custom_Edit_Tab_Abstract extends Mage_Adminhtml_Block_Widget_Form implements Mage_Adminhtml_Block_Widget_Tab_Interface { /** * TODO */ protected $_addRowButtonHtml; /** * TODO */ protected $_removeRowButtonHtml; /** * TODO */ protected $_addFileDepButtonHtml; /** * TODO */ public function __construct() { parent::__construct(); $this->setData(Mage::getSingleton('connect/session')->getCustomExtensionPackageFormData()); } /** * TODO remove ??? */ public function initForm() { return $this; } /** * TODO */ public function getValue($key, $default='') { $value = $this->getData($key); return htmlspecialchars($value ? $value : $default); } /** * TODO */ public function getSelected($key, $value) { return $this->getData($key)==$value ? 'selected="selected"' : ''; } /** * TODO */ public function getChecked($key) { return $this->getData($key) ? 'checked="checked"' : ''; } /** * TODO */ public function getAddRowButtonHtml($container, $template, $title='Add') { if (!isset($this->_addRowButtonHtml[$container])) { $this->_addRowButtonHtml[$container] = $this->getLayout() ->createBlock('adminhtml/widget_button') ->setType('button') ->setClass('add') ->setLabel($this->__($title)) ->setOnClick("addRow('".$container."', '".$template."')") ->toHtml(); } return $this->_addRowButtonHtml[$container]; } /** * TODO */ public function getRemoveRowButtonHtml($selector='span') { if (!$this->_removeRowButtonHtml) { $this->_removeRowButtonHtml = $this->getLayout() ->createBlock('adminhtml/widget_button') ->setType('button') ->setClass('delete') ->setLabel($this->__('Remove')) ->setOnClick("removeRow(this, '".$selector."')") ->toHtml(); } return $this->_removeRowButtonHtml; } public function getAddFileDepsRowButtonHtml($selector='span', $filesClass='files') { if (!$this->_addFileDepButtonHtml) { $this->_addFileDepButtonHtml = $this->getLayout() ->createBlock('adminhtml/widget_button') ->setType('button') ->setClass('add') ->setLabel($this->__('Add files')) ->setOnClick("showHideFiles(this, '".$selector."', '".$filesClass."')") ->toHtml(); } return $this->_addFileDepButtonHtml; } /** * Get Tab Label * * @return string */ public function getTabLabel() { return ''; } /** * Get Tab Title * * @return string */ public function getTabTitle() { return ''; } public function canShowTab() { return true; } public function isHidden() { return false; } }