[-] BO : Module list new action buttons
This commit is contained in:
1 parent
2aa4237bb2
commit
1af9fdd1b2
3 files changed
+50
-22
No files matched your search
@@ -62,6 +62,16 @@
|
|||||||
{$module->displayName}
|
{$module->displayName}
|
||||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||||
<span class="label label-info">{l s='Must Have'}</span>
|
<span class="label label-info">{l s='Must Have'}</span>
|
||||||
|
{elseif isset($module->id) && $module->id gt 0}
|
||||||
|
{if isset($module->version_addons) && $module->version_addons}
|
||||||
|
<span class="label label-warning">{l s='Need update'}</span>
|
||||||
|
{elseif $module->active == 1}
|
||||||
|
<span class="label label-info">{l s='Active'}</span>
|
||||||
|
{elseif $module->active == 0}
|
||||||
|
<span class="label label-disabled">{l s='Inactive'}</span>
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
<span class="label label-disabled">{l s='Not installed'}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<!-- {if isset($module->id) && $module->id gt 0}
|
<!-- {if isset($module->id) && $module->id gt 0}
|
||||||
<span class="label label-success{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>
|
<span class="label label-success{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>
|
||||||
@@ -91,33 +101,42 @@
|
|||||||
</td>
|
</td>
|
||||||
<td width="180px">
|
<td width="180px">
|
||||||
<div id="list-action-button" class="btn-group">
|
<div id="list-action-button" class="btn-group">
|
||||||
|
|
||||||
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
{if isset($module->type) && $module->type == 'addonsMustHave'}
|
||||||
<a class="btn btn-default" href="{$module->addons_buy_url}" target="_blank">
|
<a class="btn btn-default" href="{$module->addons_buy_url}" target="_blank">
|
||||||
<i class="icon-shopping-cart"></i> {if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}
|
<i class="icon-shopping-cart"></i> {if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}
|
||||||
</a>
|
</a>
|
||||||
{else}
|
{else}
|
||||||
{if $module->id && isset($module->version_addons) && $module->version_addons}
|
{if isset($module->id) && $module->id gt 0}
|
||||||
<a class="btn btn-warning" href="{$module->options.update_url}">
|
{if isset($module->version_addons) && $module->version_addons}
|
||||||
<i class="icon-refresh"></i> {l s='Update it!'}
|
<a class="btn btn-warning" href="{$module->options.update_url}">
|
||||||
|
<i class="icon-refresh"></i> {l s='Update it!'}
|
||||||
|
</a>
|
||||||
|
{elseif !isset($module->not_on_disk)}
|
||||||
|
{if $module->optionsHtml|count > 0}
|
||||||
|
{assign var=option value=$module->optionsHtml[0]}
|
||||||
|
{$option}
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
<a class="btn btn-danger" {if !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{$module->options.uninstall_url}">
|
||||||
|
<i class="icon-minus-sign-alt"></i> {l s='Uninstall'}
|
||||||
|
</a>
|
||||||
|
{/if}
|
||||||
|
{else}
|
||||||
|
<a class="btn btn-success" href="{$module->options.install_url}">
|
||||||
|
<i class="icon-plus-sign-alt"></i> {l s='Install'}
|
||||||
</a>
|
</a>
|
||||||
{/if}
|
{/if}
|
||||||
<a class="btn {if isset($module->id) && $module->id gt 0}btn-danger{else}btn-success{/if}" {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}">
|
|
||||||
{if isset($module->id) && $module->id gt 0}
|
|
||||||
<i class="icon-minus-sign-alt"></i>
|
|
||||||
{l s='Uninstall'}
|
|
||||||
{else}
|
|
||||||
<i class="icon-plus-sign-alt"></i>
|
|
||||||
{l s='Install'}
|
|
||||||
{/if}
|
|
||||||
</a>
|
|
||||||
{if !isset($module->not_on_disk)}
|
{if !isset($module->not_on_disk)}
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
|
||||||
<span class="caret"> </span>
|
<span class="caret"> </span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
{$module->optionsHtml}
|
{foreach $module->optionsHtml key=key item=option}
|
||||||
|
{if $key != 0}
|
||||||
|
<li>{$option}</li>
|
||||||
|
{/if}
|
||||||
|
{/foreach}
|
||||||
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
|
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
|
||||||
<li>
|
<li>
|
||||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
|
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
|
||||||
@@ -129,7 +148,7 @@
|
|||||||
<i class="icon-star"></i> {l s='Mark as Favorite'}
|
<i class="icon-star"></i> {l s='Mark as Favorite'}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{else}
|
{else}
|
||||||
<li>
|
<li>
|
||||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
|
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
|
||||||
<i class="icon-star"></i> {l s='Remove from Favorites'}
|
<i class="icon-star"></i> {l s='Remove from Favorites'}
|
||||||
@@ -145,7 +164,7 @@
|
|||||||
{else}
|
{else}
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -3003,11 +3003,20 @@ class AdminControllerCore extends Controller
|
|||||||
if ($option['cond'])
|
if ($option['cond'])
|
||||||
{
|
{
|
||||||
if ($output_type == 'link')
|
if ($output_type == 'link')
|
||||||
$return .= '<li>
|
$return .= '<li><a class="'.$option_name.' action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'"><i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'</a></li>';
|
||||||
<a class="'.$option_name.' action_module" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'">
|
elseif ($output_type == 'array')
|
||||||
<i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'
|
{
|
||||||
</a>
|
if (!is_array($return))
|
||||||
</li>';
|
$return = array();
|
||||||
|
|
||||||
|
$html = '<a class="';
|
||||||
|
|
||||||
|
if (count($return) == 0)
|
||||||
|
$html .= 'btn btn-default btn-small';
|
||||||
|
|
||||||
|
$html .= '" href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" onclick="'.$option['onclick'].'" title="'.$option['title'].'"><i class="icon-'.(isset($option['icon']) && $option['icon'] ? $option['icon']:'cog' ).'"></i> '.$option['text'].'</a>';
|
||||||
|
$return[] = $html;
|
||||||
|
}
|
||||||
elseif ($output_type == 'select')
|
elseif ($output_type == 'select')
|
||||||
$return .= '<option id="'.$option_name.'" data-href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" data-onclick="'.$option['onclick'].'">'.$option['text'].'</option>';
|
$return .= '<option id="'.$option_name.'" data-href="'.$option['href'].(!is_null($back) ? '&back='.urlencode($back) : '').'" data-onclick="'.$option['onclick'].'">'.$option['text'].'</option>';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1083,7 +1083,7 @@ class AdminModulesControllerCore extends AdminController
|
|||||||
unset($modules[$km]);
|
unset($modules[$km]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->fillModuleData($module);
|
$this->fillModuleData($module, 'array');
|
||||||
$module->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
$module->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']);
|
||||||
|
|
||||||
if (isset($modules_preferences[$modules[$km]->name]))
|
if (isset($modules_preferences[$modules[$km]->name]))
|
||||||
|
|||||||
Reference in new issue
Block a user