Пример #1
0
	        $sform->addElement($button_tray);
			$sform->display();
			xoops_cp_footer();	
    	exit();

	}else{
			redirect_header("$urlpath",1, "No File to Edit" );
			exit();
		}	
	}
}

if ($action == 'delete') {
	if ( $confirm ) {
    	if (is_dir($_POST['file'])) {
			if (!killdir($_POST['file'])) {
				if ((is_dir($_POST['file'])) && dirsize($_POST['file']) > 0) {
					redirect_header("$urlpath?rootpath=".$_POST['workpath']."",1,"Cannot delete, Folder not empty!");
				} elseif (is_dir($_POST['file']) && !is_writable($_POST['file'])) {
					redirect_header("$urlpath?rootpath=".$_POST['workpath']."",1,"Cannot delete, is not writable!");
				} else {
					redirect_header("$urlpath?rootpath=".$_POST['workpath']."",1,"Unknown error, not deleted!");
				}
			} else {
				redirect_header("$urlpath?rootpath=".$_POST['workpath']."",1,"Folder Deleted");
			}
		} else {
						
			if (!@unlink($_POST['file'])) {
				if (is_file($_POST['file']) && !is_writable($_POST['file'])) {
					redirect_header("$urlpath?rootpath=".$_POST['workpath']."",1,"Cannot delete, is not writable!");
Пример #2
0
            $button_tray = new XoopsFormElementTray('', '');
            $button_tray->addElement(new XoopsFormButton('', 'save', _AM_SAVECHANGE, 'submit'));
            $sform->addElement($button_tray);
            $sform->display();
            xoops_cp_footer();
            exit;
        } else {
            redirect_header("{$urlpath}", 1, "No File to Edit");
            exit;
        }
    }
}
if ($action == 'delete') {
    if ($confirm) {
        if (is_dir($HTTP_POST_VARS['file'])) {
            if (!killdir($HTTP_POST_VARS['file'])) {
                if (is_dir($HTTP_POST_VARS['file']) && dirsize($HTTP_POST_VARS['file']) > 0) {
                    redirect_header("{$urlpath}?rootpath=" . $HTTP_POST_VARS['workpath'] . "", 1, "Cannot delete, Folder not empty!");
                } elseif (is_dir($HTTP_POST_VARS['file']) && !is_writable($HTTP_POST_VARS['file'])) {
                    redirect_header("{$urlpath}?rootpath=" . $HTTP_POST_VARS['workpath'] . "", 1, "Cannot delete, is not writable!");
                } else {
                    redirect_header("{$urlpath}?rootpath=" . $HTTP_POST_VARS['workpath'] . "", 1, "Unknown error, not deleted!");
                }
            } else {
                redirect_header("{$urlpath}?rootpath=" . $HTTP_POST_VARS['workpath'] . "", 1, "Folder Deleted");
            }
        } else {
            if (!@unlink($HTTP_POST_VARS['file'])) {
                if (is_file($HTTP_POST_VARS['file']) && !is_writable($HTTP_POST_VARS['file'])) {
                    redirect_header("{$urlpath}?rootpath=" . $HTTP_POST_VARS['workpath'] . "", 1, "Cannot delete, is not writable!");
                } else {