public function __construct($name = null, $attributes = null, array $data = array()) { parent::__construct($name, $attributes, $data); if (POST::WasUsed()) { $this->value = $this->GetDate($name); } }
public function __construct($name, $attributes, Am_Form_Bricked $form) { parent::__construct($name, $attributes, null); $this->brickedForm = $form; class_exists('Am_Form_Brick', true); foreach ($this->brickedForm->getAvailableBricks() as $brick) { $this->bricks[$brick->getClass()][$brick->getId()] = $brick; } }
public function __construct($name = null, $attributes = null, array $data = array()) { $this->elText = new HTML_QuickForm2_Element_InputText("__limit_" . $name, array('class' => 'download-limit-limit', 'size' => 4)); $this->elText->setValue(5); //Default $this->elSelect = new HTML_QuickForm2_Element_Select("__period_" . $name, array('class' => 'download-limit-period')); $this->elSelect->loadOptions(array(FileDownloadTable::PERIOD_HOUR => ___('Hour'), FileDownloadTable::PERIOD_DAY => ___('Day'), FileDownloadTable::PERIOD_WEEK => ___('Week'), FileDownloadTable::PERIOD_MONTH => ___('Month'), FileDownloadTable::PERIOD_YEAR => ___('Year'), FileDownloadTable::PERIOD_ALL => ___('All Subscription Period')))->setValue(FileDownloadTable::PERIOD_MONTH); //Default $this->elCheckbox = new Am_Form_Element_AdvCheckbox("__enable_" . $name, array('class' => 'download-limit-enable')); parent::__construct($name, $attributes, $data); }
/** * Class constructor * * Select element can understand the following keys in $data parameter: * - 'options': data to populate element's options with. Passed to * {@link loadOptions()} method. * - 'intrinsic_validation': setting this to false will disable * that validation, {@link getValue()} will then return all submit * values, not just those corresponding to options present in the * element. May be useful in AJAX scenarios. * * @param string Element name * @param mixed Attributes (either a string or an array) * @param array Additional element data * @throws HTML_QuickForm2_InvalidArgumentException if junk is given in $options */ public function __construct($name = null, $attributes = null, array $data = array()) { $options = isset($data['options']) ? $data['options'] : array(); unset($data['options']); parent::__construct($name, $attributes, $data); $this->loadOptions($options); }
public function __construct($name = null, $options, $type) { parent::__construct($name, null, null); $this->options = $options; $this->type = $type; }
/** * Class constructor * * Static element can understand the following keys in $data parameter: * - 'content': content of the static element, e.g. text or markup * - 'tagName': name of the tag to wrap around content, e.g. 'div'. * Using tag names corresponding to form elements will cause an Exception * - 'forceClosingTag': whether to output closing tag in case of empty * content, <foo></foo> vs. <foo /> * * @param string Element name * @param mixed Attributes (either a string or an array) * @param array Additional element data */ public function __construct($name = null, $attributes = null, array $data = array()) { if (!empty($data['tagName'])) { $this->setTagName($data['tagName'], !array_key_exists('forceClosingTag', $data) || $data['forceClosingTag']); } unset($data['tagName'], $data['forceClosingTag']); parent::__construct($name, $attributes, $data); }