Ignore:
Timestamp:
Feb 13, 2009, 10:03:02 PM (15 years ago)
Author:
patdenice
Message:

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).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/admin/include/plugins.class.php

    r3071 r3144  
    305305    $url .= '&version=' . implode(',', $versions_to_check);
    306306    $url .= '&lang=' . substr($user['language'], 0, 2);
     307    $url .= '&get_nb_downloads=true';
    307308
    308309    if (!empty($plugins_to_check))
     
    345346      case 'author':
    346347        uasort($this->server_plugins, array($this, 'extension_author_compare'));
     348        break;
     349      case 'downloads':
     350        usort($this->server_plugins, array($this, 'extension_downloads_compare'));
    347351        break;
    348352    }
     
    509513  }
    510514
     515  function extension_downloads_compare($a, $b)
     516  {
     517    if ($a['extension_nb_downloads'] < $b['extension_nb_downloads']) return 1;
     518    else return -1;
     519  }
     520
    511521  function sort_plugins_by_state()
    512522  {
Note: See TracChangeset for help on using the changeset viewer.