commit 14acb8baccaeb7264b8632d153185b8cfa224270 Author: Kim Pepper Date: Thu Apr 11 18:17:43 2013 +1000 Patch #12 diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmForm.php new file mode 100644 index 0000000..5a6374a --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmForm.php @@ -0,0 +1,90 @@ + 'value', '#value' => $modules); + $form['status']['#tree'] = TRUE; + + foreach ($storage['more_required'] as $info) { + $t_argument = array( + '@module' => $info['name'], + '@required' => implode(', ', $info['requires']), + ); + $items[] = format_plural(count($info['requires']), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', $t_argument); + } + + foreach ($storage['missing_modules'] as $name => $info) { + $t_argument = array( + '@module' => $name, + '@depends' => implode(', ', $info['depends']), + ); + $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); + } + + $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmFrom.php b/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmFrom.php deleted file mode 100644 index ca4c6dd..0000000 --- a/core/modules/system/lib/Drupal/system/Form/ModulesInstallConfirmFrom.php +++ /dev/null @@ -1,90 +0,0 @@ - 'value', '#value' => $modules); - $form['status']['#tree'] = TRUE; - - foreach ($storage['more_required'] as $info) { - $t_argument = array( - '@module' => $info['name'], - '@required' => implode(', ', $info['requires']), - ); - $items[] = format_plural(count($info['requires']), 'You must enable the @required module to install @module.', 'You must enable the @required modules to install @module.', $t_argument); - } - - foreach ($storage['missing_modules'] as $name => $info) { - $t_argument = array( - '@module' => $name, - '@depends' => implode(', ', $info['depends']), - ); - $items[] = format_plural(count($info['depends']), 'The @module module is missing, so the following module will be disabled: @depends.', 'The @module module is missing, so the following modules will be disabled: @depends.', $t_argument); - } - - $form['text'] = array('#markup' => theme('item_list', array('items' => $items))); - - return parent::buildForm($form, $form_state); - } - - /** - * Implements \Drupal\Core\Form\FormInterface::submitForm(). - */ - public function submitForm(array &$form, array &$form_state) { - } - -} diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php new file mode 100644 index 0000000..a72ac92 --- /dev/null +++ b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmForm.php @@ -0,0 +1,79 @@ + $value) { + $info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info.yml'); + $uninstall[] = $info['name']; + $form['uninstall'][$module] = array('#type' => 'hidden', '#value' => 1); + } + + $form['#confirmed'] = TRUE; + $form['uninstall']['#tree'] = TRUE; + $form['modules'] = array('#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

' . theme('item_list', array('items' => $uninstall))); + + return parent::buildForm($form, $form_state); + } + + /** + * Implements \Drupal\Core\Form\FormInterface::submitForm(). + */ + public function submitForm(array &$form, array &$form_state) { + } + +} diff --git a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmFrom.php b/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmFrom.php deleted file mode 100644 index 9ebd452..0000000 --- a/core/modules/system/lib/Drupal/system/Form/ModulesUninstallConfirmFrom.php +++ /dev/null @@ -1,79 +0,0 @@ - $value) { - $info = drupal_parse_info_file(drupal_get_path('module', $module) . '/' . $module . '.info.yml'); - $uninstall[] = $info['name']; - $form['uninstall'][$module] = array('#type' => 'hidden', '#value' => 1); - } - - $form['#confirmed'] = TRUE; - $form['uninstall']['#tree'] = TRUE; - $form['modules'] = array('#markup' => '

' . t('The following modules will be completely uninstalled from your site, and all data from these modules will be lost!') . '

' . theme('item_list', array('items' => $uninstall))); - - return parent::buildForm($form, $form_state); - } - - /** - * Implements \Drupal\Core\Form\FormInterface::submitForm(). - */ - public function submitForm(array &$form, array &$form_state) { - } - -} diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 2119240..1731dcd 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -7,12 +7,11 @@ use Drupal\Core\Ajax\AjaxResponse; use Drupal\Core\Ajax\ReplaceCommand; -use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; use Drupal\Core\Datetime\DrupalDateTime; -use Drupal\system\Form\ModulesInstallConfirmFrom; -use Drupal\system\Form\ModulesUninstallConfirmFrom; +use Drupal\system\Form\ModulesInstallConfirmForm; +use Drupal\system\Form\ModulesUninstallConfirmForm; /** * Menu callback; Provide the administration overview page. @@ -817,7 +816,7 @@ function system_modules($form, $form_state = array()) { if (!empty($form_state['storage'])) { // Contents of confirm form is injected here because already in form // building function. - $confirm_form = new ModulesInstallConfirmFrom(); + $confirm_form = new ModulesInstallConfirmForm(); return $confirm_form->buildForm($form, $form_state, $visible_files, $form_state['storage']); } @@ -1230,7 +1229,7 @@ function system_modules_uninstall($form, $form_state = NULL) { if (!empty($form_state['storage']['uninstall']) && $modules = array_filter($form_state['storage']['uninstall'])) { // Contents of confirm form is injected here because already in form // building function. - $confirm_form = new ModulesUninstallConfirmFrom(); + $confirm_form = new ModulesUninstallConfirmForm(); return $confirm_form->buildForm($form, $form_state, $modules); }