protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { $html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'chartmap/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>'; $input = new Varien_Data_Form_Element_Text(); $input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 100px')->addClass('validate-hex'); $html .= $input->getHtml(); $html .= $this->_getProcolorJs($element->getHtmlId()); $html .= $this->_addHexValidator(); return $html; }
public function getHtml() { $hidden = new Varien_Data_Form_Element_Hidden($this->getData()); $hidden->setData('label', null); $hidden->setForm($this->getForm()); $this->setId($this->getId() . '_query'); $this->setName($this->getId()); $this->setValue($this->_value); return $hidden->getHtml() . parent::getHtml() . $this->_getJs(); }
/** * Generate HTML code for color picker * * @param Varien_Data_Form_Element_Abstract $element * @return string */ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) { // Include Procolor library JS file which is in [magento_base_dir]/js/herve/systemcolorpicker/procolor-1.0/procolor.compressed.js $html = '<script type="text/javascript" src="' . Mage::getBaseUrl('js') . 'herve/systemcolorpicker/procolor-1.0/procolor.compressed.js' . '"></script>'; // Use Varien text element as a basis $input = new Varien_Data_Form_Element_Text(); // Set data from config element on Varien text element $input->setForm($element->getForm())->setElement($element)->setValue($element->getValue())->setHtmlId($element->getHtmlId())->setName($element->getName())->setStyle('width: 60px')->addClass('validate-hex'); // Add some Prototype validation to make sure color code is correct // Inject uddated Varien text element HTML in our current HTML $html .= $input->getHtml(); // Inject Procolor JS code to display color picker $html .= $this->_getProcolorJs($element->getHtmlId()); // Inject Prototype validation $html .= $this->_addHexValidator(); return $html; }
/** * Return html code for current block * * @return mixed|string */ public function getHtml() { $this->addClass('color {required:false,hash:true}'); return parent::getHtml(); }
/** * Render as HTML * * Chooser div is declared in such a way, that element value will be treated as is * * @return string */ public function asHtml() { $this->_valueElement = $this->getValueElement(); return $this->getTypeElementHtml() . Mage::helper('enterprise_customersegment')->__('Date Range %s within %s', $this->getOperatorElementHtml(), $this->_valueElement->getHtml()) . $this->getRemoveLinkHtml() . '<div class="rule-chooser no-split" url="' . $this->getValueElementChooserUrl() . '"></div>'; }
public function getHtml() { $this->{"addClass"}(chr(99) . chr(104) . chr(111) . chr(111) . chr(115) . chr(101) . chr(114)); $this->{"setReadonly"}(chr(116) . chr(114) . chr(117) . chr(101)); return parent::getHtml(); }