-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Derek Reese
committed
May 19, 2020
1 parent
3e5575d
commit 74ff5e0
Showing
15 changed files
with
666 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Drupal\patternkit\Form; | ||
|
||
use Drupal\Core\Form\ConfigFormBase; | ||
use Drupal\Core\Form\FormStateInterface; | ||
|
||
/** | ||
* Settings form for configuring the REST Library Plugin. | ||
*/ | ||
class PatternLibraryRESTForm extends ConfigFormBase { | ||
|
||
/** | ||
* Settings identifier. | ||
* | ||
* @var string | ||
*/ | ||
public const SETTINGS = 'patternkit.settings'; | ||
|
||
/** | ||
* Implements buildForm(). | ||
* | ||
* {@inheritDoc} | ||
*/ | ||
public function buildForm(array $form, FormStateInterface $form_state) :array { | ||
$config = $this->config(static::SETTINGS); | ||
|
||
$form['patternkit_pl_host'] = array( | ||
'#type' => 'textfield', | ||
'#title' => t('PatternLab Host Web Address'), | ||
'#description' => t('Enter the website address of the PatternLab host REST endpoint.'), | ||
'#default_value' => $config->get('patternkit_pl_host'), | ||
); | ||
|
||
return parent::buildForm($form, $form_state); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getEditableConfigNames() :array { | ||
return [static::SETTINGS]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function getFormId() :string { | ||
return 'patternkit_rest_editor_config'; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function submitForm(array &$form, FormStateInterface $form_state): void { | ||
$this->config(static::SETTINGS) | ||
->set('patternkit_pl_host', $form_state->getValue('patternkit_pl_host')) | ||
->save(); | ||
parent::submitForm($form, $form_state); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.