[*] BO: List all modules with an upgrade available on AdminModules header
This commit is contained in:
@@ -26,7 +26,16 @@
|
|||||||
<div id="productBox">
|
<div id="productBox">
|
||||||
{include file='controllers/modules/header.tpl'}
|
{include file='controllers/modules/header.tpl'}
|
||||||
{include file='controllers/modules/filters.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> » <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">
|
<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 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>
|
<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>
|
||||||
|
|||||||
@@ -1005,6 +1005,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$this->nb_modules_total = count($modules);
|
$this->nb_modules_total = count($modules);
|
||||||
$module_errors = array();
|
$module_errors = array();
|
||||||
$module_success = array();
|
$module_success = array();
|
||||||
|
$upgrade_available = array();
|
||||||
|
|
||||||
// Browse modules list
|
// Browse modules list
|
||||||
foreach ($modules as $km => $module)
|
foreach ($modules as $km => $module)
|
||||||
@@ -1015,7 +1016,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
unset($modules[$km]);
|
unset($modules[$km]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Upgrade Module process, init check if a module could be upgraded
|
// Upgrade Module process, init check if a module could be upgraded
|
||||||
if (Module::initUpgradeModule($module))
|
if (Module::initUpgradeModule($module))
|
||||||
{
|
{
|
||||||
@@ -1085,6 +1086,8 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$modules[$km]->preferences = $modules_preferences[$modules[$km]->name];
|
$modules[$km]->preferences = $modules_preferences[$modules[$km]->name];
|
||||||
}
|
}
|
||||||
unset($object);
|
unset($object);
|
||||||
|
if (isset($module->version_addons))
|
||||||
|
$upgrade_available[] = array('anchor' => ucfirst($module->name), 'name' => $module->displayName);;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't display categories without modules
|
// Don't display categories without modules
|
||||||
@@ -1109,6 +1112,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
$tpl_vars = array();
|
$tpl_vars = array();
|
||||||
|
|
||||||
$tpl_vars['token'] = $this->token;
|
$tpl_vars['token'] = $this->token;
|
||||||
|
$tpl_vars['upgrade_available'] = $upgrade_available;
|
||||||
$tpl_vars['currentIndex'] = self::$currentIndex;
|
$tpl_vars['currentIndex'] = self::$currentIndex;
|
||||||
$tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex);
|
$tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex);
|
||||||
$tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex);
|
$tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex);
|
||||||
|
|||||||
Reference in New Issue
Block a user