$scriptid = get_request('scriptid', 0); $result &= delete_script($scriptid); if ($result) { add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']'); } show_messages($result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT); if ($result) { unset($_REQUEST['form']); unset($_REQUEST['scriptid']); } } else { if ($_REQUEST['go'] == 'delete' && isset($_REQUEST['scripts'])) { $scripts = $_REQUEST['scripts']; $result = true; foreach ($scripts as $scriptid) { $result &= delete_script($scriptid); if ($result) { add_audit(AUDIT_ACTION_DELETE, AUDIT_RESOURCE_SCRIPT, S_SCRIPT . ' [' . $scriptid . ']'); } } show_messages($result, S_SCRIPT_DELETED, S_CANNOT_DELETE_SCRIPT); if ($result) { unset($_REQUEST['form']); unset($_REQUEST['scriptid']); } } } } } $row_count = 0; if (isset($_REQUEST['form'])) {
function main() { global $code, $scripts, $current, $doupdate, $output, $donew; global $dodelete, $newname, $dorename; # Create a new tab if needed if (isset($donew)) { create_new_tab(); } # Remove the current script if needed if (isset($current) && isset($dodelete)) { delete_script($current); $current = ""; } # Rename the current script if needed if (isset($current) && isset($dorename) && isset($newname)) { if (rename_script($current, $newname) == 0) { $current = $newname; } } # Get the list of scripts, create a default one if none exists. $scripts = get_script_list(); if (count($scripts) == 0) { create_default_script(); $scripts = get_script_list(); } # No current set? use the last script available. if (!isset($current) || $current == "") { $current = $scripts[count($scripts) - 1]; } # No output mode selected? Our default is html. if (!isset($output)) { $output = "html"; } # No code? Set it to the default script. if (!isset($code)) { $code = comp_file_get_contents("defaultscript.txt"); } else { $code = stripslashes($code); } # Do the update if needed if (isset($doupdate)) { save_script($current, $code); } else { $code = load_script($current); } }
?> "> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <link rel="shortcut icon" href="themes/<?php echo sz_config('theme'); ?> /images/favicon.ico"/> <link href="themes/<?php echo sz_config('theme'); ?> /style.css" rel="stylesheet" type="text/css" /> <?php echo site_help(); ?> <?php echo delete_script(); ?> <?php echo sort_script(); ?> </head> <body> <div id="sz_menu" > <?php sz_menu(); ?> </div> <br><br><br> <div id="main" > <div id="wrapper" class="clearfix" > <div id="header" >
function update_script($par) { if (isset($par['code']) && delete_script($par['code'])) { add_script($par); } }