当前位置: 首页>>代码示例>>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;未经允许,请勿转载。