[9707] | 1 | <?php |
---|
| 2 | |
---|
| 3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 4 | |
---|
[9729] | 5 | include_once(AUTOUPDATE_PATH.'include/autoupdate.class.php'); |
---|
| 6 | $autoupdate = new autoupdate(); |
---|
| 7 | |
---|
| 8 | if (!$autoupdate->get_server_extensions()) |
---|
[9707] | 9 | { |
---|
[9729] | 10 | array_push($page['errors'], l10n('Can\'t connect to server.')); |
---|
| 11 | return; |
---|
[9707] | 12 | } |
---|
| 13 | |
---|
[9729] | 14 | foreach ($autoupdate->types as $type) |
---|
[9707] | 15 | { |
---|
[9729] | 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)) |
---|
[9707] | 22 | { |
---|
[9729] | 23 | foreach($fs_ext as $ext_id => $fs_ext) |
---|
[9707] | 24 | { |
---|
[9729] | 25 | if (isset($fs_ext['extension']) and isset($server_ext[$fs_ext['extension']])) |
---|
[9707] | 26 | { |
---|
[9729] | 27 | $ext_info = $server_ext[$fs_ext['extension']]; |
---|
[9707] | 28 | |
---|
[9729] | 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', |
---|
[9730] | 44 | 'IGNORED' => in_array($ext_id, $conf['AU_ignore'][$type]), |
---|
[9729] | 45 | ) |
---|
| 46 | ); |
---|
| 47 | } |
---|
[9707] | 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']))); |
---|
[9723] | 54 | $template->assign('PWG_TOKEN', get_pwg_token()); |
---|
[9712] | 55 | $template->set_filename('plugin_admin_content', realpath(AUTOUPDATE_PATH.'template/update_ext.tpl')); |
---|
[9707] | 56 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
| 57 | |
---|
| 58 | ?> |
---|