diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index b0bc45df2..d920b668b 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -321,6 +321,46 @@ catch(e){} return false; }); + + $('.toggle_favorite').live('click', function(event) + { + var el = $(this); + var value_pref = el.data('value'); + var module_pref = el.data('module'); + var action_pref = 'f'; + try + { + resAjax = $.ajax({ + type:"POST", + url : ajaxCurrentIndex, + async: true, + data : { + ajax : "1", + token : token, + controller : "AdminModules", + action : "saveFavoritePreferences", + action_pref : action_pref, + module_pref : module_pref, + value_pref : value_pref + }, + success : function(data) + { + // res.status = cache or refresh + if (data == 'OK') + { + el.parent('div').find('.toggle_favorite').toggle(); + } + + }, + error: function(res,textStatus,jqXHR) + { + //jAlert("TECHNICAL ERROR"+res); + } + }); + } + catch(e){} + return false; + }); }); {/literal} diff --git a/admin-dev/themes/default/template/controllers/modules/list.tpl b/admin-dev/themes/default/template/controllers/modules/list.tpl index ff01f4620..aaee81658 100644 --- a/admin-dev/themes/default/template/controllers/modules/list.tpl +++ b/admin-dev/themes/default/template/controllers/modules/list.tpl @@ -79,7 +79,18 @@

{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}

{if isset($module->message)}
{$module->message}
{/if}
- {if !isset($module->not_on_disk)}{$module->optionsHtml}{else} {/if} + {if !isset($module->not_on_disk)} + {$module->optionsHtml} + {if isset($module->preferences) && $module->preferences['favorite'] == 1} + {l s='Remove from Favorites'} + + {else} + + {l s='Mark as Favorite'} + {/if} + {else} +   + {/if}