aboutsummaryrefslogtreecommitdiffstats
path: root/admin
diff options
context:
space:
mode:
Diffstat (limited to 'admin')
-rw-r--r--admin/plugins_update.php45
-rw-r--r--admin/themes/default/template/plugins_update.tpl93
2 files changed, 41 insertions, 97 deletions
diff --git a/admin/plugins_update.php b/admin/plugins_update.php
index 24622125a..432cf76b1 100644
--- a/admin/plugins_update.php
+++ b/admin/plugins_update.php
@@ -119,59 +119,32 @@ if ($plugins->get_server_plugins())
{
$plugin_info = $plugins->server_plugins[$fs_plugin['extension']];
- list($date, ) = explode(' ', $plugin_info['revision_date']);
-
- $ext_desc = '<i>'.l10n('Downloads').':</i> '.$plugin_info['extension_nb_downloads']."\r\n"
- ."\r\n"
- .$plugin_info['extension_description'];
-
- $rev_desc = '<i>'.l10n('Version').':</i> '.$plugin_info['revision_name']."\r\n"
- .'<i>'.l10n('Released on').':</i> '.$date."\r\n"
- .'<i>'.l10n('Downloads').':</i> '.$plugin_info['revision_nb_downloads']."\r\n"
- ."\r\n"
- .$plugin_info['revision_description'];
-
- if ($plugins->plugin_version_compare($fs_plugin['version'], $plugin_info['revision_name']))
+ if (!$plugins->plugin_version_compare($fs_plugin['version'], $plugin_info['revision_name']))
{
- // Plugin is up to date
- $template->append('plugins_uptodate', array(
- 'URL' => PEM_URL.'/extension_view.php?eid='.$plugin_info['extension_id'],
- 'NAME' => $fs_plugin['name'],
- 'EXT_DESC' => $ext_desc,
- 'VERSION' => $fs_plugin['version'],
- 'VER_DESC' => $rev_desc));
- }
- else
- {
- // Plugin need upgrade
$url_auto_update = $base_url
. '&amp;revision=' . $plugin_info['revision_id']
. '&amp;plugin=' . $plugin_id
. '&amp;pwg_token='.get_pwg_token()
;
- $template->append('plugins_not_uptodate', array(
+ $template->append('plugins', array(
+ 'ID' => $plugin_info['extension_id'],
'EXT_NAME' => $fs_plugin['name'],
'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$plugin_info['extension_id'],
- 'EXT_DESC' => $ext_desc,
- 'VERSION' => $fs_plugin['version'],
- 'NEW_VERSION' => $plugin_info['revision_name'],
- 'NEW_VER_DESC' => $rev_desc,
+ 'EXT_DESC' => trim($plugin_info['extension_description'], " \n\r"),
+ 'REV_DESC' => trim($plugin_info['revision_description'], " \n\r"),
+ 'VERSION' => $plugin_info['revision_name'],
+ 'AUTHOR' => $plugin_info['author_name'],
+ 'DOWNLOADS' => $plugin_info['extension_nb_downloads'],
'URL_UPDATE' => $url_auto_update,
'URL_DOWNLOAD' => $plugin_info['download_url'] . '&amp;origin=piwigo_download'));
}
}
- else
- {
- // Can't check plugin
- $template->append('plugins_cant_check', array(
- 'NAME' => $fs_plugin['name'],
- 'VERSION' => $fs_plugin['version']));
- }
}
}
else
{
+ $template->assign('SERVER_ERROR', true);
array_push($page['errors'], l10n('Can\'t connect to server.'));
}
diff --git a/admin/themes/default/template/plugins_update.tpl b/admin/themes/default/template/plugins_update.tpl
index 2304db112..11b97c829 100644
--- a/admin/themes/default/template/plugins_update.tpl
+++ b/admin/themes/default/template/plugins_update.tpl
@@ -1,3 +1,4 @@
+{combine_script id='jquery.ui' load='async' require='jquery' path='themes/default/js/jquery.ui.min.js' }
{combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.packed.js'}
{footer_script require='jquery.cluetip'}
jQuery().ready(function(){ldelim}
@@ -12,66 +13,36 @@ jQuery().ready(function(){ldelim}
<h2>{'Plugins'|@translate}</h2>
</div>
-{if isset($plugins_not_uptodate)}
-<br>
-<b>{'Plugins which need upgrade'|@translate}</b>
-<table class="table2 plugins">
-<thead>
- <tr class="throw">
- <td>{'Name'|@translate}</td>
- <td>{'Current<br>version'|@translate}</td>
- <td>{'Available<br>version'|@translate}</td>
- <td>{'Actions'|@translate}</td>
- </tr>
-</thead>
-{foreach from=$plugins_not_uptodate item=plugin name=plugins_loop}
- <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
- <td><a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{$plugin.EXT_NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.EXT_NAME}</a></td>
- <td style="text-align:center;">{$plugin.VERSION}</td>
- <td style="text-align:center;"><a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{$plugin.EXT_NAME}|{$plugin.NEW_VER_DESC|htmlspecialchars|nl2br}">{$plugin.NEW_VERSION}</a></td>
- <td style="text-align:center;"><a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Automatic upgrade'|@translate}</a>
- / <a href="{$plugin.URL_DOWNLOAD}">{'Download file'|@translate}</a></td>
- </tr>
-{/foreach}
-</table>
-{/if}
-
-
-{if isset($plugins_uptodate)}
-<br>
-<b>{'Plugins up to date'|@translate}</b>
-<table class="table2 plugins">
-<thead>
- <tr class="throw">
- <td>{'Name'|@translate}</td>
- <td>{'Version'|@translate}</td>
- </tr>
-</thead>
-{foreach from=$plugins_uptodate item=plugin name=plugins_loop}
- <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
- <td><a href="{$plugin.URL}" class="externalLink cluetip" title="{$plugin.NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.NAME}</a></td>
- <td style="text-align:center;"><a href="{$plugin.URL}" class="externalLink cluetip" title="{$plugin.NAME}|{$plugin.VER_DESC|htmlspecialchars|nl2br}">{$plugin.VERSION}</a></td>
- </tr>
-{/foreach}
-</table>
-{/if}
-
-
-{if isset($plugins_cant_check)}
-<br>
-<b>{'Plugin versions can\'t be checked'|@translate}</b>
-<table class="table2 plugins">
-<thead>
- <tr class="throw">
- <td>{'Name'|@translate}</td>
- <td>{'Version'|@translate}</td>
- </tr>
-</thead>
-{foreach from=$plugins_cant_check item=plugin name=plugins_loop}
- <tr class="{if $smarty.foreach.plugins_loop.index is odd}row1{else}row2{/if}">
- <td>{$plugin.NAME}</td>
- <td style="text-align:center;">{$plugin.VERSION}</td>
- </tr>
+{if not empty($plugins)}
+<div id="availablePlugins">
+<fieldset>
+<legend>{'Plugins which need upgrade'|@translate}</legend>
+{foreach from=$plugins item=plugin name=plugins_loop}
+<div class="pluginBox" id="plugin_{$plugin.ID}">
+ <table>
+ <tr>
+ <td class="pluginBoxNameCell">
+ <a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{$plugin.EXT_NAME}|{$plugin.EXT_DESC|htmlspecialchars|nl2br}">{$plugin.EXT_NAME}</a>
+ </td>
+ <td>
+ <a href="{$plugin.URL_UPDATE}" onclick="return confirm('{'Are you sure to install this upgrade? You must verify if this version does not need uninstallation.'|@translate|@escape:javascript}');">{'Automatic upgrade'|@translate}</a>
+ | <a href="{$plugin.URL_DOWNLOAD}">{'Download file'|@translate}</a>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="{$plugin.EXT_URL}" class="externalLink cluetip" title="{'Version'|@translate} {$plugin.VERSION}|{$plugin.REV_DESC|htmlspecialchars|nl2br}"> {'Version'|@translate} {$plugin.VERSION}</a>
+ </td>
+ <td>
+ <em>{'Downloads'|@translate}: {$plugin.DOWNLOADS}</em>
+ {'By %s'|@translate|@sprintf:$plugin.AUTHOR}
+ </td>
+ </tr>
+ </table>
+</div>
{/foreach}
-</table>
+</fieldset>
+</div>
+{elseif not isset($SERVER_ERROR)}
+<p>{'All plugins are up to date.'|@translate}</p>
{/if}