当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Data_Form_Element_Abstract::setStyle方法代码示例

本文整理汇总了PHP中Varien_Data_Form_Element_Abstract::setStyle方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Data_Form_Element_Abstract::setStyle方法的具体用法?PHP Varien_Data_Form_Element_Abstract::setStyle怎么用?PHP Varien_Data_Form_Element_Abstract::setStyle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Data_Form_Element_Abstract的用法示例。


在下文中一共展示了Varien_Data_Form_Element_Abstract::setStyle方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $_years = array(null => "Year");
     for ($i = 0, $y = (int) date("Y"); $i < 5; $i++, $y++) {
         $_years[$y] = $y;
     }
     $_months = array(null => "Month");
     for ($i = 1; $i <= 12; $i++) {
         $_months[$i] = Mage::app()->getLocale()->date(mktime(null, null, null, $i))->get(Zend_date::MONTH_NAME);
     }
     $_days = array(null => "Day");
     for ($i = 1; $i <= 31; $i++) {
         $_days[$i] = $i < 10 ? '0' . $i : $i;
     }
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = array();
     }
     $element->setName($element->getName() . '[]');
     $_yearsHtml = $element->setStyle('width:75px;')->setValues($_years)->setValue(isset($values[0]) ? $values[0] : null)->getElementHtml();
     $_monthsHtml = $element->setStyle('width:100px;')->setValues($_months)->setValue(isset($values[1]) ? $values[1] : null)->getElementHtml();
     $_daysHtml = $element->setStyle('width:50px;')->setValues($_days)->setValue(isset($values[2]) ? $values[2] : null)->getElementHtml();
     return sprintf('%s %s %s', $_yearsHtml, $_monthsHtml, $_daysHtml);
 }
开发者ID:rob3000,项目名称:magento-notification-bar,代码行数:25,代码来源:Datepicker.php

示例2: _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;
    }
开发者ID:amal-nibaya,项目名称:PB-BEERSHOP,代码行数:31,代码来源:CustomField.php

示例3: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setStyle('display:block')->setName($element->getName() . '[]');
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = array();
     }
     $payments = Mage::getSingleton('payment/config')->getActiveMethods();
     $allowedDefault = array();
     $elementsJs = array();
     foreach ($payments as $paymentCode => $paymentModel) {
         $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title');
         $methodsAllowed[$paymentCode] = array('label' => $paymentTitle, 'value' => $paymentCode . "_allow");
         array_push($allowedDefault, $paymentCode . "_allow");
         $elementsJs[] = $element->getId() . '_' . $paymentCode . "";
     }
     foreach ($payments as $paymentCode => $paymentModel) {
         $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title');
         $methodsDenied[$paymentCode] = array('label' => $paymentTitle, 'value' => $paymentCode . "_deny");
     }
     if (empty($values)) {
         $values = $allowedDefault;
     }
     $from = $element->setValues($methodsAllowed)->setValue($values)->getElementHtml();
     $to = $element->setValues($methodsDenied)->setValue($values)->getElementHtml();
     $script = "";
     foreach ($elementsJs as $elementj) {
         $script .= "\n            document.getElementById('" . $elementj . "_allow').addEventListener('click', function() {\n                if (document.getElementById('" . $elementj . "_deny').checked == true) {\n                    document.getElementById('" . $elementj . "_deny').checked = false;\n                } else {\n                    document.getElementById('" . $elementj . "_deny').checked = true;\n                }\n            }, false);\n            document.getElementById('" . $elementj . "_deny').addEventListener('click', function() {\n                if (document.getElementById('" . $elementj . "_allow').checked == true) {\n                    document.getElementById('" . $elementj . "_allow').checked = false;\n                } else {\n                    document.getElementById('" . $elementj . "_allow').checked = true;\n\n                }\n            }, false);\n            if (document.getElementById('" . $elementj . "_deny').checked == false && document.getElementById('" . $elementj . "_allow').checked == false) {\n                document.getElementById('" . $elementj . "_allow').checked = true;\n            }\n            ";
     }
     return '<div style="white-space: nowrap;"><div style="display:inline-block;padding: 0 5px 0 0; width:50%">' . $from . '</div> <div style="display:inline-block;padding: 0 5px 0 0; width:50%">' . $to . '</div></div><script>' . $script . '</script>';
 }
开发者ID:istgin,项目名称:Byjuno,代码行数:32,代码来源:AllowedRange.php

示例4: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $_days = array();
     for ($i = 1; $i <= 31; $i++) {
         $_days[$i] = $i < 10 ? '0' . $i : $i;
     }
     $_daysHtml = $element->setStyle('width:50px;')->setValues($_days)->getElementHtml();
     return $_daysHtml;
 }
开发者ID:blazeriaz,项目名称:youguess,代码行数:9,代码来源:MtdStart.php

示例5: _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');
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:11,代码来源:Nudgename.php

示例6: _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;
 }
开发者ID:codercv,项目名称:urbansurprisedev,代码行数:12,代码来源:YearRange.php

示例7: _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');
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:12,代码来源:Textarea.php

示例8: _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;
 }
开发者ID:novayadi85,项目名称:navicet,代码行数:12,代码来源:Size.php

示例9: _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') . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $right . '  ' . Mage::helper('adminhtml')->__('Right, pt') . '<br />' . $bottom . '  ' . Mage::helper('adminhtml')->__('Bottom, pt') . '    ' . $left . '  ' . Mage::helper('adminhtml')->__('Left, pt');
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:14,代码来源:Papernudge.php

示例10: _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 = '{if company}{company},|{/if company}
{if name}{name},|{/if name}
{if street}{street},|{/if street}
{if city}{city},|{/if city}
{if region}{region},|{/if region}
{if postcode}{postcode}|{/if postcode}
{if country}{country}|{/if country}
{if telephone}|[ T: {telephone} ]{/if telephone}';
        }
        $from = $element->setValue(isset($value) ? $value : null)->getElementHtml();
        return $from;
        //.'   '.Mage::helper('adminhtml')->__('items');
    }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:19,代码来源:Addresstextarea.php

示例11: _getElementHtml

 protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
 {
     $element->setStyle('display:block')->setName($element->getName() . '[]');
     if ($element->getValue()) {
         $values = explode(',', $element->getValue());
     } else {
         $values = array();
     }
     $payments = Mage::getSingleton('payment/config')->getActiveMethods();
     $methodsExists = array();
     foreach ($payments as $paymentCode => $paymentModel) {
         $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title');
         $methodsExists[] = $paymentTitle;
     }
     foreach ($payments as $paymentCode => $paymentModel) {
         $paymentTitle = Mage::getStoreConfig('payment/' . $paymentCode . '/title');
         $methodsDenied[$paymentCode] = array('label' => $paymentTitle, 'value' => $paymentCode . "_deny");
     }
     return '<div style="white-space: nowrap;"><div style="display:inline-block;padding: 0 5px 0 0; width:50%">' . implode("<br>", $methodsExists) . '</div> <div style="display:inline-block;padding: 0 5px 0 0; width:50%">x</div></div>';
 }
开发者ID:istgin,项目名称:Byjuno,代码行数:20,代码来源:MappingRange.php


注:本文中的Varien_Data_Form_Element_Abstract::setStyle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。