本文整理汇总了PHP中Varien_Data_Form_Element_Hidden::setForm方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Hidden::setForm方法的具体用法?PHP Varien_Data_Form_Element_Hidden::setForm怎么用?PHP Varien_Data_Form_Element_Hidden::setForm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Hidden
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Hidden::setForm方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: _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;
}