foreach ($udata as $pkg => $f) { if (!empty($f['not_installed'])) { continue; } $details = array(); if (file_exists(Registry::get('config.dir.upgrade') . $pkg . '/package_details.php')) { $details = (include Registry::get('config.dir.upgrade') . $pkg . '/package_details.php'); } $packages[$pkg] = array('details' => $details, 'files' => $f['files']); } if (empty($packages)) { return array(CONTROLLER_STATUS_REDIRECT, "upgrade_center.manage"); } Registry::get('view')->assign('packages', $packages); } elseif ($mode == 'diff') { Registry::get('view')->assign('diff', fn_text_diff(fn_get_contents(Registry::get('config.dir.upgrade') . $_REQUEST['package'] . '/backup/' . $_REQUEST['file']), fn_get_contents(Registry::get('config.dir.root') . '/' . $_REQUEST['file']))); } elseif ($mode == 'conflicts') { if (is_file(Registry::get('config.dir.upgrade') . 'installed_upgrades.php')) { include Registry::get('config.dir.upgrade') . 'installed_upgrades.php'; if (isset($udata[$_REQUEST['package']]['files'][$_REQUEST['file']])) { $udata[$_REQUEST['package']]['files'][$_REQUEST['file']] = $action == 'mark' ? true : false; fn_uc_update_installed_upgrades($udata); } } else { fn_set_notification('W', __('warning'), __('text_uc_list_of_updates_missing')); } return array(CONTROLLER_STATUS_OK, "upgrade_center.installed_upgrades"); } elseif ($mode == 'remove') { if (!empty($_REQUEST['package'])) { if (is_file(Registry::get('config.dir.upgrade') . 'installed_upgrades.php')) { include Registry::get('config.dir.upgrade') . 'installed_upgrades.php';
$packages = array(); foreach ($udata as $pkg => $f) { $details = array(); if (file_exists(DIR_UPGRADE . $pkg . '/package_details.php')) { $details = (include DIR_UPGRADE . $pkg . '/package_details.php'); } $packages[$pkg] = array('details' => $details, 'files' => $f['files']); } if (empty($packages)) { return array(CONTROLLER_STATUS_REDIRECT, "upgrade_center.manage"); } $view->assign('packages', $packages); } elseif ($mode == 'diff') { fn_add_breadcrumb(fn_get_lang_var('upgrade_center'), "upgrade_center.manage"); fn_add_breadcrumb(fn_get_lang_var('installed_upgrades'), "upgrade_center.installed_upgrades"); $view->assign('diff', fn_text_diff(fn_get_contents(DIR_UPGRADE . $_REQUEST['package'] . '/backup/' . $_REQUEST['file']), fn_get_contents(DIR_ROOT . '/' . $_REQUEST['file']))); } elseif ($mode == 'conflicts') { if (file_exists(DIR_UPGRADE . 'installed_upgrades.php')) { include DIR_UPGRADE . 'installed_upgrades.php'; if (isset($udata[$_REQUEST['package']]['files'][$_REQUEST['file']])) { $udata[$_REQUEST['package']]['files'][$_REQUEST['file']] = $action == 'mark' ? true : false; fn_uc_update_installed_upgrades($udata); } } return array(CONTROLLER_STATUS_OK, "upgrade_center.installed_upgrades"); } elseif ($mode == 'remove') { if (!empty($_REQUEST['package'])) { $dirs = fn_get_dir_contents(DIR_UPGRADE, true, false); $delete_dirs = array(); preg_match_all("/(\\d+)\\.(\\d+)\\.(\\d+)\\.tgz\$/", $_REQUEST['package'], $v); $c_ver_int = $v[1][0] * 10000 + $v[2][0] * 1000 + $v[3][0];