[*] BO: List all modules with an upgrade available on AdminModules header

This commit is contained in:
Rémi Gaillard
2013-03-27 18:58:21 +01:00
parent 286dea8362
commit c2d8853f57
2 changed files with 15 additions and 2 deletions
@@ -26,7 +26,16 @@
<div id="productBox">
{include file='controllers/modules/header.tpl'}
{include file='controllers/modules/filters.tpl'}
{if $upgrade_available|@count}
<div class="hint" style="display:block;">
{l s='An upgrade is available for some of your modules!'}
<ul>
{foreach from=$upgrade_available item='module'}
<li> &raquo; <a href="{$currentIndex|escape:htmlall}&token={$token|escape:htmlall}&anchor=anchor{$module.anchor|escape:htmlall}"><b>{$module.name|escape:htmlall}</b></a></li>
{/foreach}
</ul>
</div>
{/if}
<ul class="view-modules">
<li class="button normal-view-disabled"><img src="themes/default/img/modules_view_layout_sidebar.png" alt="{l s='Normal view'}" border="0" /><span>{l s='Normal view'}</span></li>
<li class="button favorites-view"><a href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites"><img src="themes/default/img/modules_view_table_select_row.png" alt="{l s='Favorites view'}" border="0" /><span>{l s='Favorites view'}</span></a></li>
+5 -1
View File
@@ -1005,6 +1005,7 @@ class AdminModulesControllerCore extends AdminController
$this->nb_modules_total = count($modules);
$module_errors = array();
$module_success = array();
$upgrade_available = array();
// Browse modules list
foreach ($modules as $km => $module)
@@ -1015,7 +1016,7 @@ class AdminModulesControllerCore extends AdminController
unset($modules[$km]);
continue;
}
// Upgrade Module process, init check if a module could be upgraded
if (Module::initUpgradeModule($module))
{
@@ -1085,6 +1086,8 @@ class AdminModulesControllerCore extends AdminController
$modules[$km]->preferences = $modules_preferences[$modules[$km]->name];
}
unset($object);
if (isset($module->version_addons))
$upgrade_available[] = array('anchor' => ucfirst($module->name), 'name' => $module->displayName);;
}
// Don't display categories without modules
@@ -1109,6 +1112,7 @@ class AdminModulesControllerCore extends AdminController
$tpl_vars = array();
$tpl_vars['token'] = $this->token;
$tpl_vars['upgrade_available'] = $upgrade_available;
$tpl_vars['currentIndex'] = self::$currentIndex;
$tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex);
$tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex);