Changes for src/Form/OpenSearchSettingsForm.php: 27 added lines, 21 removed lines.
Original line number
Diff line number
Diff line
@@ -12,58 +12,64 @@ use Drupal\Core\Url;
*/
classOpenSearchSettingsFormextendsConfigFormBase{
// Definitions for all text fields in the form.
constFIELDS=[
/**
* Define all text fields in the form.
*
* @return array
*/
privatefunctionfields(){
return[
[
'title'=>'Search form path',
'description'=>'Path to the search form, e.g.: "/search". If empty, the following value will be used: "/search/node".',
'title'=>$this->t('Search form path'),
'description'=>$this->t('Path to the search form, e.g.: "/search". If empty, the following value will be used: "/search/node".'),
'name'=>'opensearchtab_search_form_path',
'id'=>'search-form-path',
'min_length'=>2,
],
[
'title'=>'Search path',
'description'=>'Path to the search, e.g.: "/search?{searchTerms}". If empty, the following value will be used: "/search/node?keys={searchTerms}".',
'title'=>$this->t('Search path'),
'description'=>$this->t('Path to the search, e.g.: "/search?{searchTerms}". If empty, the following value will be used: "/search/node?keys={searchTerms}".'),
'name'=>'opensearchtab_search_path',
'id'=>'search-path',
'min_length'=>15,
],
[
'title'=>'Suggestions path (JSON)',
'description'=>'Path to the suggestions, e.g.: "/suggestions?{searchTerms}".',
'title'=>$this->t('Suggestions path (JSON)'),
'description'=>$this->t('Path to the suggestions, e.g.: "/suggestions?{searchTerms}".'),
'name'=>'opensearchtab_suggestions_path_json',
'id'=>'suggestions-path-json',
'min_length'=>15,
],
[
'title'=>'Suggestions path (XML)',
'description'=>'Path to the suggestions, e.g.: "/suggestions?{searchTerms}".',
'title'=>$this->t('Suggestions path (XML)'),
'description'=>$this->t('Path to the suggestions, e.g.: "/suggestions?{searchTerms}".'),
'name'=>'opensearchtab_suggestions_path_xml',
'id'=>'suggestions-path-xml',
'min_length'=>15,
],
[
'title'=>'Short name',
'description'=>'Short name will be displayed in the search box. If empty, the site name be used.',
'title'=>$this->t('Short name'),
'description'=>$this->t('Short name will be displayed in the search box. If empty, the site name be used.'),
'name'=>'opensearchtab_shortname',
'id'=>'shortname',
'min_length'=>3,
],
[
'title'=>'Description',
'description'=>"Description of the search.",
'title'=>$this->t('Description'),
'description'=>$this->t('Description of the search.'),
'name'=>'opensearchtab_description',
'id'=>'description',
'min_length'=>10,
],
[
'title'=>'Favicon path',
'description'=>'Path to the Favicon, e.g.: "/themes/contrib/mytheme/favicon.ico".',
'title'=>$this->t('Favicon path'),
'description'=>$this->t('Path to the Favicon, e.g.: "/themes/contrib/mytheme/favicon.ico".'),
'name'=>'opensearchtab_favicon_path',
'id'=>'favicon-path',
'min_length'=>5,
],
];
}
/**
* {@inheritdoc}
@@ -94,12 +100,12 @@ class OpenSearchSettingsForm extends ConfigFormBase {