Pathologic was missing because of a .git folder inside.
[yaffs-website] / web / modules / contrib / pathologic / src / PathologicSettingsForm.php
diff --git a/web/modules/contrib/pathologic/src/PathologicSettingsForm.php b/web/modules/contrib/pathologic/src/PathologicSettingsForm.php
new file mode 100644 (file)
index 0000000..a8fb169
--- /dev/null
@@ -0,0 +1,61 @@
+<?php
+
+namespace Drupal\pathologic;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\pathologic\PathologicSettingsCommon;
+
+class PathologicSettingsForm extends ConfigFormBase {
+  
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'pathologic_settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $config = $this->config('pathologic.settings');
+
+    $form['reminder'] = [
+      '#type' => 'markup',
+      '#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>',
+      '#weight' => 0,
+    ];
+    $defaults = [
+      'protocol_style' => $config->get('protocol_style'),
+      'local_paths' => $config->get('local_paths'),
+    ];
+
+    $common = new PathologicSettingsCommon();
+    $form += $common->commonSettingsForm($defaults);
+
+    return parent::buildForm($form, $form_state);       
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    $this->config('pathologic.settings')
+      ->set('protocol_style', $form_state->getValue('protocol_style'))
+      ->set('local_paths', $form_state->getValue('local_paths'))
+      ->save();
+
+    parent::submitForm($form, $form_state);
+  }
+
+  /**
+   * @inheritdoc
+   */
+  protected function getEditableConfigNames() {
+    return [
+      'pathologic.settings',
+    ];
+  }
+
+}