From 8d5fcc8d4ca85c2752771ba7c808ed4e19c3c773 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Nov 2013 15:33:31 +0100 Subject: [PATCH 01/15] [ticket/11994] Make extension manager UI less misleading Enable and Install were split into two different expressions. Purge was renamed to uninstall to make clearer what is going to happen. PHPBB3-11994 --- phpBB/adm/style/acp_ext_disable.html | 14 ++++---- phpBB/adm/style/acp_ext_enable.html | 16 ++++----- phpBB/adm/style/acp_ext_list.html | 10 +++--- phpBB/adm/style/acp_ext_purge.html | 16 ++++----- phpBB/includes/acp/acp_extensions.php | 34 +++++++++++------- phpBB/language/en/acp/extensions.php | 51 +++++++++++++-------------- 6 files changed, 72 insertions(+), 69 deletions(-) diff --git a/phpBB/adm/style/acp_ext_disable.html b/phpBB/adm/style/acp_ext_disable.html index 7dc3f6ec97..4fa0893be7 100644 --- a/phpBB/adm/style/acp_ext_disable.html +++ b/phpBB/adm/style/acp_ext_disable.html @@ -5,29 +5,29 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_DISABLE_EXPLAIN}

+

{L_EXTENSION_DISABLE_EXPLAIN}

-

{L_DISABLE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_DISABLE} - + {L_EXTENSION_DISABLE} +
-

{L_DISABLE_IN_PROGRESS}

+

{L_EXTENSION_DISABLE_IN_PROGRESS}

-

{L_DISABLE_SUCCESS}

+

{L_EXTENSION_DISABLE_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 35585207eb..2a8c638b1d 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -5,35 +5,35 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_ENABLE_EXPLAIN}

+

{L_EXTENSION_ENABLE_EXPLAIN}{L_EXTENSION_INSTALL_EXPLAIN}

{L_MIGRATION_EXCEPTION_ERROR}

{MIGRATOR_ERROR}

-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

-

{L_ENABLE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_ENABLE} - + {L_EXTENSION_ENABLE}{L_EXTENSION_INSTALL} +
-

{L_ENABLE_IN_PROGRESS}

+

{L_EXTENSION_ENABLE_IN_PROGRESS}{L_EXTENSION_INSTALL_IN_PROGRESS}

-

{L_ENABLE_SUCCESS}

+

{L_EXTENSION_ENABLE_SUCCESS}{L_EXTENSION_INSTALL_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/adm/style/acp_ext_list.html b/phpBB/adm/style/acp_ext_list.html index 390b3e79f0..8408ebe748 100644 --- a/phpBB/adm/style/acp_ext_list.html +++ b/phpBB/adm/style/acp_ext_list.html @@ -18,9 +18,7 @@ - - {L_ENABLED} {L_EXTENSIONS} - + {L_EXTENSIONS_ENABLED} @@ -28,7 +26,7 @@ {L_DETAILS} - {enabled.actions.L_ACTION} + title="{enabled.actions.L_ACTION_EXPLAIN}">{enabled.actions.L_ACTION}  |  @@ -38,7 +36,7 @@ - {L_DISABLED} {L_EXTENSIONS} + {L_EXTENSIONS_DISABLED} @@ -48,7 +46,7 @@ - {disabled.actions.L_ACTION} + title="{disabled.actions.L_ACTION_EXPLAIN}">{disabled.actions.L_ACTION}  |  diff --git a/phpBB/adm/style/acp_ext_purge.html b/phpBB/adm/style/acp_ext_purge.html index 94bef82ca5..310efd0e1d 100644 --- a/phpBB/adm/style/acp_ext_purge.html +++ b/phpBB/adm/style/acp_ext_purge.html @@ -5,35 +5,35 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_PURGE_EXPLAIN}

+

{L_EXTENSION_UNINSTALL_EXPLAIN}

{L_MIGRATION_EXCEPTION_ERROR}

{MIGRATOR_ERROR}

-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

-

{L_PURGE_CONFIRM}

+

{L_CONFIRM_MESSAGE}

- {L_PURGE} - + {L_EXTENSION_UNINSTALL} +
-

{L_PURGE_IN_PROGRESS}

+

{L_EXTENSION_UNINSTALL_IN_PROGRESS}

-

{L_PURGE_SUCCESS}

+

{L_EXTENSION_UNINSTALL_SUCCESS}


-

{L_RETURN}

+

{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index b41f4d4e81..896c911859 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -83,6 +83,7 @@ class acp_extensions break; case 'enable_pre': + case 'install_pre': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -96,12 +97,15 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $template->assign_vars(array( - 'PRE' => true, - 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'IS_ENABLING' => $action == 'enable_pre', + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $ext_name), + 'U_ENABLE' => $this->u_action . '&action=' . (($action == 'enable_pre') ? 'enable' : 'install') . '&ext_name=' . urlencode($ext_name), )); break; case 'enable': + case 'install': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -116,7 +120,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=' . $action . '&ext_name=' . urlencode($ext_name)); } } } @@ -128,7 +132,8 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $template->assign_vars(array( - 'U_RETURN' => $this->u_action . '&action=list', + 'IS_ENABLING' => $action == 'enable', + 'U_RETURN' => $this->u_action . '&action=list', )); break; @@ -141,8 +146,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_disable'; $template->assign_vars(array( - 'PRE' => true, - 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $ext_name), + 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), )); break; @@ -169,8 +175,9 @@ class acp_extensions $this->tpl_name = 'acp_ext_purge'; $template->assign_vars(array( - 'PRE' => true, - 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), + 'PRE' => true, + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $ext_name), + 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), )); break; @@ -233,7 +240,7 @@ class acp_extensions $this->output_actions('enabled', array( 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($name), - 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -267,7 +274,7 @@ class acp_extensions $this->output_actions('disabled', array( 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), - 'PURGE' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -302,7 +309,7 @@ class acp_extensions )); $this->output_actions('disabled', array( - 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), + 'INSTALL' => $this->u_action . '&action=install_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -325,8 +332,9 @@ class acp_extensions foreach ($actions as $lang => $url) { $this->template->assign_block_vars($block . '.actions', array( - 'L_ACTION' => $this->user->lang($lang), - 'U_ACTION' => $url, + 'L_ACTION' => $this->user->lang('EXTENSION_' . $lang), + 'L_ACTION_EXPLAIN' => (isset($this->user->lang['EXTENSION_' . $lang . '_EXPLAIN'])) ? $this->user->lang('EXTENSION_' . $lang . '_EXPLAIN') : '', + 'U_ACTION' => $url, )); } } diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 369397ead2..d97100da70 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -39,47 +39,44 @@ $lang = array_merge($lang, array( 'EXTENSIONS' => 'Extensions', 'EXTENSIONS_ADMIN' => 'Extensions Manager', 'EXTENSIONS_EXPLAIN' => 'The Extensions Manager is a tool in your phpBB Board which allows you to manage all of your extensions statuses and view information about them.', - 'EXTENSION_INVALID_LIST' => 'The "%s" extension is not valid.
%s

', + 'EXTENSION_INVALID_LIST' => 'The “%s” extension is not valid.
%s

', 'EXTENSION_NOT_AVAILABLE' => 'The selected extension is not available for this board, please verify your phpBB and PHP versions are allowed (see the details page).', 'DETAILS' => 'Details', - 'AVAILABLE' => 'Available', - 'ENABLED' => 'Enabled', - 'DISABLED' => 'Disabled', - 'PURGED' => 'Purged', - 'UPLOADED' => 'Uploaded', + 'EXTENSIONS_ENABLED' => 'Enabled Extensions', + 'EXTENSIONS_DISABLED' => 'Disabled Extensions', - 'ENABLE' => 'Enable', - 'DISABLE' => 'Disable', - 'PURGE' => 'Purge', + 'EXTENSION_DISABLE' => 'Disable', + 'EXTENSION_ENABLE' => 'Enable', + 'EXTENSION_INSTALL' => 'Install', + 'EXTENSION_UNINSTALL' => 'Uninstall', - 'ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', - 'DISABLE_EXPLAIN' => 'Disabling an extension retains its files and settings but removes any functionality added by the extension.', - 'PURGE_EXPLAIN' => 'Purging an extension clears an extensions data while retaining its files.', - 'DELETE_EXPLAIN' => 'Deleting an extension removes all of its files and settings. Log entries will remain, although any language variables added by the extension will not be available.', + 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', + 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', + 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.', + 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all data and settings of the extensions. Only the extension files are retained, so you can install it again.', - 'DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', - 'ENABLE_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', - 'PURGE_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', - 'ENABLE_SUCCESS' => 'The extension was enabled successfully', - 'DISABLE_SUCCESS' => 'The extension was disabled successfully', - 'PURGE_SUCCESS' => 'The extension was purged successfully', + 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', + 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave this page or refresh until it is completed.', + 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', + 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', - 'ENABLE_FAIL' => 'The extension could not be enabled', - 'DISABLE_FAIL' => 'The extension could not be disabled', - 'PURGE_FAIL' => 'The extension could not be purged', + 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', + 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', + 'EXTENSION_INSTALL_SUCCESS' => 'The extension was installed successfully', + 'EXTENSION_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully', 'EXTENSION_NAME' => 'Extension Name', 'EXTENSION_ACTIONS' => 'Actions', 'EXTENSION_OPTIONS' => 'Options', - 'ENABLE_CONFIRM' => 'Are you sure that you wish to enable this extension?', - 'DISABLE_CONFIRM' => 'Are you sure that you wish to disable this extension?', - 'PURGE_CONFIRM' => 'Are you sure that you wish to purge this extension's data? This will remove all settings stored for this extension and cannot be undone!', + 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', + 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?', + 'EXTENSION_INSTALL_CONFIRM' => 'Are you sure that you wish to install the “%s” extension?', + 'EXTENSION_UNINSTALL_CONFIRM' => 'Are you sure that you wish to uninstall the “%s” extension? This will remove all data and settings stored for this extension and cannot be undone!', - 'WARNING' => 'Warning', - 'RETURN' => 'Return', + 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', 'EXT_DETAILS' => 'Extension Details', 'DISPLAY_NAME' => 'Display Name', From 7bc6f3210005d8623ba363b9a19903c5bd3a402a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Nov 2013 15:56:59 +0100 Subject: [PATCH 02/15] [ticket/11994] More language fixes PHPBB3-11994 --- phpBB/language/en/acp/extensions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index d97100da70..75bb0e3cfa 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -55,12 +55,12 @@ $lang = array_merge($lang, array( 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.', - 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all data and settings of the extensions. Only the extension files are retained, so you can install it again.', + 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all data and settings of the extensions. The extension files are retained so it can be installed again.', - 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave this page or refresh until it is completed.', - 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave this page or refresh until it is completed.', - 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave this page or refresh until it is completed.', - 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave this page or refresh until it is completed.', + 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', + 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', + 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave or refresh this page until it is completed.', + 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave or refresh this page until it is completed.', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', From f98ddb23e8b60cd30bcbaa4c1c2ce772c0cbcc96 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Nov 2013 16:25:22 +0100 Subject: [PATCH 03/15] [ticket/11994] Fix functional extension tests PHPBB3-11994 --- tests/functional/extension_acp_test.php | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 401b18f11c..029f13b4f1 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -83,18 +83,18 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertCount(5, $crawler->filter('.ext_disabled')); $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContainsLang('PURGE', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContains('The "test2" extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); + $this->assertContains('The “test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); - $this->assertContains('The "test3" extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); + $this->assertContains('The “test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('PURGE', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContains('The "bar" extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); + $this->assertContains('The “bar” extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); } public function test_details() @@ -148,8 +148,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('ENABLE_CONFIRM', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'vendor/moo'), $crawler->filter('html')->text()); } public function test_disable_pre() @@ -160,8 +160,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContainsLang('DISABLE_CONFIRM', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'foo'), $crawler->filter('html')->text()); } public function test_purge_pre() @@ -170,19 +170,19 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=test2&sid=' . $this->sid); $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContainsLang('PURGE_CONFIRM', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContains($this->lang('EXTENSION_UNINSTALL_CONFIRM', 'foo'), $crawler->filter('html')->text()); } public function test_actions() { - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('ENABLE_SUCCESS', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('DISABLE_SUCCESS', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('PURGE_SUCCESS', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_UNINSTALL_SUCCESS', $crawler->filter('html')->text()); } } From e60588a25943f7cf662a5d759bfc8c1936da75a7 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 1 Nov 2013 16:26:04 +0100 Subject: [PATCH 04/15] [ticket/11994] Replace spaces with tabs PHPBB3-11994 --- tests/functional/extension_acp_test.php | 100 ++++++++++++------------ 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 029f13b4f1..d466e01c80 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -77,59 +77,59 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case public function test_list() { - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&sid=' . $this->sid); - $this->assertCount(1, $crawler->filter('.ext_enabled')); - $this->assertCount(5, $crawler->filter('.ext_disabled')); + $this->assertCount(1, $crawler->filter('.ext_enabled')); + $this->assertCount(5, $crawler->filter('.ext_disabled')); - $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContains('The “test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); + $this->assertContains('The “test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); - $this->assertContains('The “test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); + $this->assertContains('The “test3” extension is not valid.', $crawler->filter('.ext_disabled')->eq(1)->text()); - $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContains('The “bar” extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); + $this->assertContains('The “bar” extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); } public function test_details() { - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo&sid=' . $this->sid); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=details&ext_name=foo&sid=' . $this->sid); - $validation = array( - 'DISPLAY_NAME' => 'phpBB Foo Extension', - 'CLEAN_NAME' => 'foo/example', - 'TYPE' => 'phpbb-extension', - 'DESCRIPTION' => 'An example/sample extension to be used for testing purposes in phpBB Development.', - 'VERSION' => '1.0.0', - 'TIME' => '2012-02-15 01:01:01', - 'LICENCE' => 'GPL-2.0', - 'PHPBB_VERSION' => '3.1.*@dev', - 'PHP_VERSION' => '>=5.3', - 'AUTHOR_NAME' => 'John Smith', - 'AUTHOR_EMAIL' => 'email@phpbb.com', - 'AUTHOR_HOMEPAGE' => 'http://phpbb.com', - 'AUTHOR_ROLE' => 'N/A', - ); + $validation = array( + 'DISPLAY_NAME' => 'phpBB Foo Extension', + 'CLEAN_NAME' => 'foo/example', + 'TYPE' => 'phpbb-extension', + 'DESCRIPTION' => 'An example/sample extension to be used for testing purposes in phpBB Development.', + 'VERSION' => '1.0.0', + 'TIME' => '2012-02-15 01:01:01', + 'LICENCE' => 'GPL-2.0', + 'PHPBB_VERSION' => '3.1.*@dev', + 'PHP_VERSION' => '>=5.3', + 'AUTHOR_NAME' => 'John Smith', + 'AUTHOR_EMAIL' => 'email@phpbb.com', + 'AUTHOR_HOMEPAGE' => 'http://phpbb.com', + 'AUTHOR_ROLE' => 'N/A', + ); - for ($i = 0; $i < $crawler->filter('dl')->count(); $i++) - { - $text = $crawler->filter('dl')->eq($i)->text(); + for ($i = 0; $i < $crawler->filter('dl')->count(); $i++) + { + $text = $crawler->filter('dl')->eq($i)->text(); - $match = false; + $match = false; - foreach ($validation as $language_key => $expected) - { - if (strpos($text, $this->lang($language_key)) === 0) - { - $match = true; + foreach ($validation as $language_key => $expected) + { + if (strpos($text, $this->lang($language_key)) === 0) + { + $match = true; - $this->assertContains($expected, $text); + $this->assertContains($expected, $text); } } @@ -143,10 +143,10 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case public function test_enable_pre() { // Foo is already enabled (redirect to list) - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'vendor/moo'), $crawler->filter('html')->text()); @@ -154,11 +154,11 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case public function test_disable_pre() { - // Moo is not enabled (redirect to list) - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + // Moo is not enabled (redirect to list) + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'foo'), $crawler->filter('html')->text()); @@ -166,9 +166,9 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case public function test_purge_pre() { - // test2 is not available (error) - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=test2&sid=' . $this->sid); - $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); + // test2 is not available (error) + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=test2&sid=' . $this->sid); + $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); $this->assertContains($this->lang('EXTENSION_UNINSTALL_CONFIRM', 'foo'), $crawler->filter('html')->text()); From 3ac3688a7fb77250a75e8d7a3223f46a52cdfcf8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 14:28:35 +0100 Subject: [PATCH 05/15] [ticket/11994] Fix some language PHPBB3-11994 --- phpBB/language/en/acp/extensions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 75bb0e3cfa..96eed14c0e 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -55,12 +55,12 @@ $lang = array_merge($lang, array( 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.', - 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all data and settings of the extensions. The extension files are retained so it can be installed again.', + 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all of its data and settings. The extension files are retained so it can be installed again.', 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave or refresh this page until it is completed.', - 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being purged, please do not leave or refresh this page until it is completed.', + 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being uninstalled, please do not leave or refresh this page until it is completed.', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', From 473402c77bc173aa78e5355586dd09ee2c57c70c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 14:50:13 +0100 Subject: [PATCH 06/15] [ticket/11994] Use display name on confirmation screen PHPBB3-11994 --- phpBB/includes/acp/acp_extensions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 896c911859..da5a58c7d6 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -99,7 +99,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, 'IS_ENABLING' => $action == 'enable_pre', - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $ext_name), + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $md_manager->get_metadata('display-name')), 'U_ENABLE' => $this->u_action . '&action=' . (($action == 'enable_pre') ? 'enable' : 'install') . '&ext_name=' . urlencode($ext_name), )); break; @@ -147,7 +147,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $ext_name), + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DISABLE_CONFIRM', $md_manager->get_metadata('display-name')), 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . urlencode($ext_name), )); break; @@ -176,7 +176,7 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $ext_name), + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $md_manager->get_metadata('display-name')), 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), )); break; From 476464374a159ef90c28f2b58f8655fb706e0360 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 14:57:03 +0100 Subject: [PATCH 07/15] [ticket/11994] Update functional tests with display name PHPBB3-11994 --- tests/functional/extension_acp_test.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index d466e01c80..a99f3cbfa4 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -149,7 +149,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'vendor/moo'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('html')->text()); } public function test_disable_pre() @@ -161,7 +161,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'foo'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); } public function test_purge_pre() @@ -171,7 +171,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_UNINSTALL_CONFIRM', 'foo'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_UNINSTALL_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); } public function test_actions() From 7e1a02b3a192771043009078630e8e2b9b8026a1 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 23:23:48 +0100 Subject: [PATCH 08/15] [ticket/11994] Make install/enable just one UI thing PHPBB3-11994 --- phpBB/adm/style/acp_ext_enable.html | 10 +++++----- phpBB/includes/acp/acp_extensions.php | 12 ++++-------- phpBB/language/en/acp/extensions.php | 5 ----- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/phpBB/adm/style/acp_ext_enable.html b/phpBB/adm/style/acp_ext_enable.html index 2a8c638b1d..670904a2ce 100644 --- a/phpBB/adm/style/acp_ext_enable.html +++ b/phpBB/adm/style/acp_ext_enable.html @@ -5,7 +5,7 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_EXTENSION_ENABLE_EXPLAIN}{L_EXTENSION_INSTALL_EXPLAIN}

+

{L_EXTENSION_ENABLE_EXPLAIN}

@@ -20,18 +20,18 @@
- {L_EXTENSION_ENABLE}{L_EXTENSION_INSTALL} - + {L_EXTENSION_ENABLE} +
-

{L_EXTENSION_ENABLE_IN_PROGRESS}{L_EXTENSION_INSTALL_IN_PROGRESS}

+

{L_EXTENSION_ENABLE_IN_PROGRESS}

-

{L_EXTENSION_ENABLE_SUCCESS}{L_EXTENSION_INSTALL_SUCCESS}

+

{L_EXTENSION_ENABLE_SUCCESS}


{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index da5a58c7d6..7ca98221c0 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -83,7 +83,6 @@ class acp_extensions break; case 'enable_pre': - case 'install_pre': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -98,14 +97,12 @@ class acp_extensions $template->assign_vars(array( 'PRE' => true, - 'IS_ENABLING' => $action == 'enable_pre', - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_' . (($action == 'enable_pre') ? 'ENABLE' : 'INSTALL') . '_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_ENABLE' => $this->u_action . '&action=' . (($action == 'enable_pre') ? 'enable' : 'install') . '&ext_name=' . urlencode($ext_name), + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_ENABLE_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name), )); break; case 'enable': - case 'install': if (!$md_manager->validate_enable()) { trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -120,7 +117,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=' . $action . '&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=enable&ext_name=' . urlencode($ext_name)); } } } @@ -132,7 +129,6 @@ class acp_extensions $this->tpl_name = 'acp_ext_enable'; $template->assign_vars(array( - 'IS_ENABLING' => $action == 'enable', 'U_RETURN' => $this->u_action . '&action=list', )); break; @@ -309,7 +305,7 @@ class acp_extensions )); $this->output_actions('disabled', array( - 'INSTALL' => $this->u_action . '&action=install_pre&ext_name=' . urlencode($name), + 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 96eed14c0e..5421789e68 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -49,22 +49,18 @@ $lang = array_merge($lang, array( 'EXTENSION_DISABLE' => 'Disable', 'EXTENSION_ENABLE' => 'Enable', - 'EXTENSION_INSTALL' => 'Install', 'EXTENSION_UNINSTALL' => 'Uninstall', 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', - 'EXTENSION_INSTALL_EXPLAIN' => 'Installing an extension will perform database changes that are required to use the extension on your board.', 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all of its data and settings. The extension files are retained so it can be installed again.', 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', - 'EXTENSION_INSTALL_IN_PROGRESS' => 'The extension is currently being installed, please do not leave or refresh this page until it is completed.', 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being uninstalled, please do not leave or refresh this page until it is completed.', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', - 'EXTENSION_INSTALL_SUCCESS' => 'The extension was installed successfully', 'EXTENSION_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully', 'EXTENSION_NAME' => 'Extension Name', @@ -73,7 +69,6 @@ $lang = array_merge($lang, array( 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?', - 'EXTENSION_INSTALL_CONFIRM' => 'Are you sure that you wish to install the “%s” extension?', 'EXTENSION_UNINSTALL_CONFIRM' => 'Are you sure that you wish to uninstall the “%s” extension? This will remove all data and settings stored for this extension and cannot be undone!', 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', From f8e92efc3f213f966a4faa1966ff8e64270328f4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 23:40:56 +0100 Subject: [PATCH 09/15] [ticket/11994] Rename "uninstall" to "delete data" PHPBB3-11994 --- ...xt_purge.html => acp_ext_delete_data.html} | 10 ++++----- phpBB/includes/acp/acp_extensions.php | 21 +++++++++++-------- phpBB/language/en/acp/extensions.php | 12 +++++------ 3 files changed, 23 insertions(+), 20 deletions(-) rename phpBB/adm/style/{acp_ext_purge.html => acp_ext_delete_data.html} (81%) diff --git a/phpBB/adm/style/acp_ext_purge.html b/phpBB/adm/style/acp_ext_delete_data.html similarity index 81% rename from phpBB/adm/style/acp_ext_purge.html rename to phpBB/adm/style/acp_ext_delete_data.html index 310efd0e1d..bbac22055f 100644 --- a/phpBB/adm/style/acp_ext_purge.html +++ b/phpBB/adm/style/acp_ext_delete_data.html @@ -5,7 +5,7 @@

{L_EXTENSIONS_ADMIN}

{L_EXTENSIONS_EXPLAIN}

-

{L_EXTENSION_UNINSTALL_EXPLAIN}

+

{L_EXTENSION_DELETE_DATA_EXPLAIN}

@@ -20,18 +20,18 @@
- {L_EXTENSION_UNINSTALL} - + {L_EXTENSION_DELETE_DATA} +
-

{L_EXTENSION_UNINSTALL_IN_PROGRESS}

+

{L_EXTENSION_DELETE_DATA_IN_PROGRESS}

-

{L_EXTENSION_UNINSTALL_SUCCESS}

+

{L_EXTENSION_DELETE_DATA_SUCCESS}


{L_RETURN_TO_EXTENSION_LIST}

diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 7ca98221c0..29b29f7ad6 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -167,17 +167,21 @@ class acp_extensions )); break; - case 'purge_pre': - $this->tpl_name = 'acp_ext_purge'; + case 'delete_data_pre': + if ($phpbb_extension_manager->enabled($ext_name)) + { + redirect($this->u_action); + } + $this->tpl_name = 'acp_ext_delete_data'; $template->assign_vars(array( 'PRE' => true, - 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_UNINSTALL_CONFIRM', $md_manager->get_metadata('display-name')), - 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name), + 'L_CONFIRM_MESSAGE' => $this->user->lang('EXTENSION_DELETE_DATA_CONFIRM', $md_manager->get_metadata('display-name')), + 'U_PURGE' => $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name), )); break; - case 'purge': + case 'delete_data': try { while ($phpbb_extension_manager->purge_step($ext_name)) @@ -187,7 +191,7 @@ class acp_extensions { $template->assign_var('S_NEXT_STEP', true); - meta_refresh(0, $this->u_action . '&action=purge&ext_name=' . urlencode($ext_name)); + meta_refresh(0, $this->u_action . '&action=delete_data&ext_name=' . urlencode($ext_name)); } } } @@ -196,7 +200,7 @@ class acp_extensions $template->assign_var('MIGRATOR_ERROR', $e->getLocalisedMessage($user)); } - $this->tpl_name = 'acp_ext_purge'; + $this->tpl_name = 'acp_ext_delete_data'; $template->assign_vars(array( 'U_RETURN' => $this->u_action . '&action=list', @@ -236,7 +240,6 @@ class acp_extensions $this->output_actions('enabled', array( 'DISABLE' => $this->u_action . '&action=disable_pre&ext_name=' . urlencode($name), - 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) @@ -270,7 +273,7 @@ class acp_extensions $this->output_actions('disabled', array( 'ENABLE' => $this->u_action . '&action=enable_pre&ext_name=' . urlencode($name), - 'UNINSTALL' => $this->u_action . '&action=purge_pre&ext_name=' . urlencode($name), + 'DELETE_DATA' => $this->u_action . '&action=delete_data_pre&ext_name=' . urlencode($name), )); } catch(\phpbb\extension\exception $e) diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 5421789e68..7477324637 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -44,32 +44,32 @@ $lang = array_merge($lang, array( 'DETAILS' => 'Details', - 'EXTENSIONS_ENABLED' => 'Enabled Extensions', 'EXTENSIONS_DISABLED' => 'Disabled Extensions', + 'EXTENSIONS_ENABLED' => 'Enabled Extensions', + 'EXTENSION_DELETE_DATA' => 'Delete data', 'EXTENSION_DISABLE' => 'Disable', 'EXTENSION_ENABLE' => 'Enable', - 'EXTENSION_UNINSTALL' => 'Uninstall', + 'EXTENSION_DELETE_DATA_EXPLAIN' => 'Deleting data of an extension removes all of its data and settings. The extension files are retained so it can be enabled again.', 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', - 'EXTENSION_UNINSTALL_EXPLAIN' => 'Uninstalling an extension removes all of its data and settings. The extension files are retained so it can be installed again.', + 'EXTENSION_DELETE_DATA_IN_PROGRESS' => 'The data of the extension is currently being deleted, please do not leave or refresh this page until it is completed.', 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', - 'EXTENSION_UNINSTALL_IN_PROGRESS' => 'The extension is currently being uninstalled, please do not leave or refresh this page until it is completed.', + 'EXTENSION_DELETE_DATA_SUCCESS' => 'The data of the extension was deleted successfully', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', - 'EXTENSION_UNINSTALL_SUCCESS' => 'The extension was uninstalled successfully', 'EXTENSION_NAME' => 'Extension Name', 'EXTENSION_ACTIONS' => 'Actions', 'EXTENSION_OPTIONS' => 'Options', + 'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete all data of the “%s” extension? This cannot be undone!', 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?', - 'EXTENSION_UNINSTALL_CONFIRM' => 'Are you sure that you wish to uninstall the “%s” extension? This will remove all data and settings stored for this extension and cannot be undone!', 'RETURN_TO_EXTENSION_LIST' => 'Return to the extension list', From 40fcc906a27072ff824b503017dac14c89181dbb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 2 Nov 2013 23:46:10 +0100 Subject: [PATCH 10/15] [ticket/11994] Fix tests after uninstall rename PHPBB3-11994 --- tests/functional/extension_acp_test.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index a99f3cbfa4..83382116b4 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -83,7 +83,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertCount(5, $crawler->filter('.ext_disabled')); $this->assertContains('phpBB Foo Extension', $crawler->filter('.ext_enabled')->eq(0)->text()); - $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_enabled')->eq(0)->text()); + $this->assertContainsLang('EXTENSION_DISABLE', $crawler->filter('.ext_enabled')->eq(0)->text()); $this->assertContains('The “test2” extension is not valid.', $crawler->filter('.ext_disabled')->eq(0)->text()); @@ -92,7 +92,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContains('phpBB Moo Extension', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('DETAILS', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContainsLang('EXTENSION_ENABLE', $crawler->filter('.ext_disabled')->eq(2)->text()); - $this->assertContainsLang('EXTENSION_UNINSTALL', $crawler->filter('.ext_disabled')->eq(2)->text()); + $this->assertContainsLang('EXTENSION_DELETE_DATA', $crawler->filter('.ext_disabled')->eq(2)->text()); $this->assertContains('The “bar” extension is not valid.', $crawler->filter('.ext_disabled')->eq(3)->text()); } @@ -164,14 +164,14 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); } - public function test_purge_pre() + public function test_delete_data_pre() { // test2 is not available (error) - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=test2&sid=' . $this->sid); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid); $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_UNINSTALL_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); } public function test_actions() @@ -182,7 +182,7 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid); $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('html')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=purge&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_UNINSTALL_SUCCESS', $crawler->filter('html')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('html')->text()); } } From 05c97fd03c68edd65d1a73806a569d9011574804 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Nov 2013 00:29:35 +0100 Subject: [PATCH 11/15] [ticket/11994] Fix more language PHPBB3-11994 --- phpBB/language/en/acp/extensions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php index 7477324637..8279a68022 100644 --- a/phpBB/language/en/acp/extensions.php +++ b/phpBB/language/en/acp/extensions.php @@ -51,15 +51,15 @@ $lang = array_merge($lang, array( 'EXTENSION_DISABLE' => 'Disable', 'EXTENSION_ENABLE' => 'Enable', - 'EXTENSION_DELETE_DATA_EXPLAIN' => 'Deleting data of an extension removes all of its data and settings. The extension files are retained so it can be enabled again.', + 'EXTENSION_DELETE_DATA_EXPLAIN' => 'Deleting an extension’s data removes all of its data and settings. The extension files are retained so it can be enabled again.', 'EXTENSION_DISABLE_EXPLAIN' => 'Disabling an extension retains its files, data and settings but removes any functionality added by the extension.', 'EXTENSION_ENABLE_EXPLAIN' => 'Enabling an extension allows you to use it on your board.', - 'EXTENSION_DELETE_DATA_IN_PROGRESS' => 'The data of the extension is currently being deleted, please do not leave or refresh this page until it is completed.', - 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled, please do not leave or refresh this page until it is completed.', - 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled, please do not leave or refresh this page until it is completed.', + 'EXTENSION_DELETE_DATA_IN_PROGRESS' => 'The extension’s data is currently being deleted. Please do not leave or refresh this page until it is completed.', + 'EXTENSION_DISABLE_IN_PROGRESS' => 'The extension is currently being disabled. Please do not leave or refresh this page until it is completed.', + 'EXTENSION_ENABLE_IN_PROGRESS' => 'The extension is currently being enabled. Please do not leave or refresh this page until it is completed.', - 'EXTENSION_DELETE_DATA_SUCCESS' => 'The data of the extension was deleted successfully', + 'EXTENSION_DELETE_DATA_SUCCESS' => 'The extension’s data was deleted successfully', 'EXTENSION_DISABLE_SUCCESS' => 'The extension was disabled successfully', 'EXTENSION_ENABLE_SUCCESS' => 'The extension was enabled successfully', @@ -67,7 +67,7 @@ $lang = array_merge($lang, array( 'EXTENSION_ACTIONS' => 'Actions', 'EXTENSION_OPTIONS' => 'Options', - 'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete all data of the “%s” extension? This cannot be undone!', + 'EXTENSION_DELETE_DATA_CONFIRM' => 'Are you sure that you wish to delete the data associated with “%s”?

This removes all of its data and settings and cannot be undone!', 'EXTENSION_DISABLE_CONFIRM' => 'Are you sure that you wish to disable the “%s” extension?', 'EXTENSION_ENABLE_CONFIRM' => 'Are you sure that you wish to enable the “%s” extension?', From bb0ff715f8371619e29b1b07b17feceefdb10cdb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Nov 2013 20:27:59 +0100 Subject: [PATCH 12/15] [ticket/11994] Change error level for missing .json file PHPBB3-11994 --- phpBB/includes/acp/acp_extensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index 29b29f7ad6..c5c17cb559 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -66,7 +66,7 @@ class acp_extensions } catch(\phpbb\extension\exception $e) { - trigger_error($e); + trigger_error($e, E_USER_WARNING); } } From 12a6e2c603846db0054e27494429292316b209db Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Nov 2013 20:29:14 +0100 Subject: [PATCH 13/15] [ticket/11994] Filter crawler for better search comparisons PHPBB3-11994 --- tests/functional/extension_acp_test.php | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 83382116b4..7db0067499 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -144,45 +144,45 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case { // Foo is already enabled (redirect to list) $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_ENABLE_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('.errorbox')->text()); } public function test_disable_pre() { // Moo is not enabled (redirect to list) $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('html')->text()); - $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_DISABLE_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('.errorbox')->text()); } public function test_delete_data_pre() { // test2 is not available (error) $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid); - $this->assertContains('The required file does not exist', $crawler->filter('html')->text()); + $this->assertContains('The required file does not exist', $crawler->filter('.errorbox')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('html')->text()); + $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('.errorbox')->text()); } public function test_actions() { $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=enable&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('.successbox')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=disable&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_DISABLE_SUCCESS', $crawler->filter('.successbox')->text()); $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('html')->text()); + $this->assertContainsLang('EXTENSION_DELETE_DATA_SUCCESS', $crawler->filter('.successbox')->text()); } } From d17bf9aa273d8cd3dfb730b506f7aac2bd51a97a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Nov 2013 20:30:09 +0100 Subject: [PATCH 14/15] [ticket/11994] "Delete data" is only available for disabled extensions PHPBB3-11994 --- tests/functional/extension_acp_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 7db0067499..0cd03d8ccb 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -170,8 +170,8 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid); $this->assertContains('The required file does not exist', $crawler->filter('.errorbox')->text()); - $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=foo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Foo Extension'), $crawler->filter('.errorbox')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); + $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('.errorbox')->text()); } public function test_actions() From bf7eab423edc9bde69c960bb182b8313be7d5e3a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 3 Nov 2013 23:39:48 +0100 Subject: [PATCH 15/15] [ticket/11994] Fix functional tests PHPBB3-11994 --- tests/functional/extension_acp_test.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/functional/extension_acp_test.php b/tests/functional/extension_acp_test.php index 0cd03d8ccb..44bb895f67 100644 --- a/tests/functional/extension_acp_test.php +++ b/tests/functional/extension_acp_test.php @@ -170,8 +170,14 @@ class phpbb_functional_extension_acp_test extends phpbb_functional_test_case $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=test2&sid=' . $this->sid); $this->assertContains('The required file does not exist', $crawler->filter('.errorbox')->text()); + // foo is not disabled (redirect to list) + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=foo&sid=' . $this->sid); + $this->assertContainsLang('EXTENSION_NAME', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_OPTIONS', $crawler->filter('div.main thead')->text()); + $this->assertContainsLang('EXTENSION_ACTIONS', $crawler->filter('div.main thead')->text()); + $crawler = self::request('GET', 'adm/index.php?i=acp_extensions&mode=main&action=delete_data_pre&ext_name=vendor%2Fmoo&sid=' . $this->sid); - $this->assertContains($this->lang('EXTENSION_DELETE_DATA_CONFIRM', 'phpBB Moo Extension'), $crawler->filter('.errorbox')->text()); + $this->assertContains('Are you sure that you wish to delete the data associated with “phpBB Moo Extension”?', $crawler->filter('.errorbox')->text()); } public function test_actions()