1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | include_once(AUTOUPDATE_PATH.'include/autoupdate.class.php'); |
---|
6 | $autoupdate = new autoupdate(); |
---|
7 | |
---|
8 | if (!$autoupdate->get_server_extensions()) |
---|
9 | { |
---|
10 | array_push($page['errors'], l10n('Can\'t connect to server.')); |
---|
11 | return; |
---|
12 | } |
---|
13 | |
---|
14 | foreach ($autoupdate->types as $type) |
---|
15 | { |
---|
16 | $fs = 'fs_'.$type; |
---|
17 | $server = 'server_'.$type; |
---|
18 | $server_ext = $autoupdate->$type->$server; |
---|
19 | $fs_ext = $autoupdate->$type->$fs; |
---|
20 | |
---|
21 | if (!empty($server_ext)) |
---|
22 | { |
---|
23 | foreach($fs_ext as $ext_id => $fs_ext) |
---|
24 | { |
---|
25 | if (isset($fs_ext['extension']) and isset($server_ext[$fs_ext['extension']])) |
---|
26 | { |
---|
27 | $ext_info = $server_ext[$fs_ext['extension']]; |
---|
28 | |
---|
29 | if (!$autoupdate->version_compare($fs_ext['version'], $ext_info['revision_name'], $type)) |
---|
30 | { |
---|
31 | $template->append('update_'.$type, array( |
---|
32 | 'ID' => $ext_info['extension_id'], |
---|
33 | 'REVISION_ID' => $ext_info['revision_id'], |
---|
34 | 'EXT_ID' => $ext_id, |
---|
35 | 'EXT_NAME' => $fs_ext['name'], |
---|
36 | 'EXT_URL' => PEM_URL.'/extension_view.php?eid='.$ext_info['extension_id'], |
---|
37 | 'EXT_DESC' => trim($ext_info['extension_description'], " \n\r"), |
---|
38 | 'REV_DESC' => trim($ext_info['revision_description'], " \n\r"), |
---|
39 | 'CURRENT_VERSION' => $fs_ext['version'], |
---|
40 | 'NEW_VERSION' => $ext_info['revision_name'], |
---|
41 | 'AUTHOR' => $ext_info['author_name'], |
---|
42 | 'DOWNLOADS' => $ext_info['extension_nb_downloads'], |
---|
43 | 'URL_DOWNLOAD' => $ext_info['download_url'] . '&origin=piwigo_download', |
---|
44 | 'IGNORED' => in_array($ext_id, $conf['AU_ignore'][$type]), |
---|
45 | ) |
---|
46 | ); |
---|
47 | } |
---|
48 | } |
---|
49 | } |
---|
50 | } |
---|
51 | } |
---|
52 | |
---|
53 | $template->assign('SHOW_RESET', (!empty($conf['AU_ignore']['plugins']) or !empty($conf['AU_ignore']['themes']) or !empty($conf['AU_ignore']['languages']))); |
---|
54 | $template->assign('PWG_TOKEN', get_pwg_token()); |
---|
55 | $template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/update_ext.tpl')); |
---|
56 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
57 | |
---|
58 | ?> |
---|