Exemplo n.º 1
0
 /**
  * @return bool
  */
 public function getDatabaseExists()
 {
     if (strpos($this->_currentElement->getHtmlId(), 'dbName2') !== false) {
         $value1 = Mage::registry('system_fastindexer_dbName1');
         if (strtolower($this->_currentElement->getValue()) === strtolower($value1)) {
             return false;
         }
     }
     $dbName = $this->_currentElement->getData('value');
     if (empty($dbName)) {
         return false;
     }
     $result = $this->_connection->fetchOne('SELECT SCHEMA_NAME FROM `INFORMATION_SCHEMA`.`SCHEMATA` WHERE SCHEMA_NAME=:db', ['db' => $dbName]);
     return $result !== false;
 }
Exemplo n.º 2
0
 /**
  * Disable fields depending on product type
  *
  * @return Mage_CatalogInventory_Block_Adminhtml_Form_Field_Stock
  */
 protected function _disableFields()
 {
     if (!$this->_isProductComposite() && null === $this->_qty->getValue()) {
         $this->setDisabled('disabled');
     }
     if ($this->_isProductComposite()) {
         $this->_qty->setDisabled('disabled');
     }
     return $this;
 }
 /**
  * @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;
 }
Exemplo n.º 4
0
 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $helper = Mage::helper('netzarbeiter_groupscatalog2');
     if ($helper->getConfig('show_multiselect_field')) {
         $html = parent::_getElementHtml($element);
     } else {
         $label = new Varien_Data_Form_Element_Text();
         $label->setData($element->getData())->setType('text')->setExtType('textfield')->addClass('input-text')->setReadOnly(true)->setForm($element->getForm())->setId($element->getId());
         $value = explode(',', (string) $label->getValue());
         $groups = $helper->getGroupNamesAsString($value);
         $label->setValue($groups);
         $html = $label->getElementHtml();
     }
     return $html;
 }