Changeset 2243 for trunk/admin/plugins_update.php
- Timestamp:
- Mar 2, 2008, 7:56:05 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/plugins_update.php
r2242 r2243 35 35 if (isset($_GET['upgrade']) and isset($_GET['plugin']) and !is_adviser()) 36 36 { 37 37 include(PHPWG_ROOT_PATH.'admin/include/pclzip.lib.php'); 38 38 39 40 41 39 $upgrade_status = extract_plugin_files('upgrade', 40 $_GET['upgrade'], 41 $_GET['plugin']); 42 42 43 43 $my_base_url .= isset($_GET['reactivate']) ? '&action=activate' : ''; 44 44 45 45 redirect($my_base_url.'&plugin='.$_GET['plugin'].'&upgradestatus='.$upgrade_status); 46 46 } 47 47 … … 50 50 if (isset($_GET['upgradestatus']) and isset($_GET['plugin'])) 51 51 { 52 53 54 55 52 switch ($_GET['upgradestatus']) 53 { 54 case 'ok': 55 array_push($page['infos'], 56 56 sprintf(l10n('plugins_upgrade_ok'), 57 57 $fs_plugins[$_GET['plugin']]['name'])); 58 58 break; 59 59 60 61 array_push($page['errors'], l10n('plugins_temp_path_error')); 62 63 64 65 array_push($page['errors'], l10n('plugins_dl_archive_error')); 66 60 case 'temp_path_error': 61 array_push($page['errors'], l10n('plugins_temp_path_error')); 62 break; 63 64 case 'dl_archive_error': 65 array_push($page['errors'], l10n('plugins_dl_archive_error')); 66 break; 67 67 68 69 array_push($page['errors'], l10n('plugins_archive_error')); 70 68 case 'archive_error': 69 array_push($page['errors'], l10n('plugins_archive_error')); 70 break; 71 71 72 73 72 default: 73 array_push($page['errors'], 74 74 sprintf(l10n('plugins_extract_error'), 75 $_GET['upgradestatus'])); 76 75 $_GET['upgradestatus'])); 76 } 77 77 } 78 78 … … 85 85 if ($plugins_infos !== false) 86 86 { 87 88 89 87 foreach($fs_plugins as $plugin_id => $fs_plugin) 88 { 89 if (isset($fs_plugin['extension']) 90 90 and isset($plugins_infos[$fs_plugin['extension']])) 91 92 93 94 91 { 92 $plugin_info = $plugins_infos[$fs_plugin['extension']]; 93 94 $ext_desc = nl2br(htmlspecialchars(strip_tags( 95 95 utf8_encode($plugin_info['ext_description'])))); 96 97 98 99 100 96 97 $ver_desc = sprintf(l10n('plugins_description'), 98 $plugin_info['version'], 99 date('Y-m-d', $plugin_info['date']), 100 nl2br(htmlspecialchars(strip_tags( 101 101 utf8_encode($plugin_info['description']))))); 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 102 103 if ($plugin_info['version'] == $fs_plugin['version']) 104 { 105 // Plugin is up to date 106 $template->append('plugins_uptodate', 107 array('URL' => $fs_plugin['uri'], 108 'NAME' => $fs_plugin['name'], 109 'EXT_DESC' => $ext_desc, 110 'VERSION' => $fs_plugin['version'], 111 'VER_DESC' => $ver_desc)); 112 } 113 else 114 { 115 // Plugin need upgrade 116 $url_auto_update = htmlentities($my_base_url) 117 . '&plugin=' . $plugin_id 118 . ( 119 119 (isset($db_plugins_by_id[$plugin_id]) 120 120 and $db_plugins_by_id[$plugin_id]['state'] == 'active' … … 122 122 '&action=deactivate' : '' 123 123 ) 124 125 124 . '&upgrade=%2Fupload%2Fextension-' . $fs_plugin['extension'] 125 . '%2Frevision-' . $plugin_info['id_revision'] 126 126 . '%2F' . $plugin_info['url']; 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 127 128 $url_download = PEM_URL.'/upload/extension-'. $fs_plugin['extension'] 129 . '/revision-' . $plugin_info['id_revision'] 130 . '/' . $plugin_info['url']; 131 132 $template->append('plugins_not_uptodate', 133 array('EXT_NAME' => $fs_plugin['name'], 134 'EXT_URL' => $fs_plugin['uri'], 135 'EXT_DESC' => $ext_desc, 136 'VERSION' => $fs_plugin['version'], 137 'VERSION_URL' => PEM_URL.'/revision_view.php?rid='.$plugin_info['id_revision'], 138 'NEW_VERSION' => $plugin_info['version'], 139 'NEW_VER_DESC' => $ver_desc, 140 'URL_UPDATE' => $url_auto_update, 141 'URL_DOWNLOAD' => $url_download)); 142 } 143 } 144 else 145 { 146 // Can't check plugin 147 $template->append('plugins_cant_check', 148 array('NAME' => $fs_plugin['name'], 149 'VERSION' => $fs_plugin['version'])); 150 } 151 } 152 152 } 153 153 else 154 154 { 155 155 array_push($page['errors'], l10n('plugins_server_error')); 156 156 } 157 157
Note: See TracChangeset
for help on using the changeset viewer.