1 | <?php |
---|
2 | |
---|
3 | load_language('plugin.lang', dirname(__FILE__).'/'); |
---|
4 | |
---|
5 | function autoupdate_plugins_update_filter($content, &$smarty) |
---|
6 | { |
---|
7 | $search = '<a href="{$plugin.URL_DOWNLOAD}">{\'plugins_download\'|@translate}</a>'; |
---|
8 | $replacement = ' <a href="{$plugin.URL_DOWNLOAD}">{\'plugins_download\'|@translate}</a><br> |
---|
9 | <a href="#" onClick="autoupdate_ignore(\'{$plugin.EXT_NAME}\', true, {$smarty.foreach.plugins_loop.index}); return false;" id="au_ignore_{$smarty.foreach.plugins_loop.index}_true" {if $plugin.EXT_NAME|@in_array:$AU_IGNORE_LIST}style="display: none;"{/if}>{\'Don\\\'t notify on admin homepage\'|@translate}</a> |
---|
10 | <a href="#" onClick="autoupdate_ignore(\'{$plugin.EXT_NAME}\', false, {$smarty.foreach.plugins_loop.index}); return false;" id="au_ignore_{$smarty.foreach.plugins_loop.index}_false" {if !$plugin.EXT_NAME|@in_array:$AU_IGNORE_LIST}style="display: none;"{/if}>{\'Notify on admin homepage\'|@translate}</a>'; |
---|
11 | |
---|
12 | return str_replace($search, $replacement, $content);; |
---|
13 | } |
---|
14 | |
---|
15 | $script_head = ' |
---|
16 | <script type="text/javascript"> |
---|
17 | function autoupdate_ignore(name, bool, id) { |
---|
18 | jQuery.post( |
---|
19 | "'.PHPWG_ROOT_PATH.'plugins/autoupdate/remote.php", |
---|
20 | { "autoupdate_ignore[]": [name, bool] }, |
---|
21 | function(data) { |
---|
22 | if (data == "ok") { |
---|
23 | jQuery("#au_ignore_"+id+"_"+bool).hide(); |
---|
24 | jQuery("#au_ignore_"+id+"_"+!bool).show(); |
---|
25 | } |
---|
26 | } |
---|
27 | ); |
---|
28 | } |
---|
29 | </script> |
---|
30 | '; |
---|
31 | |
---|
32 | //$template->delete_compiled_templates(); |
---|
33 | $template->block_html_head('', $script_head, $smarty, $repeat); |
---|
34 | $template->set_prefilter('plugins', 'autoupdate_plugins_update_filter'); |
---|
35 | $template->assign('AU_IGNORE_LIST', unserialize($conf['autoupdate_ignore_list'])); |
---|
36 | |
---|
37 | ?> |
---|