diff options
author | patdenice <patdenice@piwigo.org> | 2009-02-13 21:03:02 +0000 |
---|---|---|
committer | patdenice <patdenice@piwigo.org> | 2009-02-13 21:03:02 +0000 |
commit | 35e9af66be0b6da3055d032123bd38100b58bca9 (patch) | |
tree | ae42252fa3a0c93a9bcfb9880dc4a2ba2b05019b /admin/include | |
parent | 164fd3a280f22a06153c6497e423199a0a97f7a0 (diff) |
merge r3143 from trunk to branch 2.0
- Show number of downloads in plugins list.
- Allow to sort plugins by number of downloads.
- Fix plugin revision URL (no more revision_view in PEM).
git-svn-id: http://piwigo.org/svn/branches/2.0@3144 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/include')
-rw-r--r-- | admin/include/plugins.class.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/admin/include/plugins.class.php b/admin/include/plugins.class.php index d746298df..caff5ef26 100644 --- a/admin/include/plugins.class.php +++ b/admin/include/plugins.class.php @@ -304,6 +304,7 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"'; $url = PEM_URL . '/api/get_revision_list.php?category_id=12&format=php&last_revision_only=true'; $url .= '&version=' . implode(',', $versions_to_check); $url .= '&lang=' . substr($user['language'], 0, 2); + $url .= '&get_nb_downloads=true'; if (!empty($plugins_to_check)) { @@ -345,6 +346,9 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"'; case 'author': uasort($this->server_plugins, array($this, 'extension_author_compare')); break; + case 'downloads': + usort($this->server_plugins, array($this, 'extension_downloads_compare')); + break; } } @@ -508,6 +512,12 @@ DELETE FROM ' . PLUGINS_TABLE . ' WHERE id="' . $plugin_id . '"'; else return $r; } + function extension_downloads_compare($a, $b) + { + if ($a['extension_nb_downloads'] < $b['extension_nb_downloads']) return 1; + else return -1; + } + function sort_plugins_by_state() { uasort($this->fs_plugins, 'name_compare'); |