Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / node / src / Form / RebuildPermissionsForm.php
1 <?php
2
3 namespace Drupal\node\Form;
4
5 use Drupal\Core\Form\ConfirmFormBase;
6 use Drupal\Core\Form\FormStateInterface;
7 use Drupal\Core\Url;
8
9 /**
10  * Form for rebuilding permissions.
11  *
12  * @internal
13  */
14 class RebuildPermissionsForm extends ConfirmFormBase {
15
16   /**
17    * {@inheritdoc}
18    */
19   public function getFormId() {
20     return 'node_configure_rebuild_confirm';
21   }
22
23   /**
24    * {@inheritdoc}
25    */
26   public function getQuestion() {
27     return t('Are you sure you want to rebuild the permissions on site content?');
28   }
29
30   /**
31    * {@inheritdoc}
32    */
33   public function getCancelUrl() {
34     return new Url('system.status');
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function getConfirmText() {
41     return t('Rebuild permissions');
42   }
43
44   /**
45    * {@inheritdoc}
46    */
47   public function getDescription() {
48     return t('This action rebuilds all permissions on site content, and may be a lengthy process. This action cannot be undone.');
49   }
50
51   /**
52    * {@inheritdoc}
53    */
54   public function submitForm(array &$form, FormStateInterface $form_state) {
55     node_access_rebuild(TRUE);
56     $form_state->setRedirectUrl($this->getCancelUrl());
57   }
58
59 }