Changeset 3144 for branches/2.0/admin


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).
Location:
branches/2.0/admin
Files:
6 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  {
  • branches/2.0/admin/plugins_new.php

    r3082 r3144  
    8484    $link.'revision' => l10n('plugins_revisions'),
    8585    $link.'name' => l10n('Name'),
    86     $link.'author' => l10n('Author')));
     86    $link.'author' => l10n('Author'),
     87    $link.'downloads' => l10n('Number of downloads')));
    8788$template->assign('order_selected', $link.$order);
    8889
     
    9899    list($date, ) = explode(' ', $plugin['revision_date']);
    99100
    100     $ver_desc = sprintf(l10n('plugins_description'),
    101       $plugin['revision_name'],
    102       $date,
    103       $plugin['revision_description']);
     101    $ext_desc = '<i>'.l10n('Downloads').':</i> '.$plugin['extension_nb_downloads']."\r\n"
     102      ."\r\n"
     103      .$plugin['extension_description'];
     104
     105    $rev_desc = '<i>'.l10n('Version').':</i> '.$plugin['revision_name']."\r\n"
     106      .'<i>'.l10n('Released on').':</i> '.$date."\r\n"
     107      .'<i>'.l10n('Downloads').':</i> '.$plugin['revision_nb_downloads']."\r\n"
     108      ."\r\n"
     109      .$plugin['revision_description'];
    104110
    105111    $url_auto_install = htmlentities($base_url)
     
    110116      'EXT_NAME' => $plugin['extension_name'],
    111117      'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$plugin['extension_id'],
    112       'EXT_DESC' => $plugin['extension_description'],
     118      'EXT_DESC' => $ext_desc,
    113119      'VERSION' => $plugin['revision_name'],
    114       'VERSION_URL' => PEM_URL.'/revision_view.php?rid='.$plugin['revision_id'],
    115120      'DATE' => $date,
    116       'VER_DESC' => $ver_desc,
     121      'VER_DESC' => $rev_desc,
    117122      'AUTHOR' => $plugin['author_name'],
    118123      'URL_INSTALL' => $url_auto_install,
  • branches/2.0/admin/plugins_update.php

    r3082 r3144  
    8787    default:
    8888      array_push($page['errors'],
    89         sprintf(l10n('plugins_extract_error'), $_GET['installstatus']),
     89        sprintf(l10n('plugins_extract_error'), $_GET['upgradestatus']),
    9090        l10n('plugins_check_chmod'));
    9191  } 
     
    109109      list($date, ) = explode(' ', $plugin_info['revision_date']);
    110110
    111       $ver_desc = sprintf(l10n('plugins_description'),
    112         $plugin_info['revision_name'],
    113         $date,
    114         $plugin_info['revision_description']);
     111      $ext_desc = '<i>'.l10n('Downloads').':</i> '.$plugin_info['extension_nb_downloads']."\r\n"
     112        ."\r\n"
     113        .$plugin_info['extension_description'];
     114
     115      $rev_desc = '<i>'.l10n('Version').':</i> '.$plugin_info['revision_name']."\r\n"
     116        .'<i>'.l10n('Released on').':</i> '.$date."\r\n"
     117        .'<i>'.l10n('Downloads').':</i> '.$plugin_info['revision_nb_downloads']."\r\n"
     118        ."\r\n"
     119        .$plugin_info['revision_description'];
    115120
    116121      if ($plugins->plugin_version_compare($fs_plugin['version'], $plugin_info['revision_name']))
     
    118123        // Plugin is up to date
    119124        $template->append('plugins_uptodate', array(
    120           'URL' => $fs_plugin['uri'],
     125          'URL' => PEM_URL.'/extension_view.php?eid='.$plugin_info['extension_id'],
    121126          'NAME' => $fs_plugin['name'],
    122           'EXT_DESC' => $plugin_info['extension_description'],
    123           'VERSION' => $fs_plugin['version']));
     127          'EXT_DESC' => $ext_desc,
     128          'VERSION' => $fs_plugin['version'],
     129          'VER_DESC' => $rev_desc));
    124130      }
    125131      else
     
    132138        $template->append('plugins_not_uptodate', array(
    133139          'EXT_NAME' => $fs_plugin['name'],
    134           'EXT_URL' => $fs_plugin['uri'],
    135           'EXT_DESC' => $plugin_info['extension_description'],
     140          'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$plugin_info['extension_id'],
     141          'EXT_DESC' => $ext_desc,
    136142          'VERSION' => $fs_plugin['version'],
    137           'VERSION_URL' => PEM_URL.'/revision_view.php?rid='.$plugin_info['revision_id'],
    138143          'NEW_VERSION' => $plugin_info['revision_name'],
    139           'NEW_VER_DESC' => $ver_desc,
     144          'NEW_VER_DESC' => $rev_desc,
    140145          'URL_UPDATE' => $url_auto_update,
    141146          'URL_DOWNLOAD' => $plugin_info['download_url'] . '&amp;origin=piwigo_download'));
  • branches/2.0/admin/template/goto/default-layout.css

    r2972 r3144  
    3939
    4040/* Plugins tables */
     41TABLE.plugins { min-width: 400px; }
    4142TABLE.plugins A { border: 0; }
    4243TABLE.plugins TR TD { padding: 4px 10px; }
  • branches/2.0/admin/template/goto/plugins_new.tpl

    r2647 r3144  
    1616<span class="sort">
    1717{'Sort order'|@translate} :
    18   <select onchange="document.location = this.options[this.selectedIndex].value;" style="width:150px">
     18  <select onchange="document.location = this.options[this.selectedIndex].value;">
    1919        {html_options options=$order_options selected=$order_selected}
    2020  </select>
     
    3838  <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
    3939    <td><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.EXT_NAME}</a></td>
    40     <td style="text-align:center;"><a href="{$plugin.VERSION_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.VER_DESC|htmlspecialchars|nl2br}">{$plugin.VERSION}</a></td>
     40    <td style="text-align:center;"><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.VER_DESC|htmlspecialchars|nl2br}">{$plugin.VERSION}</a></td>
    4141    <td>{$plugin.DATE}</td>
    4242    <td>{$plugin.AUTHOR}</td>
  • branches/2.0/admin/template/goto/plugins_update.tpl

    r2647 r3144  
    3333    <td><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.EXT_NAME}</a></td>
    3434    <td style="text-align:center;">{$plugin.VERSION}</td>
    35     <td style="text-align:center;"><a href="{$plugin.VERSION_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.NEW_VER_DESC|htmlspecialchars|nl2br}">{$plugin.NEW_VERSION}</a></td>
     35    <td style="text-align:center;"><a href="{$plugin.EXT_URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.EXT_NAME}|{$plugin.NEW_VER_DESC|htmlspecialchars|nl2br}">{$plugin.NEW_VERSION}</a></td>
    3636    <td style="text-align:center;"><a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'plugins_confirm_upgrade'|@translate|@escape:javascript}');">{'plugins_auto_update'|@translate}</a>
    3737      / <a href="{$plugin.URL_DOWNLOAD}">{'plugins_download'|@translate}</a></td>
     
    5555  <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
    5656    <td><a href="{$plugin.URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.NAME}</a></td>
    57     <td style="text-align:center;">{$plugin.VERSION}</td>
     57    <td style="text-align:center;"><a href="{$plugin.URL}" onclick="window.open(this.href); return false;" class="cluetip" title="{$plugin.NAME}|{$plugin.VER_DESC|htmlspecialchars|nl2br}">{$plugin.VERSION}</a></td>
    5858  </tr>
    5959{/foreach}
Note: See TracChangeset for help on using the changeset viewer.