$output = ""; $output_sales_notice = ""; $output_sales_error = ""; $act = $_GET['act']; if ($user['usertype'] == "manager") { if (!empty($act) && $act == "addonoff" && !empty($addon) && $tables[$addon] != "system") { setConf("addons", $addon . "_active", "no", 1); $output = notice($shop_lang['addons_off_ok'], 'success'); } } return $output; } $anotice = ""; $addon = _filter($_GET['addon'], 1); switch ($_GET['act']) { case 'addoninstall': $anotice .= install_addon($addon); break; case 'addonuninstall': $anotice .= uninstall_addon($addon); break; case 'addonon': $anotice .= on_addon($addon); break; case 'addonoff': $anotice .= off_addon($addon); break; } ?>
/** * The actualiser to install an addon. * * @return tempcode The UI */ function _addon_install() { $title = get_page_title('INSTALL_ADDON'); require_code('abstract_file_manager'); force_have_afm_details(); $file = filter_naughty(post_param('file')); $theme = mixed(); $files = array(); foreach (array_keys($_POST) as $key) { if (substr($key, 0, 5) == 'file_') { $value = post_param($key); $files[] = $value; $matches = array(); if (preg_match('#^themes/([^/]+)/#', $value, $matches) != 0) { $theme = $matches[1]; } } } install_addon($file, $files); // Show it worked / Refresh if (!is_null($theme) && $theme != 'default') { $url = build_url(array('page' => 'admin_themes', 'type' => 'edit_theme', 'theme' => $theme), 'adminzone'); return redirect_screen($title, $url, do_lang_tempcode('INSTALL_THEME_SUCCESS')); } $url = build_url(array('page' => '_SELF', 'type' => 'misc'), '_SELF'); return redirect_screen($title, $url, do_lang_tempcode('SUCCESS')); }