本文整理汇总了PHP中Varien_Data_Form_Element_Hidden类的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Hidden类的具体用法?PHP Varien_Data_Form_Element_Hidden怎么用?PHP Varien_Data_Form_Element_Hidden使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Varien_Data_Form_Element_Hidden类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _toHtml
protected function _toHtml()
{
$element = $this->getElement();
/* @var $fieldset Varien_Data_Form_Element_Fieldset */
$fieldset = $element->getForm()->getElement($this->getFieldsetId());
$chooserId = $this->getUniqId();
$config = $this->getConfig();
// add chooser element to fieldset
$chooser = $fieldset->addField('chooser' . $element->getId(), 'note', array('label' => $config->getLabel() ? $config->getLabel() : '', 'value_class' => 'value2'));
$hiddenHtml = '';
if ($this->getHiddenEnabled()) {
$hidden = new Varien_Data_Form_Element_Hidden($element->getData());
$hidden->setId("{$chooserId}value")->setForm($element->getForm());
if ($element->getRequired()) {
$hidden->addClass('required-entry');
}
$hiddenHtml = $hidden->getElementHtml();
$element->setValue('');
}
$buttons = $config->getButtons();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setId($chooserId . 'control')->setClass('btn-chooser')->setLabel($buttons['open'])->setOnclick($chooserId . '.choose()');
$delButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setId($chooserId . 'del_control')->setClass('btn-del-img')->setLabel(' Delete image ')->setOnclick('del(this)');
$chooser->setData('after_element_html', $hiddenHtml . $chooseButton->toHtml() . $delButton->toHtml());
// render label and chooser scripts
$configJson = Mage::helper('core')->jsonEncode($config->getData());
return '
<label class="widget-option-label" id="' . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('widget')->__('Not Selected')) . '</label>
<div id="' . $chooserId . 'advice-container" class="hidden"></div>
<script type="text/javascript">
' . $chooserId . ' = new WysiwygWidget.chooser("' . $chooserId . '", "' . $this->getSourceUrl() . '", ' . $configJson . ');
</script>
';
}
开发者ID:programmerrahul,项目名称:vastecom,代码行数:33,代码来源:Widget.php
示例2: getAfterElementHtml
public function getAfterElementHtml()
{
$html = $this->getData('after_element_html');
$product = Mage::registry('product');
$storeId = $product->getStoreId();
$store = Mage::app()->getStore($storeId);
$html .= '<strong>[' . (string) $store->getBaseCurrencyCode() . ']</strong>';
if (Mage::helper('tax')->priceIncludesTax($store)) {
$inclTax = Mage::helper('tax')->__('Inc. Tax');
$html .= " <strong>[{$inclTax} <span id=\"dynamic-tax-{$this->getHtmlId()}\"></span>]</strong>";
}
if (!is_numeric($this->getIdentifier())) {
return $html;
}
$data = array('name' => str_replace('[price]', '[update_price]', $this->getData('name')), 'disabled' => true);
$hidden = new Varien_Data_Form_Element_Hidden($data);
$hidden->setForm($this->getForm());
$data['html_id'] = str_replace('[price]', '[update_price]', $this->getHtmlId());
$data['label'] = Mage::helper('adyen_subscription')->__('Update prices of all existing subscriptions (prices be updated by cron)', $this->getData('subscription_count'));
$data['value'] = 1;
$checkbox = new Varien_Data_Form_Element_Checkbox($data);
$checkbox->setForm($this->getForm());
$checkbox->getElementHtml();
return $html . "<br />\n" . $checkbox->getElementHtml() . $checkbox->getLabelHtml();
}
开发者ID:sandermangel,项目名称:adyen-magento-subscription,代码行数:25,代码来源:Price.php
示例3: getHtml
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();
}
开发者ID:praxigento,项目名称:mage_app_prxgt_store,代码行数:10,代码来源:Autocompleter.php
示例4: prepareElementHtml
/**
* Prepare chooser element HTML
*
* @param Varien_Data_Form_Element_Abstract $element Form Element
* @return Varien_Data_Form_Element_Abstract
*/
public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$this->_elementValueId = "{$element->getId()}";
$this->_selectedBanners = explode(',', $element->getValue());
//Create hidden field that store selected banner ids
$hidden = new Varien_Data_Form_Element_Hidden($element->getData());
$hidden->setId($this->_elementValueId)->setForm($element->getForm());
$hiddenHtml = $hidden->getElementHtml();
$element->setValue('')->setValueClass('value2');
$element->setData('after_element_html', $hiddenHtml . $this->toHtml());
return $element;
}
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:18,代码来源:Chooser.php
示例5: getElementHtml
/**
* Return checkbox html with hidden field for correct config values
*
* @param string $elementId
* @return string
*/
public function getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
if ($element->getType() != 'checkbox') {
return $element->getElementHtml();
}
$configValue = (string) $element->getValue();
if ($configValue) {
$element->setChecked(true);
} else {
$element->setValue('1');
}
if ($element->getCanUseDefaultValue() && $element->getInherit()) {
$element->setDisabled(true);
}
$hidden = new Varien_Data_Form_Element_Hidden(array('html_id' => $element->getHtmlId() . '_value', 'name' => $element->getName(), 'value' => '0'));
$hidden->setForm($element->getForm());
return $hidden->getElementHtml() . $element->getElementHtml();
}
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:24,代码来源:Global.php
示例6: getElementHtml
public function getElementHtml()
{
$element = $this->getElement();
if (!$element->getValue()) {
return parent::getElementHtml();
}
$element->setOnkeyup("onUrlkeyChanged('" . $element->getHtmlId() . "')");
$element->setOnchange("onUrlkeyChanged('" . $element->getHtmlId() . "')");
$data = array('name' => $element->getData('name') . '_create_redirect', 'disabled' => true);
$hidden = new Varien_Data_Form_Element_Hidden($data);
$hidden->setForm($element->getForm());
$storeId = $element->getForm()->getDataObject()->getStoreId();
$data['html_id'] = $element->getHtmlId() . '_create_redirect';
$data['label'] = Mage::helper('catalog')->__('Create Permanent Redirect for old URL');
$data['value'] = $element->getValue();
$data['checked'] = Mage::helper('catalog')->shouldSaveUrlRewritesHistory($storeId);
$checkbox = new Varien_Data_Form_Element_Checkbox($data);
$checkbox->setForm($element->getForm());
return parent::getElementHtml() . '<br/>' . $hidden->getElementHtml() . $checkbox->getElementHtml() . $checkbox->getLabelHtml();
}
开发者ID:par-orillonsoft,项目名称:app,代码行数:20,代码来源:Urlkey.php
示例7: _toHtml
/**
* Return chooser HTML and init scripts
*
* @return string
*/
protected function _toHtml()
{
$element = $this->getElement();
/* @var $fieldset Varien_Data_Form_Element_Fieldset */
$fieldset = $element->getForm()->getElement($this->getFieldsetId());
$chooserId = $this->getUniqId();
$config = $this->getConfig();
// add chooser element to fieldset
$chooser = $fieldset->addField('chooser' . $element->getId(), 'note', array('label' => $config->getLabel() ? $config->getLabel() : '', 'value_class' => 'value2'));
$hiddenHtml = '';
if ($this->getHiddenEnabled()) {
$hidden = new Varien_Data_Form_Element_Hidden($element->getData());
$hidden->setId("{$chooserId}value")->setForm($element->getForm());
if ($element->getRequired()) {
$hidden->addClass('required-entry');
}
$hiddenHtml = $hidden->getElementHtml();
$element->setValue('');
}
$buttons = $config->getButtons();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setId($chooserId . 'control')->setClass('btn-chooser')->setLabel($buttons['open'])->setOnclick($chooserId . '.choose()')->setDisabled($element->getReadonly());
$chooser->setData('after_element_html', $hiddenHtml . $chooseButton->toHtml());
// render label and chooser scripts
$configJson = Mage::helper('core')->jsonEncode($config->getData());
return '
<label class="widget-option-label" id="' . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('widget')->__('Not Selected')) . '</label>
<div id="' . $chooserId . 'advice-container" class="hidden"></div>
<script type="text/javascript">//<![CDATA[
(function() {
var instantiateChooser = function() {
window.' . $chooserId . ' = new WysiwygWidget.chooser(
"' . $chooserId . '",
"' . $this->getSourceUrl() . '",
' . $configJson . '
);
if ($("' . $chooserId . 'value")) {
$("' . $chooserId . 'value").advaiceContainer = "' . $chooserId . 'advice-container";
}
}
if (document.loaded) { //allow load over ajax
instantiateChooser();
} else {
document.observe("dom:loaded", instantiateChooser);
}
})();
//]]></script>
';
}
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:54,代码来源:Chooser.php
示例8: _toHtml
/**
* Return chooser HTML and init scripts
*
* @return string
*/
protected function _toHtml()
{
if (is_null(Mage::registry('megamenu_adminhtml_widget_chooser'))) {
return parent::_toHtml();
}
//unregister
Mage::unregister('megamenu_adminhtml_widget_chooser');
$element = $this->getElement();
$htmlIdPrefix = $element->getForm()->getHtmlIdPrefix();
/* @var $fieldset Varien_Data_Form_Element_Fieldset */
// $fieldset = $element->getForm()->getElement($this->getFieldsetId());// getForm >> getFieldset >> field
$chooserId = $this->getUniqId();
// echo $chooserId;die; //options_fieldset_megamenu_sm_megamenu_product_id44c9ff3c66b2985cea68c24a0e23ef5b
// $sourceUrl chua' megamenu gay loi khi ajax :http://127.0.0.1/mage1510/index.php/*megamenu*/catalog_product_widget/chooser/uniq_id/options_fieldset_megamenu_id_pathc0244322fc3e6acc4edb
$admin = Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
$SourceUrl = str_replace("/megamenu/", "/{$admin}/", $this->getSourceUrl());
$SourceUrl = str_replace("/uniq_id/", "/uniq_id/" . $htmlIdPrefix, $SourceUrl);
$this->setSourceUrl($SourceUrl);
$config = $this->getConfig();
// add chooser element to fieldset
// $chooser = $fieldset->addField('chooser' . $element->getId(), 'note', array(
// 'label' => $config->getLabel() ? $config->getLabel() : '',
// 'value_class' => 'value2',
// ));
$hiddenHtml = '';
if ($this->getHiddenEnabled()) {
$hidden = new Varien_Data_Form_Element_Hidden($element->getData());
$hidden->setId("{$chooserId}value")->setForm($element->getForm());
if ($element->getRequired()) {
$hidden->addClass('required-entry');
}
$hiddenHtml = $hidden->getElementHtml();
$element->setValue('');
}
// $config->getData() ;// array(1) { ["buttons"] => array(2) { ["open"] => string(17) "Select Product..." ["close"] => string(5) "Close" } }
$configJson = Mage::helper('core')->jsonEncode($config->getData());
$js = '
<script type="text/javascript">
' . $htmlIdPrefix . $chooserId . ' = new WysiwygWidget.chooser("' . $htmlIdPrefix . $chooserId . '", "' . $this->getSourceUrl() . '", ' . $configJson . ');
// $("' . $chooserId . 'value").advaiceContainer = "' . $chooserId . 'advice-container";
</script>
';
$buttons = $config->getButtons();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setId($htmlIdPrefix . $chooserId . 'control')->setClass('btn-chooser')->setLabel($buttons['open'])->setOnclick($htmlIdPrefix . $chooserId . '.choose();$$(\'.' . $hidden->getName() . '\')[0].id=\'\';$$(\'.data_type\')[0].id=\'' . $htmlIdPrefix . $chooserId . 'value\';');
// ->setOnclick($htmlIdPrefix.$chooserId.'.choose();$$(\'.'.$hidden->getName().'\')[0].name=$$(\'.data_type\')[0].name;');
// $chooser->setData('after_element_html', $hiddenHtml . $chooseButton->toHtml().$js);
// render label and chooser scripts
$configJson = Mage::helper('core')->jsonEncode($config->getData());
return '<div id="' . $htmlIdPrefix . 'box_' . $chooserId . '">
<label style="background-color: #EEE2BE; float: left; font-size: 15px; height: 21px; width: 46%; margin-right:3px; overflow:hidden;" class="widget-option-label" id="' . $htmlIdPrefix . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('widget')->__('Not Selected')) . '</label>
<div id="' . $htmlIdPrefix . $chooserId . 'advice-container" class="hidden"></div>
' . $hiddenHtml . $chooseButton->toHtml() . $js . '</div>';
}
开发者ID:Aerotexextintores,项目名称:novosite,代码行数:58,代码来源:Chooser.php
示例9: _toHtml
/**
* Return chooser HTML and init scripts
*
* @return string
*/
protected function _toHtml()
{
if (is_null(Mage::registry('megamenu_adminhtml_widget_chooser'))) {
return parent::_toHtml();
}
Mage::unregister('megamenu_adminhtml_widget_chooser');
$element = $this->getElement();
$htmlIdPrefix = $element->getForm()->getHtmlIdPrefix();
$chooserId = $this->getUniqId();
$admin = Mage::getConfig()->getNode('admin/routers/adminhtml/args/frontName');
$SourceUrl = str_replace("/megamenu/", "/{$admin}/", $this->getSourceUrl());
$SourceUrl = str_replace("/uniq_id/", "/uniq_id/" . $htmlIdPrefix, $SourceUrl);
$this->setSourceUrl($SourceUrl);
$config = $this->getConfig();
$hiddenHtml = '';
if ($this->getHiddenEnabled()) {
$hidden = new Varien_Data_Form_Element_Hidden($element->getData());
$hidden->setId("{$chooserId}value")->setForm($element->getForm());
if ($element->getRequired()) {
$hidden->addClass('required-entry');
}
$hiddenHtml = $hidden->getElementHtml();
$element->setValue('');
}
$configJson = Mage::helper('core')->jsonEncode($config->getData());
$js = '
<script type="text/javascript">
' . $htmlIdPrefix . $chooserId . ' = new WysiwygWidget.chooser("' . $htmlIdPrefix . $chooserId . '", "' . $this->getSourceUrl() . '", ' . $configJson . ');
</script>
';
$buttons = $config->getButtons();
$chooseButton = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')->setId($htmlIdPrefix . $chooserId . 'control')->setClass('btn-chooser')->setLabel($buttons['open'])->setOnclick($htmlIdPrefix . $chooserId . '.choose();$$(\'.' . $hidden->getName() . '\')[0].id=\'\';$$(\'.data_type\')[0].id=\'' . $htmlIdPrefix . $chooserId . 'value\';');
$configJson = Mage::helper('core')->jsonEncode($config->getData());
return '<div id="' . $htmlIdPrefix . 'box_' . $chooserId . '">
<label style="background-color: #EEE2BE; float: left; font-size: 15px; height: 21px; width: 46%; margin-right:3px; overflow:hidden;" class="widget-option-label" id="' . $htmlIdPrefix . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : Mage::helper('widget')->__('Not Selected')) . '</label>
<div id="' . $htmlIdPrefix . $chooserId . 'advice-container" class="hidden"></div>
' . $hiddenHtml . $chooseButton->toHtml() . $js . '</div>';
}
开发者ID:omusico,项目名称:losvineros,代码行数:43,代码来源:Chooser.php
示例10: _getDummyFieldInput
/**
* @param Varien_Data_Form_Element_Abstract $element
* @return Varien_Data_Form_Element_Hidden
*/
protected function _getDummyFieldInput(Varien_Data_Form_Element_Abstract $element)
{
$dummyInput = new Varien_Data_Form_Element_Hidden();
$dummyInput->setForm($element->getForm())->setId($this->_getDummyInputId($element))->setName($this->_getDummyInputName($element))->setReadonly(true);
return $dummyInput;
}
开发者ID:Rizsti,项目名称:Extendix_AdminFormChooserButton,代码行数:10,代码来源:ImageChooser.php
示例11: getElementHtml
/**
* Return element html code
*
* @return string
*/
public function getElementHtml()
{
$imageUrl = $this->_helperData->escapeHtml($this->_getImageUrl($this->getValue()));
$htmlId = $this->_helperData->escapeHtml($this->getHtmlId());
$uploadUrl = $this->_helperData->escapeHtml($this->_getUploadUrl());
$html = '<input id="' . $htmlId . '_upload" type="file" name="image" ' . 'data-url="' . $uploadUrl . '" style="display: none;" />' . parent::getElementHtml() . '<img align="left" src="' . $imageUrl . '" id="' . $htmlId . '_image"' . ' title="' . $imageUrl . '" alt="' . $imageUrl . '" class="base-image-uploader"' . ' onclick="jQuery(\'#' . $htmlId . '_upload\').trigger(\'click\')"/>';
$html .= $this->_getJs();
return $html;
}
开发者ID:nickimproove,项目名称:magento2,代码行数:14,代码来源:BaseImage.php
注:本文中的Varien_Data_Form_Element_Hidden类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论