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


PHP backup_userdata_selected函数代码示例

本文整理汇总了PHP中backup_userdata_selected函数的典型用法代码示例。如果您正苦于以下问题:PHP backup_userdata_selected函数的具体用法?PHP backup_userdata_selected怎么用?PHP backup_userdata_selected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: podcast_backup_one_mod

    return $status;
}
function podcast_backup_one_mod($bf, $preferences, $podcast)
{
    global $CFG;
    if (is_numeric($podcast)) {
        $podcast = get_record('podcast', 'id', $podcast);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 7, true));
    //Print podcast data
    fwrite($bf, full_tag("ID", 8, false, $podcast->id));
    fwrite($bf, full_tag("MODTYPE", 8, false, "podcast"));
    fwrite($bf, full_tag("USERID", 8, false, $podcast->userid));
    fwrite($bf, full_tag("NAME", 8, false, $podcast->name));
    fwrite($bf, full_tag("AUTHOR", 8, false, $podcast->author));
    fwrite($bf, full_tag("INTRO", 8, false, $podcast->intro));
    fwrite($bf, full_tag("OWNER", 8, false, $podcast->owner));
    fwrite($bf, full_tag("OWNER_EMAIL", 8, false, $podcast->owner_email));
    fwrite($bf, full_tag("COPYRIGHT", 8, false, $podcast->copyright));
    fwrite($bf, full_tag("LANG", 8, false, $podcast->lang));
    fwrite($bf, full_tag("PUBDATE", 8, false, $podcast->pubdate));
    fwrite($bf, full_tag("IMAGE_URL", 8, false, $podcast->image_url));
    fwrite($bf, full_tag("IMAGE_IMG", 8, false, $podcast->image_img));
    fwrite($bf, full_tag("CATEGORY", 8, false, $podcast->category));
    fwrite($bf, full_tag("TIMEMODIFIED", 8, false, $podcast->timemodified));
    //if we've selected to backup users info, then execute backup_podcast_items
    if (backup_userdata_selected($preferences, 'podcast', $podcast->id)) {
        $status = backup_podcast_items($bf, $preferences, $podcast->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 7, true));
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:33,代码来源:backuplib.php

示例2: imagegallery_backup_one_mod

function imagegallery_backup_one_mod($bf, $preferences, $imagegallery)
{
    global $CFG;
    if (is_numeric($imagegallery)) {
        $imagegallery = get_record('imagegallery', 'id', $imagegallery);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print imagegallery data
    fwrite($bf, full_tag("ID", 4, false, $imagegallery->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "imagegallery"));
    fwrite($bf, full_tag("NAME", 4, false, $imagegallery->name));
    fwrite($bf, full_tag("INTRO", 4, false, $imagegallery->intro));
    fwrite($bf, full_tag("MAXBYTES", 4, false, $imagegallery->maxbytes));
    fwrite($bf, full_tag("MAXWIDTH", 4, false, $imagegallery->maxwidth));
    fwrite($bf, full_tag("MAXHEIGHT", 4, false, $imagegallery->maxheight));
    fwrite($bf, full_tag("ALLOWSTUDENTUPLOAD", 4, false, $imagegallery->allowstudentupload));
    fwrite($bf, full_tag("IMAGESPERPAGE", 4, false, $imagegallery->imagesperpage));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $imagegallery->timemodified));
    fwrite($bf, full_tag("REQUIRELOGIN", 4, false, $imagegallery->requirelogin));
    fwrite($bf, full_tag("RESIZE", 4, false, $imagegallery->resize));
    fwrite($bf, full_tag("DEFAULTCATEGORY", 4, false, $imagegallery->defaultcategory));
    fwrite($bf, full_tag("SHADOW", 4, false, $imagegallery->shadow));
    //if we've selected to backup users info, then execute backup_imagegallery_categories
    if (backup_userdata_selected($preferences, 'imagegallery', $imagegallery->id)) {
        $status = backup_imagegallery_categories($bf, $preferences, $imagegallery->id);
    }
    if (backup_userdata_selected($preferences, 'imagegallery', $imagegallery->id)) {
        $status = backup_imagegallery_images($bf, $preferences, $imagegallery->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:35,代码来源:backuplib.php

示例3: journal_backup_one_mod

function journal_backup_one_mod($bf, $preferences, $journal)
{
    global $CFG;
    if (is_numeric($journal)) {
        $journal = get_record('journal', 'id', $journal);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print journal data
    fwrite($bf, full_tag("ID", 4, false, $journal->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "journal"));
    fwrite($bf, full_tag("NAME", 4, false, $journal->name));
    fwrite($bf, full_tag("INTRO", 4, false, $journal->intro));
    fwrite($bf, full_tag("INTROFORMAT", 4, false, $journal->introformat));
    fwrite($bf, full_tag("DAYS", 4, false, $journal->days));
    fwrite($bf, full_tag("ASSESSED", 4, false, $journal->assessed));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $journal->timemodified));
    //if we've selected to backup users info, then execute backup_journal_entries
    if (backup_userdata_selected($preferences, 'journal', $journal->id)) {
        $status = backup_journal_entries($bf, $preferences, $journal->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:26,代码来源:backuplib.php

示例4: wiki_backup_one_mod

function wiki_backup_one_mod($bf, $preferences, $wiki)
{
    $status = true;
    if (is_numeric($wiki)) {
        $wiki = get_record('wiki', 'id', $wiki);
    }
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $wiki->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "wiki"));
    fwrite($bf, full_tag("NAME", 4, false, $wiki->name));
    fwrite($bf, full_tag("SUMMARY", 4, false, $wiki->summary));
    fwrite($bf, full_tag("PAGENAME", 4, false, $wiki->wtype));
    fwrite($bf, full_tag("WTYPE", 4, false, $wiki->wtype));
    fwrite($bf, full_tag("EWIKIPRINTTITLE", 4, false, $wiki->ewikiprinttitle));
    fwrite($bf, full_tag("HTMLMODE", 4, false, $wiki->htmlmode));
    fwrite($bf, full_tag("EWIKIACCEPTBINARY", 4, false, $wiki->ewikiacceptbinary));
    fwrite($bf, full_tag("DISABLECAMELCASE", 4, false, $wiki->disablecamelcase));
    fwrite($bf, full_tag("SETPAGEFLAGS", 4, false, $wiki->setpageflags));
    fwrite($bf, full_tag("STRIPPAGES", 4, false, $wiki->strippages));
    fwrite($bf, full_tag("REMOVEPAGES", 4, false, $wiki->removepages));
    fwrite($bf, full_tag("REVERTCHANGES", 4, false, $wiki->revertchanges));
    fwrite($bf, full_tag("INITIALCONTENT", 4, false, $wiki->initialcontent));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $wiki->timemodified));
    //backup entries and pages
    if (backup_userdata_selected($preferences, 'wiki', $wiki->id)) {
        $status = backup_wiki_entries($bf, $preferences, $wiki->id, $preferences->mods["wiki"]->userinfo);
        $status = backup_wiki_files_instance($bf, $preferences, $wiki->id);
    }
    //End mod
    fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:BackupTheBerlios,项目名称:samouk-svn,代码行数:34,代码来源:backuplib.php

示例5: nanogong_backup_one_mod

function nanogong_backup_one_mod($bf, $preferences, $nanogong)
{
    global $CFG;
    if (is_numeric($nanogong)) {
        $nanogong = get_record('nanogong', 'id', $nanogong);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print nanogong data
    fwrite($bf, full_tag("ID", 4, false, $nanogong->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "nanogong"));
    fwrite($bf, full_tag("NAME", 4, false, $nanogong->name));
    fwrite($bf, full_tag("MESSAGE", 4, false, $nanogong->message));
    fwrite($bf, full_tag("COLOR", 4, false, $nanogong->color));
    fwrite($bf, full_tag("MAXDURATION", 4, false, $nanogong->maxduration));
    fwrite($bf, full_tag("MAXMESSAGES", 4, false, $nanogong->maxmessages));
    fwrite($bf, full_tag("MAXSCORE", 4, false, $nanogong->maxscore));
    fwrite($bf, full_tag("ALLOWGUESTACCESS", 4, false, $nanogong->allowguestaccess));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $nanogong->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $nanogong->timemodified));
    //if we've selected to backup users info, then execute backup_nanogong_messages and
    //backup_nanogong_files_instance
    if (backup_userdata_selected($preferences, 'nanogong', $nanogong->id)) {
        $status = backup_nanogong_message($bf, $preferences, $nanogong->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:nagyistoce,项目名称:moodle-Teach-Pilot,代码行数:30,代码来源:backuplib.php

示例6: chat_backup_one_mod

function chat_backup_one_mod($bf, $preferences, $chat)
{
    global $CFG;
    if (is_numeric($chat)) {
        $chat = get_record('chat', 'id', $chat);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print chat data
    fwrite($bf, full_tag("ID", 4, false, $chat->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "chat"));
    fwrite($bf, full_tag("NAME", 4, false, $chat->name));
    fwrite($bf, full_tag("INTRO", 4, false, $chat->intro));
    fwrite($bf, full_tag("KEEPDAYS", 4, false, $chat->keepdays));
    fwrite($bf, full_tag("STUDENTLOGS", 4, false, $chat->studentlogs));
    fwrite($bf, full_tag("SCHEDULE", 4, false, $chat->schedule));
    fwrite($bf, full_tag("CHATTIME", 4, false, $chat->chattime));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $chat->timemodified));
    //if we've selected to backup users info, then execute backup_chat_messages
    if (backup_userdata_selected($preferences, 'chat', $chat->id)) {
        $status = backup_chat_messages($bf, $preferences, $chat->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:27,代码来源:backuplib.php

示例7: qcreate_backup_one_mod

function qcreate_backup_one_mod($bf, $preferences, $qcreate)
{
    if (is_numeric($qcreate)) {
        $qcreate = get_record('qcreate', 'id', $qcreate);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print qcreate data
    fwrite($bf, full_tag("ID", 4, false, $qcreate->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, 'qcreate'));
    fwrite($bf, full_tag("NAME", 4, false, $qcreate->name));
    fwrite($bf, full_tag("GRADE", 4, false, $qcreate->grade));
    fwrite($bf, full_tag("GRADERATIO", 4, false, $qcreate->graderatio));
    fwrite($bf, full_tag("INTRO", 4, false, $qcreate->intro));
    fwrite($bf, full_tag("INTROFORMAT", 4, false, $qcreate->introformat));
    fwrite($bf, full_tag("ALLOWED", 4, false, $qcreate->allowed));
    fwrite($bf, full_tag("TOTALREQUIRED", 4, false, $qcreate->totalrequired));
    fwrite($bf, full_tag("STUDENTQACCESS", 4, false, $qcreate->studentqaccess));
    fwrite($bf, full_tag("TIMEOPEN", 4, false, $qcreate->timeopen));
    fwrite($bf, full_tag("TIMECLOSE", 4, false, $qcreate->timeclose));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $qcreate->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $qcreate->timemodified));
    $status = $status && backup_qcreate_requireds($bf, $preferences, $qcreate->id);
    //if we've selected to backup users info, then execute backup_qcreate_grades
    if (backup_userdata_selected($preferences, 'qcreate', $qcreate->id)) {
        $status = $status && backup_qcreate_grades($bf, $preferences, $qcreate->id);
    }
    //End mod
    $status = $status && fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:32,代码来源:backuplib.php

示例8: survey_backup_one_mod

function survey_backup_one_mod($bf, $preferences, $survey)
{
    $status = true;
    if (is_numeric($survey)) {
        $survey = get_record('survey', 'id', $survey);
    }
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print choice data
    fwrite($bf, full_tag("ID", 4, false, $survey->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "survey"));
    fwrite($bf, full_tag("TEMPLATE", 4, false, $survey->template));
    fwrite($bf, full_tag("DAYS", 4, false, $survey->days));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $survey->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $survey->timemodified));
    fwrite($bf, full_tag("NAME", 4, false, $survey->name));
    fwrite($bf, full_tag("INTRO", 4, false, $survey->intro));
    fwrite($bf, full_tag("QUESTIONS", 4, false, $survey->questions));
    //if we've selected to backup users info, then execute backup_survey_answers and
    //backup_survey_analysis
    if (backup_userdata_selected($preferences, 'survey', $survey->id)) {
        $status = backup_survey_answers($bf, $preferences, $survey->id);
        $status = backup_survey_analysis($bf, $preferences, $survey->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:JackCanada,项目名称:moodle-hacks,代码行数:28,代码来源:backuplib.php

示例9: stampcoll_backup_one_mod

/**
 * Write the info about the given module instance into the backup file
 *
 * @param resource $bf backup file resource
 * @param object $preferences Backup settings
 * @param object $stampcoll Stampcoll record (if object) or its ID (if numeric)
 * @return boolean True if success, False if failure
 */
function stampcoll_backup_one_mod($bf, $preferences, $stampcoll)
{
    if (is_numeric($stampcoll)) {
        $stampcoll = get_record('stampcoll', 'id', $stampcoll);
    }
    $status = true;
    $status = $status && fwrite($bf, start_tag('MOD', 3, true));
    $status = $status && fwrite($bf, full_tag('ID', 4, false, $stampcoll->id));
    $status = $status && fwrite($bf, full_tag('MODTYPE', 4, false, 'stampcoll'));
    $status = $status && fwrite($bf, full_tag('MODVERSION', 4, false, stampcoll_modversion()));
    $status = $status && fwrite($bf, full_tag('NAME', 4, false, $stampcoll->name));
    $status = $status && fwrite($bf, full_tag('TEXT', 4, false, $stampcoll->text));
    $status = $status && fwrite($bf, full_tag('FORMAT', 4, false, $stampcoll->format));
    $status = $status && fwrite($bf, full_tag('IMAGE', 4, false, $stampcoll->image));
    $status = $status && fwrite($bf, full_tag('TIMEMODIFIED', 4, false, $stampcoll->timemodified));
    $status = $status && fwrite($bf, full_tag('DISPLAYZERO', 4, false, $stampcoll->displayzero));
    $status = $status && fwrite($bf, full_tag('ANONYMOUS', 4, false, $stampcoll->anonymous));
    //If we've selected to backup users info, then backup collected stamps
    if (backup_userdata_selected($preferences, 'stampcoll', $stampcoll->id)) {
        $status = $status && stampcoll_backup_collected_stamps($bf, $preferences, $stampcoll->id);
    }
    //End module tag
    $status = $status && fwrite($bf, end_tag('MOD', 3, true));
    return $status;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:33,代码来源:backuplib.php

示例10: choice_backup_one_mod

function choice_backup_one_mod($bf, $preferences, $choice)
{
    global $CFG, $DB;
    if (is_numeric($choice)) {
        $choice = $DB->get_record('choice', array('id' => $choice));
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print choice data
    fwrite($bf, full_tag("ID", 4, false, $choice->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "choice"));
    fwrite($bf, full_tag("NAME", 4, false, $choice->name));
    fwrite($bf, full_tag("TEXT", 4, false, $choice->intro));
    fwrite($bf, full_tag("FORMAT", 4, false, $choice->introformat));
    fwrite($bf, full_tag("PUBLISH", 4, false, $choice->publish));
    fwrite($bf, full_tag("SHOWRESULTS", 4, false, $choice->showresults));
    fwrite($bf, full_tag("DISPLAY", 4, false, $choice->display));
    fwrite($bf, full_tag("ALLOWUPDATE", 4, false, $choice->allowupdate));
    fwrite($bf, full_tag("SHOWUNANSWERED", 4, false, $choice->showunanswered));
    fwrite($bf, full_tag("LIMITANSWERS", 4, false, $choice->limitanswers));
    fwrite($bf, full_tag("TIMEOPEN", 4, false, $choice->timeopen));
    fwrite($bf, full_tag("TIMECLOSE", 4, false, $choice->timeclose));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $choice->timemodified));
    //Now backup choice_options
    $status = backup_choice_options($bf, $preferences, $choice->id);
    //if we've selected to backup users info, then execute backup_choice_answers
    if (backup_userdata_selected($preferences, 'choice', $choice->id)) {
        $status = backup_choice_answers($bf, $preferences, $choice->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:ajv,项目名称:Offline-Caching,代码行数:34,代码来源:backuplib.php

示例11: hotpot_backup_one_mod

function hotpot_backup_one_mod($bf, $preferences, $instance = 0)
{
    // $bf : resource id for b(ackup) f(ile)
    // $preferences : object containing switches and settings for this backup
    $level = 3;
    $status = true;
    $table = 'hotpot';
    $select = "course={$preferences->backup_course} AND id='{$instance}'";
    $records_tag = '';
    $records_tags = array();
    $record_tag = 'MOD';
    $record_tags = array('MODTYPE' => 'hotpot');
    $excluded_tags = array();
    $more_backup = '';
    if (function_exists('backup_userdata_selected')) {
        // Moodle >= 1.6
        $backup_userdata_selected = backup_userdata_selected($preferences, 'hotpot', $instance);
    } else {
        // Moodle <= 1.5
        $backup_userdata_selected = $preferences->mods['hotpot']->userinfo;
    }
    if ($backup_userdata_selected) {
        $more_backup .= '$GLOBALS["hotpot_backup_string_ids"] = array();';
        $more_backup .= '$status = hotpot_backup_attempts($bf, $record, $level, $status);';
        $more_backup .= '$status = hotpot_backup_questions($bf, $record, $level, $status);';
        $more_backup .= '$status = hotpot_backup_strings($bf, $record, $level, $status);';
        $more_backup .= 'unset($GLOBALS["hotpot_backup_string_ids"]);';
        // tidy up
    }
    return hotpot_backup_records($bf, $status, $level, $table, $select, $records_tag, $records_tags, $record_tag, $record_tags, $excluded_tags, $more_backup);
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:31,代码来源:backuplib.php

示例12: lightboxgallery_backup_one_mod

function lightboxgallery_backup_one_mod($bf, $preferences, $gallery)
{
    $status = true;
    if (is_numeric($gallery)) {
        $gallery = get_record('lightboxgallery', 'id', $gallery);
    }
    fwrite($bf, start_tag('MOD', 3, true));
    fwrite($bf, full_tag('ID', 4, false, $gallery->id));
    fwrite($bf, full_tag('MODTYPE', 4, false, 'lightboxgallery'));
    fwrite($bf, full_tag('FOLDER', 4, false, $gallery->folder));
    fwrite($bf, full_tag('NAME', 4, false, $gallery->name));
    fwrite($bf, full_tag('DESCRIPTION', 4, false, $gallery->description));
    fwrite($bf, full_tag('PERPAGE', 4, false, $gallery->perpage));
    fwrite($bf, full_tag('COMMENTS', 4, false, $gallery->comments));
    fwrite($bf, full_tag('PUBLIC', 4, false, $gallery->ispublic));
    fwrite($bf, full_tag('RSS', 4, false, $gallery->rss));
    fwrite($bf, full_tag('AUTORESIZE', 4, false, $gallery->autoresize));
    fwrite($bf, full_tag('RESIZE', 4, false, $gallery->resize));
    fwrite($bf, full_tag('EXTINFO', 4, false, $gallery->extinfo));
    $status = backup_lightboxgallery_files_instance($bf, $preferences, $gallery);
    if ($status) {
        if (backup_userdata_selected($preferences, 'lightboxgallery', $gallery->id)) {
            $status = backup_lightboxgallery_metadata($bf, $preferences, $gallery->id);
        }
    }
    $status = fwrite($bf, end_tag('MOD', 3, true));
    return $status;
}
开发者ID:itziko,项目名称:Moodle-jQuery-Lightbox-Gallery,代码行数:28,代码来源:backuplib.php

示例13: oublog_backup_one_mod

function oublog_backup_one_mod($bf, $preferences, $blog)
{
    global $CFG;
    if (is_numeric($blog)) {
        $blog = get_record('oublog', 'id', $blog);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print blog data
    fwrite($bf, full_tag("MODTYPE", 4, false, "oublog"));
    $fields = array('id', 'name', 'accesstoken', 'summary', 'allowcomments', 'individual', 'maxvisibility', 'global', 'views', 'completionposts', 'completioncomments');
    $status = write_rectags($bf, $fields, $blog, 4);
    $links = get_recordset('oublog_links', 'oublogid', $blog->id);
    if ($links->RecordCount()) {
        fwrite($bf, start_tag("LINKS", 4, true));
        while ($link = rs_fetch_next_record($links)) {
            fwrite($bf, start_tag("LINK", 5, true));
            $fields = array('id', 'oublogid', 'title', 'url', 'sortorder');
            $status = write_rectags($bf, $fields, $link, 6);
            fwrite($bf, end_tag("LINK", 5, true));
        }
        $status = fwrite($bf, end_tag("LINKS", 4, true));
    }
    //if we've selected to backup users info, then execute backup_oublog_userdata
    if (backup_userdata_selected($preferences, 'oublog', $blog->id)) {
        $status = backup_oublog_userdata($bf, $preferences, $blog->id);
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:hmatulis,项目名称:RTL-BIDI-Hebrew-Moodle-Plugins,代码行数:32,代码来源:backuplib.php

示例14: assignment_backup_one_mod

function assignment_backup_one_mod($bf, $preferences, $assignment)
{
    global $CFG;
    if ($assignment === 0) {
        //no active instances of assignment to be backed up - skip backup
        return false;
    }
    if (is_numeric($assignment)) {
        $assignment = get_record('assignment', 'id', $assignment);
    }
    if (empty($assignment->assignmenttype)) {
        // No assignment type will cause fatal error below in require_once so bail out now
        // Probably ended up here by restoring a course into
        // a moodle without this assignmenttype
        return false;
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $assignment->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "assignment"));
    fwrite($bf, full_tag("NAME", 4, false, $assignment->name));
    fwrite($bf, full_tag("DESCRIPTION", 4, false, $assignment->description));
    fwrite($bf, full_tag("FORMAT", 4, false, $assignment->format));
    fwrite($bf, full_tag("RESUBMIT", 4, false, $assignment->resubmit));
    fwrite($bf, full_tag("PREVENTLATE", 4, false, $assignment->preventlate));
    fwrite($bf, full_tag("EMAILTEACHERS", 4, false, $assignment->emailteachers));
    fwrite($bf, full_tag("VAR1", 4, false, $assignment->var1));
    fwrite($bf, full_tag("VAR2", 4, false, $assignment->var2));
    fwrite($bf, full_tag("VAR3", 4, false, $assignment->var3));
    fwrite($bf, full_tag("VAR4", 4, false, $assignment->var4));
    fwrite($bf, full_tag("VAR5", 4, false, $assignment->var5));
    fwrite($bf, full_tag("ASSIGNMENTTYPE", 4, false, $assignment->assignmenttype));
    fwrite($bf, full_tag("MAXBYTES", 4, false, $assignment->maxbytes));
    fwrite($bf, full_tag("TIMEDUE", 4, false, $assignment->timedue));
    fwrite($bf, full_tag("TIMEAVAILABLE", 4, false, $assignment->timeavailable));
    fwrite($bf, full_tag("GRADE", 4, false, $assignment->grade));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $assignment->timemodified));
    $class = 'assignment_' . $assignment->assignmenttype;
    require_once $CFG->dirroot . '/mod/assignment/lib.php';
    require_once $CFG->dirroot . '/mod/assignment/type/' . $assignment->assignmenttype . '/assignment.class.php';
    call_user_func(array($class, 'backup_one_mod'), $bf, $preferences, $assignment);
    //if we've selected to backup users info, then execute backup_assignment_submisions and
    //backup_assignment_files_instance
    if (backup_userdata_selected($preferences, 'assignment', $assignment->id)) {
        $status = backup_assignment_submissions($bf, $preferences, $assignment);
        if ($status) {
            $status = backup_assignment_files_instance($bf, $preferences, $assignment->id);
        }
    }
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:edwinphillips,项目名称:moodle-485cb39,代码行数:55,代码来源:backuplib.php

示例15: certificate_backup_one_mod

function certificate_backup_one_mod($bf, $preferences, $certificate)
{
    global $CFG;
    if (is_numeric($certificate)) {
        $certificate = get_record('certificate', 'id', $certificate);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print certificate data
    fwrite($bf, full_tag("ID", 4, false, $certificate->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "certificate"));
    fwrite($bf, full_tag("NAME", 4, false, $certificate->name));
    fwrite($bf, full_tag("INTRO", 4, false, $certificate->intro));
    fwrite($bf, full_tag("EMAILTEACHERS", 4, false, $certificate->emailteachers));
    fwrite($bf, full_tag("EMAILOTHERS", 4, false, $certificate->emailothers));
    fwrite($bf, full_tag("SAVECERT", 4, false, $certificate->savecert));
    fwrite($bf, full_tag("REPORTCERT", 4, false, $certificate->reportcert));
    fwrite($bf, full_tag("DELIVERY", 4, false, $certificate->delivery));
    fwrite($bf, full_tag("TYPE", 4, false, $certificate->certificatetype));
    fwrite($bf, full_tag("BORDERSTYLE", 4, false, $certificate->borderstyle));
    fwrite($bf, full_tag("BORDERCOLOR", 4, false, $certificate->bordercolor));
    fwrite($bf, full_tag("PRINTWMARK", 4, false, $certificate->printwmark));
    fwrite($bf, full_tag("PRINTDATE", 4, false, $certificate->printdate));
    fwrite($bf, full_tag("DATEFMT", 4, false, $certificate->datefmt));
    fwrite($bf, full_tag("PRINTOUTCOME", 4, false, $certificate->printoutcome));
    fwrite($bf, full_tag("PRINTNUMBER", 4, false, $certificate->printnumber));
    fwrite($bf, full_tag("PRINTGRADE", 4, false, $certificate->printgrade));
    fwrite($bf, full_tag("GRADEFMT", 4, false, $certificate->gradefmt));
    fwrite($bf, full_tag("PRINTHOURS", 4, false, $certificate->printhours));
    fwrite($bf, full_tag("SETCERTIFICATION", 4, false, $certificate->setcertification));
    fwrite($bf, full_tag("REQUIREDCERTIFICATION", 4, false, $certificate->requiredcertification));
    fwrite($bf, full_tag("LOCKGRADE", 4, false, $certificate->lockgrade));
    fwrite($bf, full_tag("REQUIREDGRADE", 4, false, $certificate->requiredgrade));
    fwrite($bf, full_tag("PRINTTEACHER", 4, false, $certificate->printteacher));
    fwrite($bf, full_tag("CUSTOMTEXT", 4, false, $certificate->customtext));
    fwrite($bf, full_tag("PRINTSIGNATURE", 4, false, $certificate->printsignature));
    fwrite($bf, full_tag("PRINTSEAL", 4, false, $certificate->printseal));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $certificate->timemodified));
    //if we've selected to backup users info, then execute backup_certificate_issues and
    //backup_certificate_files_instance
    if (backup_userdata_selected($preferences, 'certificate', $certificate->id)) {
        $status = backup_certificate_issues($bf, $preferences, $certificate->id);
        if ($status) {
            $status = backup_certificate_file_instance($bf, $preferences, $certificate->id);
        }
    }
    //now backup the linked stuff
    $status = backup_certificate_linked_modules($bf, $preferences, $certificate->id);
    //End mod
    fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:53,代码来源:backuplib.php


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