From c5c8d7e0718bb58131b85c2861fdce76429d4ccd Mon Sep 17 00:00:00 2001
From: ebremner <ebremner@uwaterloo.ca>
Date: Tue, 27 Oct 2020 10:07:09 -0400
Subject: [PATCH] ISTWCMS-4166: first attempting at adding the confirmation
 form for unpublishing

---
 src/Form/UwContentModerationForm.php | 39 ++++++++++++++++++++++++++++
 uw_cfg_common.routing.yml            |  7 +++++
 2 files changed, 46 insertions(+)
 create mode 100644 src/Form/UwContentModerationForm.php

diff --git a/src/Form/UwContentModerationForm.php b/src/Form/UwContentModerationForm.php
new file mode 100644
index 00000000..f730b4f4
--- /dev/null
+++ b/src/Form/UwContentModerationForm.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace Drupal\uw_cfg_common\Form;
+
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\uw_cfg_common\UwPermissions\UwPermissions;
+
+/**
+ * Form class for the content access form.
+ */
+class UwContentModerationForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'uw_content_moderation_form';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state, $nid = NULL, $vid = NULL) {
+
+    $form = [];
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+
+    // Set the message that the permissions have been saved.
+    $this->messenger()->addStatus($this->t('The changes have been saved.'));
+  }
+}
diff --git a/uw_cfg_common.routing.yml b/uw_cfg_common.routing.yml
index e64d3636..c22fe91f 100644
--- a/uw_cfg_common.routing.yml
+++ b/uw_cfg_common.routing.yml
@@ -5,3 +5,10 @@ uw_contact_access.form:
     _form: '\Drupal\uw_cfg_common\Form\UwContentAccessForm'
   requirements:
     _permission: 'access content access form'
+uw_content_moderation.form:
+  path: '/admin/uw-content-moderation/{nid}/{vid}'
+  defaults:
+    _title: 'Content moderation'
+    _form: '\Drupal\uw_cfg_common\Form\UwContentModerationForm'
+  requirements:
+    _permission: 'access content'
\ No newline at end of file
-- 
GitLab