Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / pathologic / src / PathologicSettingsForm.php
1 <?php
2
3 namespace Drupal\pathologic;
4
5 use Drupal\Core\Form\ConfigFormBase;
6 use Drupal\Core\Form\FormStateInterface;
7 use Drupal\pathologic\PathologicSettingsCommon;
8
9 class PathologicSettingsForm extends ConfigFormBase {
10   
11   /**
12    * {@inheritdoc}
13    */
14   public function getFormId() {
15     return 'pathologic_settings';
16   }
17
18   /**
19    * {@inheritdoc}
20    */
21   public function buildForm(array $form, FormStateInterface $form_state) {
22     $config = $this->config('pathologic.settings');
23
24     $form['reminder'] = [
25       '#type' => 'markup',
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&rsquo;s configured to use per-format settings, these settings will have no effect.') . '</p>',
27       '#weight' => 0,
28     ];
29     $defaults = [
30       'protocol_style' => $config->get('protocol_style'),
31       'local_paths' => $config->get('local_paths'),
32     ];
33
34     $common = new PathologicSettingsCommon();
35     $form += $common->commonSettingsForm($defaults);
36
37     return parent::buildForm($form, $form_state);       
38   }
39
40   /**
41    * {@inheritdoc}
42    */
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'))
47       ->save();
48
49     parent::submitForm($form, $form_state);
50   }
51
52   /**
53    * @inheritdoc
54    */
55   protected function getEditableConfigNames() {
56     return [
57       'pathologic.settings',
58     ];
59   }
60
61 }