diff options
Diffstat (limited to 'phpBB/includes/acp/acp_extensions.php')
-rw-r--r-- | phpBB/includes/acp/acp_extensions.php | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php index bcc77dfb25..d52a65da67 100644 --- a/phpBB/includes/acp/acp_extensions.php +++ b/phpBB/includes/acp/acp_extensions.php @@ -25,7 +25,7 @@ class acp_extensions function main() { // Start the page - global $user, $template, $request, $phpbb_extension_manager, $db; + global $user, $template, $request, $phpbb_extension_manager, $db, $phpbb_root_path; $user->add_lang(array('install', 'acp/extensions')); @@ -42,11 +42,13 @@ class acp_extensions $this->list_enabled_exts($db, $template); $this->list_disabled_exts($db, $template); $this->list_available_exts($phpbb_extension_manager, $template); + $this->tpl_name = 'acp_ext_list'; break; case 'enable_pre': $this->tpl_name = 'acp_ext_enable'; + $template->assign_vars(array( 'PRE' => true, 'U_ENABLE' => $this->u_action . '&action=enable&ext_name=' . $ext_name, @@ -55,7 +57,9 @@ class acp_extensions case 'enable': $phpbb_extension_manager->enable($ext_name); + $this->tpl_name = 'acp_ext_enable'; + $template->assign_vars(array( 'U_RETURN' => $this->u_action . '&action=list', )); @@ -63,6 +67,7 @@ class acp_extensions case 'disable_pre': $this->tpl_name = 'acp_ext_disable'; + $template->assign_vars(array( 'PRE' => true, 'U_DISABLE' => $this->u_action . '&action=disable&ext_name=' . $ext_name, @@ -71,7 +76,9 @@ class acp_extensions case 'disable': $phpbb_extension_manager->disable($ext_name); + $this->tpl_name = 'acp_ext_disable'; + $template->assign_vars(array( 'U_RETURN' => $this->u_action . '&action=list', )); @@ -79,6 +86,7 @@ class acp_extensions case 'purge_pre': $this->tpl_name = 'acp_ext_purge'; + $template->assign_vars(array( 'PRE' => true, 'U_PURGE' => $this->u_action . '&action=purge&ext_name=' . $ext_name, @@ -87,7 +95,9 @@ class acp_extensions case 'purge': $phpbb_extension_manager->purge($ext_name); + $this->tpl_name = 'acp_ext_purge'; + $template->assign_vars(array( 'U_RETURN' => $this->u_action . '&action=list', )); @@ -95,6 +105,7 @@ class acp_extensions case 'delete_pre': $this->tpl_name = 'acp_ext_delete'; + $template->assign_vars(array( 'PRE' => true, 'U_DELETE' => $this->u_action . '&action=delete&ext_name=' . $ext_name, @@ -106,9 +117,10 @@ class acp_extensions break; case 'details': - $filepath = $phpbb_root_path . 'ext/' . $ext_name . '/extension.json'; + $md_manager = new phpbb_extension_metadata_manager($ext_name, $db, $phpbb_extension_manager, $phpbb_root_path, ".$phpEx", $template); + $md_manager->get_all_meta_data('all', true); + $this->tpl_name = 'acp_ext_details'; - $this->parse_meta_info($ext_name, $phpbb_extension_manager); break; } } @@ -120,6 +132,7 @@ class acp_extensions WHERE ext_active = 1 ORDER BY ext_name ASC'; $result = $db->sql_query($sql); + // TODO: Use the display name from the composer.json while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('enabled', array( @@ -142,6 +155,7 @@ class acp_extensions WHERE ext_active = 0 ORDER BY ext_name ASC'; $result = $db->sql_query($sql); + // TODO: Use the display name from the composer.json while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('disabled', array( @@ -165,6 +179,8 @@ class acp_extensions $all_configured = array_keys($phpbb_extension_manager->all_configured()); $uninstalled = array_diff($all_available, $all_configured); + // TODO: Use the display name from the composer.json + foreach ($uninstalled as $ext) { $template->assign_block_vars('disabled', array( @@ -178,34 +194,4 @@ class acp_extensions return; } - - function parse_meta_info($ext_name, $phpbb_extension_manager) - { - $phpbb_extension_manager->get_meta_data($ext_name); - - $template->assign_vars(array( - 'NAME' => $metadata['name'], - 'TYPE' => $metadata['type'], - 'DESCRIPTION' => $metadata['description'], - 'HOMEPAGE' => $metadata['homepage'], - 'VERSION' => $metadata['version'], - 'TIME' => $metadata['time'], - 'LICENSE' => $metadata['licence'], - 'REQUIRE_PHP' => $metadata['require']['php'], - 'REQUIRE_PHPBB' => $metadata['require']['phpbb'], - 'DISPLAY_NAME' => $metadata['extra']['display-name'], - )); - - foreach ($metadata['authors'] as $author) - { - $template->assign_block_vars('authors', array( - 'AUTHOR_NAME' => $author['name'], - 'AUTHOR_EMAIL' => $author['email'], - 'AUTHOR_HOMEPAGE' => $author['homepage'], - 'AUTHOR_ROLE' => $author['role'], - )); - } - - return $metadata; - } } |