diff options
author | patdenice <patdenice@piwigo.org> | 2011-04-06 09:43:46 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2011-04-06 09:43:46 +0000 |
commit | 0dd800150b5e8aaeb229f45779c590db0658b1e9 (patch) | |
tree | b36139d0bde2d3806033badf76c8e787d45a996a /admin/plugins_list.php | |
parent | a8b750b8551697dd6f6927dfc2ae9f297d7ed216 (diff) |
feature:2250
Incompatible plugins and obsolete plugins may not be activated.
git-svn-id: http://piwigo.org/svn/trunk@10098 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/plugins_list.php | 64 |
1 files changed, 46 insertions, 18 deletions
diff --git a/admin/plugins_list.php b/admin/plugins_list.php index 21e8ec3f2..6fee091e7 100644 --- a/admin/plugins_list.php +++ b/admin/plugins_list.php @@ -67,9 +67,20 @@ $plugins->set_tabsheet($page['page']); // +-----------------------------------------------------------------------+ $plugins->sort_fs_plugins('name'); +$plugins->get_merged_extensions(); +$plugins->get_incompatible_plugins(); +$merged_plugins = array(); foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) { + if (isset($_SESSION['incompatible_plugins'][$plugin_id]) + and $fs_plugin['version'] != $_SESSION['incompatible_plugins'][$plugin_id]) + { + // Incompatible plugins must be reinitilized + unset($_SESSION['incompatible_plugins']); + $plugins->get_incompatible_plugins(); + } + $tpl_plugin = array( 'NAME' => $fs_plugin['name'], 'VISIT_URL' => $fs_plugin['uri'], @@ -77,9 +88,17 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) 'DESC' => $fs_plugin['description'], 'AUTHOR' => $fs_plugin['author'], 'AUTHOR_URL' => @$fs_plugin['author uri'], - 'U_ACTION' => sprintf($action_url, $plugin_id) + 'U_ACTION' => sprintf($action_url, $plugin_id), + 'INCOMPATIBLE' => isset($_SESSION['incompatible_plugins'][$plugin_id]), ); + if (isset($fs_plugin['extension']) and in_array($fs_plugin['extension'], $_SESSION['merged_extensions'])) + { + $tpl_plugin['STATE'] = 'merged'; + array_push($merged_plugins, $tpl_plugin); + continue; + } + if (isset($plugins->db_plugins_by_id[$plugin_id])) { $tpl_plugin['STATE'] = $plugins->db_plugins_by_id[$plugin_id]['state']; @@ -92,32 +111,41 @@ foreach($plugins->fs_plugins as $plugin_id => $fs_plugin) $template->append('plugins', $tpl_plugin); } +$template->append('plugin_states', 'active'); +$template->append('plugin_states', 'inactive'); +$template->append('plugin_states', 'uninstalled'); + $missing_plugin_ids = array_diff( array_keys($plugins->db_plugins_by_id), array_keys($plugins->fs_plugins) ); -foreach($missing_plugin_ids as $plugin_id) +if (count($missing_plugin_ids) > 0) { - $template->append( - 'plugins', - array( - 'NAME' => $plugin_id, - 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], - 'DESC' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !", - 'U_ACTION' => sprintf($action_url, $plugin_id), - 'STATE' => 'missing', - ) - ); + foreach($missing_plugin_ids as $plugin_id) + { + $template->append( + 'plugins', + array( + 'NAME' => $plugin_id, + 'VERSION' => $plugins->db_plugins_by_id[$plugin_id]['version'], + 'DESC' => "ERROR: THIS PLUGIN IS MISSING BUT IT IS INSTALLED! UNINSTALL IT NOW !", + 'U_ACTION' => sprintf($action_url, $plugin_id), + 'STATE' => 'missing', + ) + ); + } + $template->append('plugin_states', 'missing'); } -$template->append('plugin_states', 'active'); -$template->append('plugin_states', 'inactive'); -$template->append('plugin_states', 'uninstalled'); - -if (count($missing_plugin_ids) > 0) +if (count($merged_plugins) > 0) { - $template->append('plugin_states', 'missing'); + foreach($merged_plugins as $tpl_plugin) + { + $tpl_plugin['DESC'] = l10n("THIS PLUGIN IS NOW PART OF PIWIGO CORE. UNINSTALL IT NOW."); + $template->append('plugins', $tpl_plugin); + } + $template->append('plugin_states', 'merged'); } $template->assign_var_from_handle('ADMIN_CONTENT', 'plugins'); |