aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-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');