3 namespace Drupal\pathologic;
5 use Drupal\Core\Form\ConfigFormBase;
6 use Drupal\Core\Form\FormStateInterface;
7 use Drupal\pathologic\PathologicSettingsCommon;
9 class PathologicSettingsForm extends ConfigFormBase {
14 public function getFormId() {
15 return 'pathologic_settings';
21 public function buildForm(array $form, FormStateInterface $form_state) {
22 $config = $this->config('pathologic.settings');
26 '#markup' => '<p>' . $this->t('Reminder: The settings on this form only affect text formats for which Pathologic is configured to use the global Pathologic settings; if it’s configured to use per-format settings, these settings will have no effect.') . '</p>',
30 'protocol_style' => $config->get('protocol_style'),
31 'local_paths' => $config->get('local_paths'),
34 $common = new PathologicSettingsCommon();
35 $form += $common->commonSettingsForm($defaults);
37 return parent::buildForm($form, $form_state);
43 public function submitForm(array &$form, FormStateInterface $form_state) {
44 $this->config('pathologic.settings')
45 ->set('protocol_style', $form_state->getValue('protocol_style'))
46 ->set('local_paths', $form_state->getValue('local_paths'))
49 parent::submitForm($form, $form_state);
55 protected function getEditableConfigNames() {
57 'pathologic.settings',