本文整理汇总了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);
}
示例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;
}
示例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>';
}
示例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;
}
示例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');
}
示例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;
}
示例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');
}
示例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;
}
示例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') . ' ' . $right . ' ' . Mage::helper('adminhtml')->__('Right, pt') . '<br />' . $bottom . ' ' . Mage::helper('adminhtml')->__('Bottom, pt') . ' ' . $left . ' ' . Mage::helper('adminhtml')->__('Left, pt');
}
示例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');
}
示例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>';
}