本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::getExtType方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::getExtType方法的具体用法?PHP Varien_Data_Form_Element_Abstract::getExtType怎么用?PHP Varien_Data_Form_Element_Abstract::getExtType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::getExtType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getAdditionalElementHtml
/**
* Custom additional elemnt html
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
protected function _getAdditionalElementHtml($element)
{
// Add name attribute to checkboxes that correspond to multiselect elements
$nameAttributeHtml = $element->getExtType() === 'multiple' ? 'name="' . $element->getId() . '_checkbox"' : '';
return '<span class="attribute-change-checkbox"><input type="checkbox" id="' . $element->getId() . '-checkbox" ' . $nameAttributeHtml . ' onclick="toogleFieldEditMode(this, \'' . $element->getId() . '\')" /><label for="' . $element->getId() . '-checkbox">' . Mage::helper('catalog')->__('Change') . '</label></span>
<script type="text/javascript">initDisableFields(\'' . $element->getId() . '\')</script>';
}
示例2: render
/**
* Enter description here...
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$html = '<tr><td class="label">' . $element->getLabel() . '</td>';
$id = $element->getHtmlId();
//$isDefault = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
$isMultiple = $element->getExtType() === 'multiple';
// replace [value] with [inherit]
$namePrefix = preg_replace('#\\[value\\](\\[\\])?$#', '', $element->getName());
$options = $element->getValues();
$addInheritCheckbox = false;
if ($element->getCanUseWebsiteValue()) {
$addInheritCheckbox = true;
$checkboxLabel = Mage::helper('adminhtml')->__('Use website');
} elseif ($element->getCanUseDefaultValue()) {
$addInheritCheckbox = true;
$checkboxLabel = Mage::helper('adminhtml')->__('Use default');
}
if ($addInheritCheckbox) {
$inherit = $element->getInherit() == 1 ? 'checked' : '';
if ($inherit) {
$element->setDisabled(true);
}
}
$html .= '<td class="value">';
$html .= $this->_getElementHtml($element);
if ($element->getComment()) {
$html .= '<div><small>' . $element->getComment() . '</small></div>';
}
$html .= '</td>';
if ($addInheritCheckbox) {
$defText = $element->getDefaultValue();
if ($options) {
$defTextArr = array();
foreach ($options as $k => $v) {
if ($isMultiple) {
if (is_array($v['value']) && in_array($k, $v['value'])) {
$defTextArr[] = $v['label'];
}
} elseif ($v['value'] == $defText) {
$defTextArr[] = $v['label'];
break;
}
}
$defText = join(', ', $defTextArr);
}
// default value
$html .= '<td class="default">';
//$html.= '<input id="'.$id.'_inherit" name="'.$namePrefix.'[inherit]" type="checkbox" value="1" class="input-checkbox config-inherit" '.$inherit.' onclick="$(\''.$id.'\').disabled = this.checked">';
$html .= '<input id="' . $id . '_inherit" name="' . $namePrefix . '[inherit]" type="checkbox" value="1" class="input-checkbox config-inherit" ' . $inherit . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))"/>';
$html .= '<label for="' . $id . '_inherit" class="inherit" title="' . htmlspecialchars($defText) . '">' . $checkboxLabel . '</label>';
$html .= '<input type="hidden" name="' . $namePrefix . '[default_value]" value="' . htmlspecialchars($element->getDefaultValue()) . '">';
$html .= '<input type="hidden" name="' . $namePrefix . '[old_value]" value="' . htmlspecialchars($element->getOldValue()) . '">';
$html .= '</td>';
}
$html .= '</tr>';
return $html;
}
示例3: render
/**
* Overloaded for forwards compatibility for Magento 1.6.
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$id = $element->getHtmlId();
$html = '<td class="label"><label for="' . $id . '">' . $element->getLabel() . '</label></td>';
//$isDefault = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
$isMultiple = $element->getExtType() === 'multiple';
// replace [value] with [inherit]
$namePrefix = preg_replace('#\\[value\\](\\[\\])?$#', '', $element->getName());
$options = $element->getValues();
$addInheritCheckbox = false;
if ($element->getCanUseWebsiteValue()) {
$addInheritCheckbox = true;
$checkboxLabel = $this->__('Use Website');
} elseif ($element->getCanUseDefaultValue()) {
$addInheritCheckbox = true;
$checkboxLabel = $this->__('Use Default');
}
if ($addInheritCheckbox) {
$inherit = $element->getInherit() == 1 ? 'checked="checked"' : '';
if ($inherit) {
$element->setDisabled(true);
}
}
if ($element->getTooltip()) {
$html .= '<td class="value with-tooltip">';
$html .= $this->_getElementHtml($element);
$html .= '<div class="field-tooltip"><div>' . $element->getTooltip() . '</div></div>';
} else {
$html .= '<td class="value">';
$html .= $this->_getElementHtml($element);
}
if ($element->getComment()) {
$html .= '<p class="note"><span>' . $element->getComment() . '</span></p>';
}
$html .= '</td>';
if ($addInheritCheckbox) {
$defText = $element->getDefaultValue();
if ($options) {
$defTextArr = array();
foreach ($options as $k => $v) {
if ($isMultiple) {
if (is_array($v['value']) && in_array($k, $v['value'])) {
$defTextArr[] = $v['label'];
}
} elseif (isset($v['value'])) {
if ($v['value'] == $defText) {
$defTextArr[] = $v['label'];
break;
}
} elseif (!is_array($v)) {
if ($k == $defText) {
$defTextArr[] = $v;
break;
}
}
}
$defText = join(', ', $defTextArr);
}
// default value
$html .= '<td class="use-default">';
$html .= '<input id="' . $id . '_inherit" name="' . $namePrefix . '[inherit]" type="checkbox" value="1" class="checkbox config-inherit" ' . $inherit . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> ';
$html .= '<label for="' . $id . '_inherit" class="inherit" title="' . htmlspecialchars($defText) . '">' . $checkboxLabel . '</label>';
$html .= '</td>';
}
$html .= '<td class="scope-label">';
if ($element->getScope()) {
$html .= $element->getScopeLabel();
}
$html .= '</td>';
$html .= '<td class="">';
if ($element->getHint()) {
$html .= '<div class="hint" >';
$html .= '<div style="display: none;">' . $element->getHint() . '</div>';
$html .= '</div>';
}
$html .= '</td>';
return $this->_decorateRowHtml($element, $html);
}
示例4: render
/**
* Enter description here...
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
if (version_compare(Mage::getVersion(), '1.7.0.1', '<')) {
if (Mage::app()->getRequest()->getParam('section') == "klevu_search") {
$id = $element->getHtmlId();
$features = Mage::helper('klevu_search/config')->getFeaturesUpdate($element->getHtmlId());
if (!empty($features)) {
$style = 'class="klevu-disabled"';
$upgrade_text = '';
if (!empty($features['upgrade_message']) || !empty($features['upgrade_label'])) {
$upgrade_text .= "<div class='klevu-upgrade-block'>";
if (!empty($features['upgrade_message'])) {
$upgrade_text .= $features['upgrade_message'];
}
if (!empty($features['upgrade_label'])) {
$upgrade_text .= "<br/><button type='button' onClick=upgradeLink('" . $features["upgrade_url"] . "')>" . $features['upgrade_label'] . "</button>";
}
$upgrade_text .= "</div>";
}
} else {
$style = '';
$upgrade_text = '';
}
$useContainerId = $element->getData('use_container_id');
$html = '<tr id="row_' . $id . '">' . '<td class="label"><label for="' . $id . '" ' . $style . '>' . $element->getLabel() . '</label>' . $upgrade_text . '</td>';
// $isDefault = !$this->getRequest()->getParam('website') && !$this->getRequest()->getParam('store');
$isMultiple = $element->getExtType() === 'multiple';
// replace [value] with [inherit]
$namePrefix = preg_replace('#\\[value\\](\\[\\])?$#', '', $element->getName());
$options = $element->getValues();
$addInheritCheckbox = false;
if ($element->getCanUseWebsiteValue()) {
$addInheritCheckbox = true;
$checkboxLabel = Mage::helper('adminhtml')->__('Use Website');
} elseif ($element->getCanUseDefaultValue()) {
$addInheritCheckbox = true;
$checkboxLabel = Mage::helper('adminhtml')->__('Use Default');
}
if ($addInheritCheckbox) {
$inherit = $element->getInherit() == 1 ? 'checked="checked"' : '';
if ($inherit) {
$element->setDisabled(true);
}
}
// Code added by klevu
if (!empty($features)) {
$element->setDisabled(true);
$element->setValue(0);
}
$html .= '<td class="value">';
$html .= $this->_getElementHtml($element);
if ($element->getComment()) {
$html .= '<p class="note"><span>' . $element->getComment() . '</span></p>';
}
$html .= '</td>';
if ($addInheritCheckbox) {
$defText = $element->getDefaultValue();
if ($options) {
$defTextArr = array();
foreach ($options as $k => $v) {
if ($isMultiple) {
if (is_array($v['value']) && in_array($k, $v['value'])) {
$defTextArr[] = $v['label'];
}
} elseif ($v['value'] == $defText) {
$defTextArr[] = $v['label'];
break;
}
}
$defText = join(', ', $defTextArr);
}
// code added by klevu
if (!empty($features)) {
} else {
// default value
$html .= '<td class="use-default">';
// $html.= '<input id="'.$id.'_inherit" name="'.$namePrefix.'[inherit]" type="checkbox" value="1" class="input-checkbox config-inherit" '.$inherit.' onclick="$(\''.$id.'\').disabled = this.checked">';
$html .= '<input id="' . $id . '_inherit" name="' . $namePrefix . '[inherit]" type="checkbox" value="1" class="checkbox config-inherit" ' . $inherit . ' onclick="toggleValueElements(this, Element.previous(this.parentNode))" /> ';
$html .= '<label for="' . $id . '_inherit" class="inherit" title="' . htmlspecialchars($defText) . '">' . $checkboxLabel . '</label>';
$html .= '</td>';
}
}
$html .= '<td class="scope-label">';
if ($element->getScope()) {
$html .= $element->getScopeLabel();
}
$html .= '</td>';
// code added by klevu
if (!empty($features)) {
$element->setDisabled(true);
}
$html .= '<td class="">';
if ($element->getHint()) {
$html .= '<div class="hint" >';
//.........这里部分代码省略.........