本文整理汇总了PHP中Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract类的具体用法?PHP Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract怎么用?PHP Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addElement
/**
* Add form element
*
* @param Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element
* @param bool $after
* @return Mage_XmlConnect_Model_Simplexml_Form
*/
public function addElement(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element, $after = false)
{
if ($this->getForm()) {
$this->getForm()->checkElementId($element->getId());
$this->getForm()->addElementToCollection($element);
}
parent::addElement($element, $after);
return $this;
}
示例2: _addValidator
/**
* Add validator for file field to fieldset xml object
*
* @param Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $fieldXmlObj
* @return Mage_XmlConnect_Block_Customer_Form_Renderer_File
*/
protected function _addValidator(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $fieldXmlObj)
{
$validateRules = $this->getAttributeObject()->getValidateRules();
if (!empty($validateRules)) {
$validatorXmlObj = $fieldXmlObj->addValidator();
if (!empty($validateRules['max_file_size'])) {
$minTextLength = (int) $validateRules['max_file_size'];
$validatorXmlObj->addRule(array('type' => 'max_file_size', 'value' => $minTextLength, 'field_label' => $this->getLabel()));
}
if (!empty($validateRules['file_extensions'])) {
$maxTextLength = $validateRules['file_extensions'];
$validatorXmlObj->addRule(array('type' => 'file_extensions', 'value' => $maxTextLength, 'field_label' => $this->getLabel()));
}
}
return $this;
}
示例3: addField
/**
* Add field element to fieldset
*
* @param string $elementId
* @param string $type
* @param array $config
* @param boolean $after
* @return Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract
*/
public function addField($elementId, $type, $config, $after = false)
{
$element = parent::addField($elementId, $type, $config, $after);
if ($renderer = Mage_XmlConnect_Model_Simplexml_Form::getFieldsetElementRenderer()) {
$element->setRenderer($renderer);
}
return $element;
}
示例4: addElement
/**
* Add form element
*
* @param Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element
* @param bool|string $after
* @return Mage_XmlConnect_Model_Simplexml_Form_Abstract
*/
public function addElement(Mage_XmlConnect_Model_Simplexml_Form_Element_Abstract $element, $after = false)
{
$element->setForm($this);
$this->getElements()->add($element, $after);
return $this;
}
示例5: __construct
/**
* Init multiline element
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
if (!isset($attributes['line_count'])) {
Mage::throwException(Mage::helper('xmlconnect')->__('"line_count" attribute is required for "multiline" element.'));
}
parent::__construct($attributes);
$this->setType('multiline');
}
示例6: __construct
/**
* Init validator rule element abstract
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
parent::__construct($attributes);
$this->_renderer = Mage_XmlConnect_Model_Simplexml_Form::getValidatorRuleRenderer();
$this->_setDefaultValidatorTypeMessages();
if (isset($attributes['type'])) {
$this->setType($attributes['type']);
}
}
示例7: __construct
/**
* Init textarea element
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
parent::__construct($attributes);
$this->setType('textarea');
}
示例8: __construct
/**
* Init checkbox element
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
parent::__construct($attributes);
$this->setType('checkbox');
}
示例9: __construct
/**
* Init password element
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
parent::__construct($attributes);
$this->setType('password');
}