mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 11:05:56 +02:00
30 lines
817 B
PHP
30 lines
817 B
PHP
<?php
|
|
|
|
class DocumentationSearchForm extends Form {
|
|
|
|
public function __construct($controller) {
|
|
$versions = HiddenField::create(
|
|
'Versions',
|
|
_t('DocumentationViewer.VERSIONS', 'Versions'),
|
|
implode(',', $controller->getManifest()->getAllVersions())
|
|
);
|
|
|
|
$fields = new FieldList(
|
|
TextField::create('q', _t('DocumentationViewer.SEARCH', 'Search'), '')
|
|
->setAttribute('placeholder', _t('DocumentationViewer.SEARCH', 'Search')),
|
|
$versions
|
|
);
|
|
|
|
$actions = new FieldList(
|
|
new FormAction('results', _t('DocumentationViewer.SEARCH', 'Search'))
|
|
);
|
|
|
|
parent::__construct($controller, 'DocumentationSearchForm', $fields, $actions);
|
|
|
|
$this->disableSecurityToken();
|
|
$this->setFormMethod('GET');
|
|
$this->setFormAction($controller->Link('results'));
|
|
|
|
$this->addExtraClass('search');
|
|
}
|
|
} |