当前位置: 首页>>代码示例>>PHP>>正文


PHP repository::update_draftfile方法代码示例

本文整理汇总了PHP中repository::update_draftfile方法的典型用法代码示例。如果您正苦于以下问题:PHP repository::update_draftfile方法的具体用法?PHP repository::update_draftfile怎么用?PHP repository::update_draftfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在repository的用法示例。


在下文中一共展示了repository::update_draftfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: zip_packer

     break;
 case 'unzip':
     $zipper = new zip_packer();
     $file = $fs->get_file($user_context->id, 'user', 'draft', $itemid, $draftpath, $filename);
     if ($newfile = $file->extract_to_storage($zipper, $user_context->id, 'user', 'draft', $itemid, $draftpath, $USER->id)) {
         $str = get_string('unzipped', 'repository');
     } else {
         $str = get_string('cannotunzip', 'error');
     }
     $home_url->param('action', 'browse');
     $home_url->param('draftpath', $draftpath);
     redirect($home_url, $str);
     break;
 case 'movefile':
     if (!empty($targetpath)) {
         repository::update_draftfile($itemid, $draftpath, $filename, array('filepath' => $targetpath));
         $home_url->param('action', 'browse');
         $home_url->param('draftpath', $targetpath);
         redirect($home_url);
     }
     echo $OUTPUT->header();
     echo $OUTPUT->container_start();
     echo html_writer::link($home_url, get_string('back', 'repository'));
     echo $OUTPUT->container_end();
     $data = new stdClass();
     $home_url->param('action', 'movefile');
     $home_url->param('draftpath', $draftpath);
     $home_url->param('filename', $filename);
     file_get_drafarea_folders($itemid, '/', $data);
     print_draft_area_tree($data, true, $home_url);
     echo $OUTPUT->footer();
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:31,代码来源:draftfiles_manager.php

示例2: catch

            $updatedata['author'] = $v;
        }
        try {
            repository::update_draftfile($draftid, $filepath, $filename, $updatedata);
        } catch (moodle_exception $e) {
            die(json_encode((object)array('error' => $e->getMessage())));
        }
        die(json_encode((object)array('filepath' => $newfilepath)));

    case 'updatedir':
        $filepath = required_param('filepath', PARAM_PATH);
        $newdirname = required_param('newdirname', PARAM_FILE);
        $parent = required_param('newfilepath', PARAM_PATH);
        $newfilepath = clean_param($parent . '/' . $newdirname . '/', PARAM_PATH);
        try {
            repository::update_draftfile($draftid, $filepath, '.', array('filepath' => $newfilepath));
        } catch (moodle_exception $e) {
            die(json_encode((object)array('error' => $e->getMessage())));
        }
        die(json_encode((object)array('filepath' => $parent)));

    case 'zip':
        $filepath = required_param('filepath', PARAM_PATH);

        $zipper = get_file_packer('application/zip');
        $fs = get_file_storage();

        $file = $fs->get_file($user_context->id, 'user', 'draft', $draftid, $filepath, '.');

        $parent_path = $file->get_parent_directory()->get_filepath();
开发者ID:ncsu-delta,项目名称:moodle,代码行数:30,代码来源:draftfiles_ajax.php


注:本文中的repository::update_draftfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。