本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::setValue方法的具体用法?PHP Varien_Data_Form_Element_Abstract::setValue怎么用?PHP Varien_Data_Form_Element_Abstract::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Data_Form_Element_Abstract
的用法示例。
在下文中一共展示了Varien_Data_Form_Element_Abstract::setValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$element->setStyle('width:70px;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$values = explode(',', $element->getValue());
} else {
$values = array();
}
$from = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$to = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
return Mage::helper('adminhtml')->__('from') . ' ' . $from . ' ' . Mage::helper('adminhtml')->__('to') . ' ' . $to;
}
示例2: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$element->setStyle('width:70px;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$values = explode(',', $element->getValue());
} else {
$values = array();
}
$width = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$height = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
return Mage::helper('sales')->__('Width') . ' ' . $width . ' ' . Mage::helper('sales')->__('Height') . ' ' . $height;
}
示例3: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$element->setStyle('width:40px;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$values = explode(',', $element->getValue());
} else {
$values = array();
}
$top = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$right = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
$bottom = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml();
$left = $element->setValue(isset($values[3]) ? $values[3] : null)->getElementHtml();
return $top . ' ' . Mage::helper('adminhtml')->__('Top, pt') . ' ' . $right . ' ' . Mage::helper('adminhtml')->__('Right, pt') . '<br />' . $bottom . ' ' . Mage::helper('adminhtml')->__('Bottom, pt') . ' ' . $left . ' ' . Mage::helper('adminhtml')->__('Left, pt');
}
示例4: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$_options = array('d' => Mage::helper('adminhtml')->__('Day'), 'm' => Mage::helper('adminhtml')->__('Month'), 'y' => Mage::helper('adminhtml')->__('Year'));
$element->setValues($_options)->setClass('select-date')->setName($element->getName() . '[]');
if ($element->getValue()) {
$values = explode(',', $element->getValue());
} else {
$values = array();
}
$_parts = array();
$_parts[] = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$_parts[] = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
$_parts[] = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml();
return implode(' <span>/</span> ', $_parts);
}
示例5: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$_options = array('d' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Day'), 'm' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Month'), 'y' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Year'));
$element->setValues($_options)->setStyle('width:70px;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$values = explode(',', $element->getValue());
} else {
$values = array();
}
$_parts = array();
$_parts[] = $element->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
$_parts[] = $element->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
$_parts[] = $element->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml();
return implode(' / ', $_parts);
}
示例6: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$html = '';
$data = Mage::getStoreConfig('auspost/activation/data');
$ele_value = explode(',', str_replace($data, '', Mage::helper('core')->decrypt($element->getValue())));
$ele_name = $element->getName();
$ele_id = $element->getId();
$element->setName($ele_name . '[]');
$data_info = Mage::helper('auspost')->getDataInfo();
if (isset($data_info['dom']) && intval($data_info['c']) > 0 && intval($data_info['suc']) == 1) {
foreach (Mage::app()->getWebsites() as $website) {
$url = $website->getConfig('web/unsecure/base_url');
$url = Mage::helper('auspost')->getFormatUrl(trim(preg_replace('/^.*?\\/\\/(.*)?\\//', '$1', $url)));
foreach ($data_info['dom'] as $web) {
if ($web['dom'] == $url && $web['suc'] == 1) {
$element->setChecked(false);
$id = $website->getId();
$name = $website->getName();
$element->setId($ele_id . '_' . $id);
$element->setValue($id);
if (in_array($id, $ele_value) !== false) {
$element->setChecked(true);
}
if ($id != 0) {
$html .= '<div><label>' . $element->getElementHtml() . ' ' . $name . ' </label></div>';
}
}
}
}
} else {
$html = sprintf('<strong class="required">%s</strong>', $this->__('Please enter a valid key'));
}
return $html;
}
示例7: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
$value = $element->getValue();
$element->setStyle('width:70px;')
->setType('hidden');
$inputHidden = $element->setValue(isset($value) ? $value : 'pattern10')->getElementHtml();
$skinDir = str_replace('adminhtml'.DS,'',Mage::getSingleton('core/design_package')->getSkinBaseDir(array('_package' => 'frontend\default')));
$index = strrpos($skinDir, DS);
$theme = substr($skinDir,$index + 1);
$baseURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'frontend/default/' . $theme . '/images/patterns/';
$html = '<div class="bgpattern">';
$html .= $inputHidden;
$helper = Mage::helper('ves_tempcp/data');
$data = $helper->getThemeInfo(1);
// echo "<br/>";
// var_dump($data); die;
$patterns = $data['patterns'];
foreach ($patterns as $p) {
$html .='<div style="background:url(\'' . $baseURL . $p . '\');" onclick="return false;" href="#" title="' . $p . '" id="' . preg_replace("#\.\w+$#", "", $p) . '"></div>';
}
$html .= '</div>';
return $html;
}
示例8: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$account = Mage::getModel('csapiclient/account');
$json = $account->getApiKeyAsJson();
$element->setValue($json);
return parent::_getElementHtml($element);
}
示例9: render
/**
* @param Varien_Data_Form_Element_Abstract $element
*
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$realpath = str_replace('-', '/', str_replace('bronto_email_templates_', '', $element->getId()));
$realValue = Mage::helper('bronto_email')->getAdminScopedConfig($realpath);
$element->setValue($realValue);
$element->setPath($realpath);
return parent::render($element);
}
示例10: prepareElementHtml
public function prepareElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$tree = Mage::getResourceModel('cms/page_tree')->load();
$element->setData('after_element_html', $tree->toSelectHtml($element->getName(), $element->getValue(), $element->getId()));
$element->setValue();
// Not needed because page is already selected in select box
return $element;
}
示例11: _getElementHtml
/**
* Render field html
*
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
/** @var $config Rakuten_Checkout_Model_Config */
$config = Mage::getSingleton('rakuten/config');
$callbackUrl = $config->getCallbackUrl();
$element->setValue($callbackUrl);
return $element->getValue();
}
示例12: _getElementHtml
/**
*
* (non-PHPdoc)
* @see Mage_Adminhtml_Block_System_Config_Form_Field::_getElementHtml()
*/
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$adminUser = Mage::getSingleton('admin/session')->getUser();
$preference = Mage::getModel('extensions_store_storealerts/preference');
$preference->load($adminUser->getId());
$alerts = $preference->getId() ? $preference->getAlerts() : '';
$element->setValue($alerts);
return parent::_getElementHtml($element);
}
示例13: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$element->setStyle('width:80px;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$value = $element->getValue();
} else {
$value = 0;
}
$from = $element->setValue(isset($value) ? $value : null)->getElementHtml();
return $from . ' ' . Mage::helper('adminhtml')->__('X pt');
}
示例14: _getElementHtml
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
$element->setStyle('height:6em;')->setName($element->getName() . '[]');
if ($element->getValue()) {
$value = $element->getValue();
} else {
$value = '';
}
$from = $element->setValue(isset($value) ? $value : null)->getElementHtml();
return $from;
//.' '.Mage::helper('adminhtml')->__('items');
}
示例15: 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;
}