/** * Constructor * * @param string $elementName (optional) name of the hidden element * @param string $value (optional) value of the element * @param mixed $attributes (optional) Either a typical HTML attribute string * or an associative array */ public function __construct($elementName = null, $value = '', $attributes = null) { parent::__construct($elementName, $value, $attributes); }
/** * Constructor * * @param string $elementName (optional) name of the hidden element * @param string $value (optional) value of the element * @param mixed $attributes (optional) Either a typical HTML attribute string * or an associative array */ function MoodleQuickForm_hidden($elementName = null, $value = '', $attributes = null) { parent::HTML_QuickForm_hidden($elementName, $value, $attributes); }
/** * Freeze the tinymce content by replacing textarea form element */ function freeze() { $original_element = $this->_form->getElement($this->name); foreach ($this->_form->_elements as $key => $element) { if (isset($element->_attributes['name']) && $element->_attributes['name'] == $this->name) { if (isset($this->_form->_elements[$key + 1]->_attributes['name'])) { $name_after = $this->_form->_elements[$key + 1]->_attributes['name']; } } } $this->_form->removeElement($this->name); $new_element = new HTML_QuickForm_hidden($original_element->getName(), $original_element->getLabel()); $new_element->setValue($original_element->getValue()); $value_container = HTML_QuickForm::createElement('static', $original_element->getName() . '_previews', $original_element->getLabel(), $original_element->getValue()); if (isset($name_after)) { $this->_form->insertElementBefore($new_element, $name_after); $this->_form->insertElementBefore($value_container, $name_after); } else { $this->_form->addElement($new_element); $this->_form->addElement($value_container); } }