本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::getValues方法的具体用法?PHP Varien_Data_Form_Element_Abstract::getValues怎么用?PHP Varien_Data_Form_Element_Abstract::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::getValues方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Render element
*
* @param Varien_Data_Form_Element_Abstract $element
* @see Varien_Data_Form_Element_Renderer_Interface::render()
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$element->addClass('element-value-changer');
$valueName = $element->getValueName();
if ($element instanceof Varien_Data_Form_Element_Select && $valueName == '...') {
$optionValues = $element->getValues();
foreach ($optionValues as $option) {
if ($option['value'] === '') {
$valueName = $option['label'];
}
}
}
if ($valueName === '') {
$valueName = '...';
}
if ($element->getShowAsText()) {
$html = ' <input type="hidden" class="hidden" id="' . $element->getHtmlId() . '" name="' . $element->getName() . '" value="' . $element->getValue() . '"/> ' . htmlspecialchars($valueName) . ' ';
} else {
$html = ' <span class="rule-param"' . ($element->getParamId() ? ' id="' . $element->getParamId() . '"' : '') . '>' . '<a href="javascript:void(0)" class="label">';
$translate = Mage::getSingleton('core/translate_inline');
$html .= $translate->isAllowed() ? Mage::helper('core')->escapeHtml($valueName) : Mage::helper('core')->escapeHtml(Mage::helper('core/string')->truncate($valueName, 33, '...'));
$html .= '</a><span class="element"> ' . $element->getElementHtml();
if ($element->getExplicitApply()) {
$html .= ' <a href="javascript:void(0)" class="rule-param-apply"><img src="' . $this->getSkinUrl('M2ePro/images/rule_component_apply.gif') . '" class="v-middle" alt="' . Mage::helper('M2ePro')->__('Apply') . '" title="' . Mage::helper('M2ePro')->__('Apply') . '" /></a> ';
}
$html .= '</span></span> ';
}
return $html;
}
示例2: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$real_val = $element->getValue();
$many_val = $element->getValues();
$output = '';
if ($many_val) {
foreach ($many_val as $curr_val) {
$output .= '<div style="padding: 0 15px 15px 0; float: left; width: 130px;">';
$output .= '<input type="radio"' . $element->serialize(array('style', 'class', 'name'));
if ($curr_val instanceof Varien_Object) {
$output .= 'id="' . $element->getHtmlId() . $curr_val->getValue() . '" ' . $curr_val->serialize(array('title', 'label', 'style', 'class', 'value'));
if (in_array($curr_val->getValue(), $real_val)) {
$output .= ' checked="checked"';
}
$output .= ' /><span>' . $curr_val->getLabel() . '</span>';
} elseif (is_array($curr_val)) {
$output .= 'id="' . $element->getHtmlId() . $curr_val['value'] . '" value="' . htmlspecialchars($curr_val['value'], ENT_COMPAT) . '"';
if ($curr_val['value'] == $real_val) {
$output .= ' checked="checked"';
}
$output .= ' /><span>' . $curr_val['label'] . '</span>';
}
if ($curr_val['value']) {
$output .= '<div style="height:30px;background:url(' . Mage::getDesign()->getSkinUrl('magentothem/images/' . $curr_val['value'] . '.png') . ')"> </div>';
}
$output .= '</div>' . "\n";
}
}
return $output . '<div class="clear"></div>';
}
示例3: _getElementHtml
public function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$text = $element->getValues();
$html = '<div id="' . $element->getHtmlId() . '">';
$html .= '<h1>' . $text[0]['label'] . '</h1>';
$html .= '<div>' . $text[0]['value'] . '</div>';
$html .= '</div>';
return $html;
}
示例4: _getElementHtml
/**
* Override method to output our custom image
*
* @param Varien_Data_Form_Element_Abstract $element
* @return String
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
// Get the default HTML for this option
//$html = parent::_getElementHtml($element);
$html = '<div id="universal-widget-content" class="theme-widget-content">
<div class="title">
<h2>Click on element to remove it from the widget</h2>
</div>
<div class="title-2"><h2>Click on element to add it to widget</h2></div><div class="widget-holder">
<div class="widget-content">';
$value = $element->getValue();
if ($values = $element->getValues()) {
foreach ($values as $option) {
$html .= $this->_optionToHtml($element, $option, $value);
}
}
$html .= $element->getAfterElementHtml();
$html .= '</div><div class="items-container">
<div class="label_new-holder"><div class="label_new-sub"></div></div>
<div class="label_sale-holder"><div class="label_sale-sub"></div></div>
<div class="universal_product_category-holder"><div class="universal_product_category-sub"></div></div>
<div class="product_name-holder"><div class="product_name-sub"></div></div>
<div class="stock_status-holder"><div class="stock_status-sub"></div></div>
<div class="universal_quickview-holder"><div class="universal_quickview-sub"></div></div>
<div class="desc-holder"><div class="desc-sub"></div></div>
<div class="rating_stars-holder"><div class="rating_stars-sub"></div></div>
<div class="reviews">
<div class="rating_cust_link-holder"><div class="rating_cust_link-sub"></div></div>
<div class="rating_add_review_link-holder"><div class="rating_add_review_link-sub"></div></div>
</div>
<div class="add_to_cart-holder"><div class="add_to_cart-sub"></div></div>
<div class="price"><div class="price-holder"><div class="price-sub"></div></div></div>
<div class="timer"><div class="timer-holder"><div class="timer-sub"></div></div></div>
<div class="wishlist-holder"><div class="wishlist-sub"></div></div>
<div class="compare-holder"><div class="compare-sub"></div></div>
</div></div></div>';
$html .= '<script type="text/javascript">
var href = "' . Mage::getDesign()->getSkinUrl("thememanager/adminhtml/universal_widget_styles.css", array('_default' => true)) . '"
var fileref=document.createElement("link");
fileref.setAttribute("type","text/css");
fileref.setAttribute("rel","stylesheet");
fileref.setAttribute("href",href);
document.getElementsByTagName("head")[0].appendChild(fileref);
var script =document.createElement("script");
script.setAttribute("src", "' . Mage::getBaseUrl('js') . '/meigee/smart_widget.js");
script.setAttribute("type", "text/javascript");
script.id = "SmartWidgetSingleton";
script.onload = function()
{
SmartWidget.init();
SmartWidgetSingleton = true;
}
document.getElementsByTagName("head")[0].appendChild(script);
</script>';
return $html;
}
示例5: 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;
}
示例6: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$values = $element->getValues();
$html = '<ul class="checkboxes">';
foreach ($values as $dat) {
$html .= "<li>{$dat['label']}</li>";
}
$html .= '</ul>';
return $html;
}
示例7: _getElementHtml
/**
* @param Varien_Data_Form_Element_Abstract $element
* @return String
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '';
$value = $element->getValue();
if ($values = $element->getValues()) {
foreach ($values as $option) {
$html .= $this->_optionToHtml($element, $option, $value);
}
}
$html .= $element->getAfterElementHtml();
return $html;
}
示例8: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$real_val = $element->getValue();
$many_val = $element->getValues();
$output = '';
if ($many_val) {
foreach ($many_val as $curr_val) {
$output .= '<div style="padding: 0 15px 15px 0; float: left; width: 130px;">';
$output .= '<input type="radio"' . $element->serialize(array('style', 'class', 'name'));
if ($curr_val instanceof Varien_Object) {
$output .= 'id="' . $element->getHtmlId() . $curr_val->getValue() . '" ' . $curr_val->serialize(array('title', 'label', 'style', 'class', 'value'));
if (in_array($curr_val->getValue(), $real_val)) {
$output .= ' checked="checked"';
}
$output .= ' /><span>' . $curr_val->getLabel() . '</span>';
} elseif (is_array($curr_val)) {
$output .= 'id="' . $element->getHtmlId() . $curr_val['value'] . '" value="' . htmlspecialchars($curr_val['value'], ENT_COMPAT) . '"';
if ($curr_val['value'] == $real_val) {
$output .= ' checked="checked"';
}
$output .= ' /><span>' . $curr_val['label'] . '</span>';
}
if ($curr_val['value']) {
$output .= '<div style="height:30px;background:url(' . Mage::getDesign()->getSkinUrl('magentothem/images/' . $curr_val['value'] . '.png') . ')"> </div>';
}
$output .= '</div>' . "\n";
}
$output .= '
<script type="text/javascript">
jQuery(document).ready(function(){
if(jQuery("#themeoptions_themeoptions_config_reset_css").val() == 1)
jQuery("#row_themeoptions_themeoptions_config_bg_pattern").hide();
else
jQuery("#row_themeoptions_themeoptions_config_bg_pattern").show();
jQuery("#themeoptions_themeoptions_config_reset_css").change(function(){
if(jQuery("#themeoptions_themeoptions_config_reset_css").val() == 1)
jQuery("#row_themeoptions_themeoptions_config_bg_pattern").hide();
else
jQuery("#row_themeoptions_themeoptions_config_bg_pattern").show();
});
})
</script>';
}
return $output . '<div class="clear"></div>';
}
示例9: render
public function render(Varien_Data_Form_Element_Abstract $element)
{
//this is (more than) a bit nasty - but means we can use the Varien Template easily
$fakeElement = new Varien_Object();
$variablesToCopy = array('note', 'html_container_id', 'fieldset_html_class', 'no_display', 'type', 'value_class', 'id', 'label_html');
array_walk($variablesToCopy, function ($dataName) use($fakeElement, $element) {
$fakeElement->setData($dataName, $element->getDataUsingMethod($dataName));
});
$id = $element->getId();
$name = $element->getName();
$value = $element->getValue() ?: "";
if ($value) {
$label = htmlspecialchars(array_reduce($element->getValues(), function ($acc, $val) use($value) {
return $acc ?: ($val['value'] == $value ? $val['label'] : $acc);
}, ""));
} else {
$label = "";
}
$value = htmlspecialchars($value);
$visibleInputName = preg_replace('/^(.*)\\]$/', '$1_visible_input]', $name);
$fakeElement->setElementHtml("\n <input id='{$id}_visible_input' name='{$visibleInputName}' type='text' value='{$label}'\n data-original-value='{$label}' class='" . self::$_SELECTCLASSNAME . "'></input>\n <input id='{$id}' name='{$name}' type='hidden' value='{$value}' data-original-value='{$value}'></input>\n ");
$this->_element = $fakeElement;
return $this->toHtml();
}
示例10: 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);
}
示例11: 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" >';
//.........这里部分代码省略.........