當前位置: 首頁>>代碼示例>>PHP>>正文


PHP upload_manager::delete_other_files方法代碼示例

本文整理匯總了PHP中upload_manager::delete_other_files方法的典型用法代碼示例。如果您正苦於以下問題:PHP upload_manager::delete_other_files方法的具體用法?PHP upload_manager::delete_other_files怎麽用?PHP upload_manager::delete_other_files使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在upload_manager的用法示例。


在下文中一共展示了upload_manager::delete_other_files方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: wiki_upload_deldir

function wiki_upload_deldir(&$WS)
{
    //cheack if the folder exists
    if (file_exists($WS->dfdir->name)) {
        //delete all folder files
        $upd = new upload_manager();
        $upd->delete_other_files($WS->dfdir->name);
        rmdir($WS->dfdir->name);
        return true;
    } else {
        return true;
    }
}
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:13,代碼來源:uploadlib.php

示例2: notify

    } else {
        // Process the resubmission
        $dir = $assignmentinstance->file_area_name($userid);
        require_once $CFG->dirroot . '/lib/uploadlib.php';
        $um = new upload_manager('newfile', true, false, $assignmentinstance->course, false, $assignmentinstance->assignment->maxbytes);
        if ($um->preprocess_files()) {
            //Check the file extension
            $submittedFilename = $um->get_original_filename();
            $extension = $assignmentinstance->assignment->fileextension;
            if (strtolower(substr($submittedFilename, strlen($submittedFilename) - strlen($extension))) != $extension) {
                notify(get_string("incorrectfileextension", "assignment_peerreview", $extension));
            } else {
                if ($um->save_files($dir)) {
                    $newfile_name = $um->get_new_filename();
                    $um->config->silent = true;
                    $um->delete_other_files($dir, $dir . '/' . $newfile_name);
                    $submission = $assignmentinstance->get_submission($userid);
                    if (set_field('assignment_submissions', 'timemodified', time(), 'id', $submission->id)) {
                        add_to_log($assignmentinstance->course->id, 'assignment', 'upload', 'view.php?a=' . $assignmentinstance->assignment->id, $assignmentinstance->assignment->id, $assignmentinstance->cm->id);
                        notify(get_string('resubmissionsuccessful', 'assignment_peerreview'), 'notifysuccess');
                    } else {
                        notify(get_string("uploadnotregistered", "assignment", $newfile_name));
                    }
                }
            }
        }
    }
    print_continue($CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $assignmentinstance->cm->id);
} else {
    if (isset($assignmentinstance->assignment->var3) && $assignmentinstance->assignment->var3 == assignment_peerreview::ONLINE_TEXT) {
        notify(get_string("resubmissionwarning", "assignment_peerreview"));
開發者ID:hmatulis,項目名稱:RTL-BIDI-Hebrew-Moodle-Plugins,代碼行數:31,代碼來源:resubmit.php


注:本文中的upload_manager::delete_other_files方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。