public function getAttributes() { if ($this->getPage()->isMainSite()) { return parent::getAttributes(); } return array_merge(TextField::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=', 'data-default-url' => $this->getDefaultURL())); }
/** * @return array */ public function getAttributes() { $attributes = []; $attributes['type'] = 'number'; $attributes['autocomplete'] = 'off'; $attributes['required'] = 'required'; return array_merge(parent::getAttributes(), $attributes); }
function getAttributes() { return array_merge( parent::getAttributes(), array( 'type' => 'email' ) ); }
/** * Set additional attributes * @return array Attributes */ public function getAttributes() { $attributes = array('placeholder' => $this->config['defaultparts']['scheme'] . "://example.com"); if ($this->config['html5validation']) { $attributes += array('type' => 'url', 'pattern' => 'https?://.+'); } return array_merge(parent::getAttributes(), $attributes); }
public function getAttributes() { $attributes = array_merge(parent::getAttributes(), array('type' => 'password')); $autocomplete = Config::inst()->get('PasswordField', 'autocomplete'); if (isset($autocomplete)) { $attributes['autocomplete'] = $autocomplete ? 'on' : 'off'; } return $attributes; }
/** * @return Array */ public function getAttributes() { $attributes = array_merge(parent::getAttributes(), array('type' => 'hidden', 'data-searchurl' => $this->Link('search'), 'data-minimuminputlength' => $this->getConfig('minimumInputLength'), 'data-resultslimit' => $this->getConfig('resultsLimit'), 'data-placeholder' => $this->getConfig('placeholder'), 'data-multiple' => $this->getConfig('multiple'))); if ($this->Value() && ($object = DataObject::get($this->getConfig('classToSearch'))->byID($this->Value()))) { $originalSourceFileComments = Config::inst()->get('SSViewer', 'source_file_comments'); Config::inst()->update('SSViewer', 'source_file_comments', false); $attributes['data-selectioncontent'] = html_entity_decode(SSViewer::fromString($this->getConfig('selectionFormat'))->process($object)); Config::inst()->update('SSViewer', 'source_file_comments', $originalSourceFileComments); } return $attributes; }
/** * {@inheritdoc} */ public function getAttributes() { $attributes = array('type' => 'password'); $autocomplete = Config::inst()->get('PasswordField', 'autocomplete'); if ($autocomplete) { $attributes['autocomplete'] = 'on'; } else { $attributes['autocomplete'] = 'off'; } return array_merge(parent::getAttributes(), $attributes); }
/** * @return array */ function getAttributes() { return array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete')); }
function getAttributes() { $this->extraClasses[] = 'text'; if (isset($_GET)) { $query = $_GET; if (isset($query['url'])) { unset($query['url']); } $query = http_build_query($query); } else { $query = ''; } $attributes = array_merge(['data-suggest-url' => $this->SuggestURL ? Controller::join_links($this->SuggestURL, '?' . $query, sprintf('?%s=%%QUERY', $this->queryKey)) : false, 'data-prefetch-url' => $this->PrefetchURL ? Controller::join_links($this->PrefetchURL, '?' . $query) : false, 'data-min-length' => $this->minSearchLength, 'data-require-selection' => $this->requireSelection, 'data-name' => strtolower($this->ID()), 'data-templates.empty' => _t('TypeAheadField.NO_MATCHES', 'No matches found')], parent::getAttributes(), ['autocomplete' => 'off']); if (!$this->form || !$this->SuggestURL && !$this->PrefetchURL || is_array($this->SourceList)) { if ($list = $this->SourceList) { $results = $this->results('', $list, null, false); } else { $results = []; } $attributes['data-local'] = json_encode($results); } if (is_array($this->SourceList)) { unset($attributes['data-suggest-url']); unset($attributes['data-prefetch-url']); } return $attributes; }
function getAttributes() { return array_merge( parent::getAttributes(), array('type' => 'password') ); }
public function getAttributes() { $attrs = parent::getAttributes(); return array_merge($attrs, array('type' => $this->EditableField() ? 'text' : 'hidden')); }
/** * @return array */ public function getAttributes() { $atts = array_merge(parent::getAttributes(), array('data-source' => $this->getSuggestURL(), 'data-min-length' => $this->getMinSearchLength(), 'data-require-selection' => $this->getRequireSelection(), 'autocomplete' => 'off', 'name' => $this->getName() . '__autocomplete', 'placeholder' => 'Search on ' . implode(' or ', $this->getSourceFields()))); // Unset the value so we start with a clear search form $atts['value'] = null; return $atts; }
/** * {@inheritDoc} */ public function getAttributes() { return array_merge(parent::getAttributes(), array('value' => $this->getOption('always_empty') && !$this->isBound() ? '' : $this->getDisplayedData(), 'type' => 'password')); }
public function getAttributes() { return array_merge(parent::getAttributes(), array('data-prefix' => $this->getURLPrefix(), 'data-suffix' => '?stage=Stage')); }
/** * Returns the attributes * * @return array */ public function getAttributes() { return array_merge(parent::getAttributes(), array('placeholder' => $this->getPlaceholder())); }
public function getAttributes() { return array_merge(parent::getAttributes(), array('type' => 'number', 'step' => 'any')); }
/** * Add default attributes for use on all inputs. * * @return array List of attributes */ public function getAttributes() { return array_merge(parent::getAttributes(), array('autocomplete' => 'off', 'maxlength' => 4, 'size' => 4)); }
/** * @return array */ function getAttributes() { return array_merge(parent::getAttributes(), array('data-suggestions' => json_encode($this->suggestions))); }