Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / src / Form / ModulesListExperimentalConfirmForm.php
1 <?php
2
3 namespace Drupal\system\Form;
4
5 /**
6  * Builds a confirmation form for enabling experimental modules.
7  *
8  * @internal
9  */
10 class ModulesListExperimentalConfirmForm extends ModulesListConfirmForm {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function getQuestion() {
16     return $this->t('Are you sure you wish to enable experimental modules?');
17   }
18
19   /**
20    * {@inheritdoc}
21    */
22   public function getFormId() {
23     return 'system_modules_experimental_confirm_form';
24   }
25
26   /**
27    * {@inheritdoc}
28    */
29   protected function buildMessageList() {
30     drupal_set_message($this->t('<a href=":url">Experimental modules</a> are provided for testing purposes only. Use at your own risk.', [':url' => 'https://www.drupal.org/core/experimental']), 'warning');
31
32     $items = parent::buildMessageList();
33     // Add the list of experimental modules after any other messages.
34     $items[] = $this->t('The following modules are experimental: @modules', ['@modules' => implode(', ', array_values($this->modules['experimental']))]);
35
36     return $items;
37   }
38
39 }