/** * Get the html node for this element * @param AppBuilderAPIDOMDocument $xml * @param array $data * @return DOMElement */ public function getHTMLNode($xml, &$data) { $node = parent::getHTMLNode($xml, $data); $title = $this->getAttribute('title'); if (!empty($title)) { $node->appendChild($xml->createElement('div', array('class' => 'title', 'text' => $this->getAttribute('title')))); } $default = $this->getAttribute('defaultvalue'); foreach ($this->options as $option) { if ($option['value'] == $default) { $option['selected'] = true; } } $node->appendChild($inner = $xml->createElement('div', 'selected-container' . (empty($title) ? ' no-title' : ''))); /*$inner->appendChild($xml->createElement('span', array( 'class'=>'selected', 'data-select' => 'yes', 'data-variable' => $this->getAttribute('variable'), 'text' => json_encode($this->options) ))); */ $inner->appendChild($select = $xml->createElement('select', array('name' => $this->getAttribute('variable'), 'data-variable' => $this->getAttribute('variable'), 'data-save-value' => $this->save))); $default = $this->getAttribute('defaultvalue'); foreach ($this->options as $option) { $o = $xml->createElement('option', array('value' => $option['value'], 'text' => $option['title'])); $select->appendChild($o); if ($option['value'] == $default) { $o->setAttribute('selected', 'selected'); } } return $node; }
/** * Get the html node for this element * @param AppBuilderAPIDOMDocument $xml * @param array $data * @return DOMElement */ public function getHTMLNode($xml, &$data) { $node = parent::getHTMLNode($xml, $data); $title = $this->getAttribute('title'); if (!empty($title)) { $node->appendChild($xml->createElement('div', array('class' => 'title', 'text' => $this->getAttribute('title')))); } $node->appendChild($inner = $xml->createElement('div', 'textbox-container' . (empty($title) ? ' no-title' : ''))); $inner->appendChild($xml->createElement('span', array('class' => 'picked', 'data-value' => $this->getAttribute('defaultvalue'), 'data-placeholder' => $this->placeholder, 'data-variable' => $this->getAttribute('variable'), 'data-picker-type' => $this->pickerType, 'data-save-value' => $this->save))); return $node; }
/** * Get the html node for this element * @param AppBuilderAPIDOMDocument $xml * @param array $data * @return DOMElement */ public function getHTMLNode($xml, &$data) { $node = parent::getHTMLNode($xml, $data); $title = $this->getAttribute('title'); if (!empty($title)) { $node->appendChild($xml->createElement('div', array('class' => 'title', 'text' => $this->getAttribute('title')))); } $node->appendChild($inner = $xml->createElement('div', 'textbox-container' . (empty($title) ? ' no-title' : ''))); $inner->appendChild($xml->createElement('input', array('type' => 'checkbox', 'name' => $this->getAttribute('variable'), 'data-variable' => $this->getAttribute('variable'), 'data-save-value' => $this->save, 'checked' => $this->getAttribute('defaultvalue'), 'value' => $this->value))); return $node; }
/** * Get the html node for this element * @param AppBuilderAPIDOMDocument $xml * @param array $data * @return DOMElement */ public function getHTMLNode($xml, &$data) { $node = parent::getHTMLNode($xml, $data); $title = $this->getAttribute('title'); if (!empty($title)) { $node->appendChild($xml->createElement('div', array('class' => 'title', 'text' => $this->getAttribute('title')))); } $node->appendChild($inner = $xml->createElement('div', 'textbox-container' . (empty($title) ? ' no-title' : ''))); $inner->appendChild($xml->createElement('input', array('class' => 'textbox' . ($this->localsearch ? ' localsearch' : ''), 'type' => static::INPUT_TYPE, 'name' => $this->getAttribute('variable'), 'value' => $this->getAttribute('defaultvalue'), 'placeholder' => $this->placeholder, 'data-variable' => $this->getAttribute('variable'), 'data-save-value' => $this->save, 'data-autocomplete-url' => $this->autocomplete, 'data-autocomplete-variable' => $this->autocompleteVar ? $this->autocompleteVar : $this->getAttribute('variable')))); return $node; }
/** * Get the html node for this element * @param AppBuilderAPIDOMDocument $xml * @param array $data * @return DOMElement */ public function getHTMLNode($xml, &$data) { $node = parent::getHTMLNode($xml, $data); $type = $this->getAttribute('type'); $node->setAttribute('data-capturetype', $type); $node->setAttribute('data-name', $this->getAttribute('variable')); $node->setAttribute('data-save-value', $this->save); $node->appendChild($on = $xml->createElement('div', 'on')); $on->appendChild($xml->createElement('div', 'image')); $on->appendChild($xml->createElement('div', array('class' => 'title', 'text' => $this->getAttribute('title')))); $on->appendChild($xml->createElement('div', array('class' => 'text', 'text' => $this->getAttribute('subtitle')))); $on->appendChild($xml->createElement('button', array('class' => 'capture', 'text' => 'Capture'))); $on->appendChild($xml->createElement('button', array('class' => 'choose', 'text' => 'Choose'))); $node->appendChild($off = $xml->createElement('div', 'off')); $off->appendChild($xml->createElement('div', array('class' => 'title', 'text' => ucfirst($type) . ' Capture'))); $off->appendChild($xml->createElement('div', array('class' => 'text', 'text' => "You need to install this app via the store to use {$type} capture"))); return $node; }