aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorpatdenice <patdenice@piwigo.org>2009-02-13 20:49:03 +0000
committerpatdenice <patdenice@piwigo.org>2009-02-13 20:49:03 +0000
commit290f2c1d39d1c47d48ba4e6a6d347459975e8b0f (patch)
treee330eef287b07298d5acf37c9829beeacc16fb85 /admin/include
parent83d87c3d02844bd6fab391923e04913f35d99359 (diff)
- 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/trunk@3143 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/plugins.class.php10
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');