} exit(); } if ($action == 'rename') { if ( $confirm == '1') { $new_filename = "{$_POST['workpath']}/{$_POST['new_filename']}"; $old_filename = "{$_POST['workpath']}/{$_POST['old_filename']}"; //safemodeon($_POST['workpath'], '', $_POST['new_filename'], 'renamed'); filecheck($_POST['workpath'], '', $_POST['new_filename'], ''); fileexists($_POST['workpath'], $new_filename,'', 'File'); folderwrite($_POST['workpath'], '','', 'rename'); filewrite($_POST['workpath'], '$new_filename','', 'rename'); renameit($_POST['workpath'], $old_filename, $new_filename, 'File'); redirect_header("javascript:history.go(-1)",1,"Unknown Error: File not renamed!"); exit(); } else { include XOOPS_ROOT_PATH."/class/xoopsformloader.php"; xoops_cp_header(); $sform = new XoopsThemeForm("Rename File", "op", "filemanager.php?action=rename&confirm=1"); $sform->addElement(new XoopsFormLabel(_AM_CURRENTFILENAME, basename($file))); $sform->addElement(new XoopsFormText("Rename File: ", 'new_filename', 30, 80, basename($file)), false); $sform->addElement(new XoopsFormHidden('old_filename', basename(htmlentities($file)))); $sform->addElement(new XoopsFormHidden('workpath', $_GET['workpath'])); $button_tray = new XoopsFormElementTray('',''); $button_tray->addElement(new XoopsFormButton('', 'save', "Rename", 'submit')); $sform->addElement($button_tray); $sform->display();
$sform->addElement($button_tray); $sform->display(); xoops_cp_footer(); } exit; } if ($action == 'rename') { if ($confirm == '1') { $new_filename = "{$HTTP_POST_VARS['workpath']}/{$HTTP_POST_VARS['new_filename']}"; $old_filename = "{$HTTP_POST_VARS['workpath']}/{$HTTP_POST_VARS['old_filename']}"; //safemodeon($HTTP_POST_VARS['workpath'], '', $HTTP_POST_VARS['new_filename'], 'renamed'); filecheck($HTTP_POST_VARS['workpath'], '', $HTTP_POST_VARS['new_filename'], ''); fileexists($HTTP_POST_VARS['workpath'], $new_filename, '', 'File'); folderwrite($HTTP_POST_VARS['workpath'], '', '', 'rename'); filewrite($HTTP_POST_VARS['workpath'], '$new_filename', '', 'rename'); renameit($HTTP_POST_VARS['workpath'], $old_filename, $new_filename, 'File'); redirect_header("javascript:history.go(-1)", 1, "Unknown Error: File not renamed!"); exit; } else { include XOOPS_ROOT_PATH . "/class/xoopsformloader.php"; xoops_cp_header(); $sform = new XoopsThemeForm("Rename File", "op", "filemanager.php?action=rename&confirm=1"); $sform->addElement(new XoopsFormLabel(_AM_CURRENTFILENAME, basename($file))); $sform->addElement(new XoopsFormText("Rename File: ", 'new_filename', 30, 80, basename($file)), false); $sform->addElement(new XoopsFormHidden('old_filename', basename(htmlentities($file)))); $sform->addElement(new XoopsFormHidden('workpath', $_GET['workpath'])); $button_tray = new XoopsFormElementTray('', ''); $button_tray->addElement(new XoopsFormButton('', 'save', "Rename", 'submit')); $sform->addElement($button_tray); $sform->display(); xoops_cp_footer();