Пример #1
0
function liveclassroom_backup_one_mod($bf, $preferences, $liveclassroom)
{
    global $CFG;
    if (is_numeric($liveclassroom)) {
        $liveclassroom = get_record('liveclassroom', 'id', $liveclassroom);
    }
    $status = true;
    $lcAction = new LCAction(null, $CFG->liveclassroom_servername, $CFG->liveclassroom_adminusername, $CFG->liveclassroom_adminpassword, null, $liveclassroom->course);
    $roomPreview = $lcAction->getRoomPreview($liveclassroom->type);
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print liveclassroom data
    fwrite($bf, full_tag("ID", 4, false, $liveclassroom->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "liveclassroom"));
    fwrite($bf, full_tag("COURSE", 4, false, $liveclassroom->course));
    fwrite($bf, full_tag("NAME", 4, false, $liveclassroom->name));
    if ($lcAction->isStudentAdmin($liveclassroom->course, $liveclassroom->course . '_S') == "true") {
        fwrite($bf, full_tag("ISSTUDENTADMIN", 4, false, "true"));
    } else {
        fwrite($bf, full_tag("ISSTUDENTADMIN", 4, false, "false"));
    }
    fwrite($bf, full_tag("PREVIEW", 4, false, $roomPreview));
    fwrite($bf, full_tag("TYPE", 4, false, $liveclassroom->type));
    fwrite($bf, full_tag("SECTION", 4, false, $liveclassroom->section));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $liveclassroom->timemodified));
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #2
0
function webscheme_backup_one_mod($bf, $preferences, $ws)
{
    global $CFG;
    if (is_numeric($ws)) {
        $ws = get_record('webscheme', 'id', $ws);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print webscheme data
    fwrite($bf, full_tag("ID", 4, false, $ws->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "webscheme"));
    fwrite($bf, full_tag("NAME", 4, false, $ws->name));
    fwrite($bf, full_tag("INTRO", 4, false, $ws->intro));
    fwrite($bf, full_tag("INTROFORMAT", 4, false, $ws->introformat));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $ws->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $ws->timemodified));
    fwrite($bf, full_tag("WS_SETTINGS", 4, false, htmlentities($ws->ws_settings)));
    fwrite($bf, full_tag("WS_EVENTS", 4, false, htmlentities($ws->ws_events)));
    fwrite($bf, full_tag("WS_INITEXPR", 4, false, htmlentities($ws->ws_initexpr)));
    fwrite($bf, full_tag("WS_LOADURLS", 4, false, htmlentities($ws->ws_loadurls)));
    fwrite($bf, full_tag("WS_HTML", 4, false, htmlentities($ws->ws_html)));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #3
0
function backup_adobeconnect_meeting_groups($bf, $preferences, $adobeconnectid)
{
    global $CFG;
    // Set status to false because there must be at least one meeting instance
    $status = false;
    // Go through all of the meeting instances and backup each group's meeting
    if ($meetgroups = get_records("adobeconnect_meeting_groups", 'instanceid', $adobeconnectid)) {
        if ($meetgroups) {
            //Write start tag
            $status = fwrite($bf, start_tag("MEETINGGROUPS", 4, true));
            //Iterate over each meeting instance
            foreach ($meetgroups as $meetgroup) {
                //Start of meeting group instance
                $status = fwrite($bf, start_tag("MEETINGGROUP", 5, true));
                fwrite($bf, full_tag("ID", 6, false, $meetgroup->id));
                fwrite($bf, full_tag("INSTANCEID", 6, false, $meetgroup->instanceid));
                fwrite($bf, full_tag("MEETINGSCOID", 6, false, $meetgroup->meetingscoid));
                fwrite($bf, full_tag("GROUPID", 6, false, $meetgroup->groupid));
                //End of meeting group instance
                $status = fwrite($bf, end_tag("MEETINGGROUP", 5, true));
            }
            //Write end tag
            $status = fwrite($bf, end_tag("MEETINGGROUPS", 4, true));
        }
    }
    return $status;
}
function backup_book_chapters($bf, $preferences, $book)
{
    global $CFG;
    $status = true;
    //Print book's chapters
    if ($chapters = get_records('book_chapters', 'bookid', $book->id, 'id')) {
        //Write start tag
        $status = fwrite($bf, start_tag('CHAPTERS', 4, true));
        foreach ($chapters as $ch) {
            //Start chapter
            fwrite($bf, start_tag('CHAPTER', 5, true));
            //Print chapter data
            fwrite($bf, full_tag('ID', 6, false, $ch->id));
            fwrite($bf, full_tag('PAGENUM', 6, false, $ch->pagenum));
            fwrite($bf, full_tag('SUBCHAPTER', 6, false, $ch->subchapter));
            fwrite($bf, full_tag('TITLE', 6, false, $ch->title));
            fwrite($bf, full_tag('CONTENT', 6, false, $ch->content));
            fwrite($bf, full_tag('HIDDEN', 6, false, $ch->hidden));
            fwrite($bf, full_tag('TIMECREATED', 6, false, $ch->timecreated));
            fwrite($bf, full_tag('TIMEMODIFIED', 6, false, $ch->timemodified));
            fwrite($bf, full_tag('IMPORTSRC', 6, false, $ch->importsrc));
            //End chapter
            $status = fwrite($bf, end_tag('CHAPTER', 5, true));
        }
        //Write end tag
        $status = fwrite($bf, end_tag('CHAPTERS', 4, true));
    }
    return $status;
}
function kaltura_backup_one_mod($bf, $preferences, $resource)
{
    global $CFG;
    if (is_numeric($resource)) {
        $kaltura_entry = get_record('kaltura_entries', 'id', $resource);
    } else {
        $kaltura_entry = get_record('kaltura_entries', 'id', $resource->id);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $kaltura_entry->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "kaltura"));
    fwrite($bf, full_tag("ENTRY_ID", 4, false, $kaltura_entry->entry_id));
    fwrite($bf, full_tag("DIMENSIONS", 4, false, $kaltura_entry->dimensions));
    fwrite($bf, full_tag("SIZE", 4, false, $kaltura_entry->size));
    fwrite($bf, full_tag("CUSTOM_WIDTH", 4, false, $kaltura_entry->custom_width));
    fwrite($bf, full_tag("DESIGN", 4, false, $kaltura_entry->design));
    fwrite($bf, full_tag("TITLE", 4, false, $kaltura_entry->title));
    fwrite($bf, full_tag("CONTEXT", 4, false, $kaltura_entry->context));
    fwrite($bf, full_tag("ENTRY_TYPE", 4, false, $kaltura_entry->entry_type));
    fwrite($bf, full_tag("MEDIA_TYPE", 4, false, $kaltura_entry->media_type));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #6
0
function wwassignment_backup_one_mod($bf, $preferences, $wwassignment)
{
    //error_log("wwassignment_backup_one_mod");
    ////error_log("preferences ".print_r($preferences,true));
    global $CFG;
    if (is_numeric($wwassignment)) {
        $wwassignment = get_record('wwassignment', 'id', $wwassignment);
    }
    $status = true;
    //             function full_tag($tag,$level=0,$endline=true,$content,$attributes=null) {
    //         //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print wwassignment data
    fwrite($bf, full_tag("ID", 4, false, $wwassignment->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "wwassignment"));
    fwrite($bf, full_tag("NAME", 4, false, $wwassignment->name));
    fwrite($bf, full_tag("DESCRIPTION", 4, false, $wwassignment->description));
    fwrite($bf, full_tag("WEBWORK_SET", 4, false, $wwassignment->webwork_set));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $wwassignment->timemodified));
    //if we've selected to backup users info, then execute backup_assignment_submisions and
    //backup_assignment_files_instance
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    //error_log("end wwassignment_one_backup_mod");
    //error_log("preferences ".print_r($preferences,true));
    return $status;
}
Пример #7
0
function resource_backup_one_mod($bf, $preferences, $resource)
{
    global $CFG;
    if (is_numeric($resource)) {
        $resource = get_record('resource', 'id', $resource);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $resource->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "resource"));
    fwrite($bf, full_tag("NAME", 4, false, $resource->name));
    fwrite($bf, full_tag("TYPE", 4, false, $resource->type));
    fwrite($bf, full_tag("REFERENCE", 4, false, $resource->reference));
    fwrite($bf, full_tag("SUMMARY", 4, false, $resource->summary));
    fwrite($bf, full_tag("ALLTEXT", 4, false, $resource->alltext));
    fwrite($bf, full_tag("POPUP", 4, false, $resource->popup));
    fwrite($bf, full_tag("OPTIONS", 4, false, $resource->options));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $resource->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    if ($status && ($resource->type == 'file' || $resource->type == 'directory' || $resource->type == 'ims')) {
        // more should go here later!
        // backup files for this resource.
        $status = resource_backup_files($bf, $preferences, $resource);
    }
    return $status;
}
/**
 * Format's backup routine
 *
 * @param handler $bf Backup file handler
 * @param object $preferences Backup preferences
 * @return boolean Success
 **/
function topcoll_backup_format_data($bf, $preferences)
{
    $status = true;
    if ($layout = get_record('format_topcoll_layout', 'courseid', $preferences->backup_course)) {
        $status = $status and fwrite($bf, start_tag('LAYOUT', 3, true));
        $status = $status and fwrite($bf, full_tag('LAYOUTELEMENT', 4, false, $layout->layoutelement));
        $status = $status and fwrite($bf, full_tag('LAYOUTSTRUCTURE', 4, false, $layout->layoutstructure));
        $status = $status and fwrite($bf, end_tag('LAYOUT', 3, true));
    }
    return $status;
}
function econsole_backup_one_mod($bf, $preferences, $econsole)
{
    global $CFG;
    if (is_numeric($econsole)) {
        $econsole = get_record('econsole', 'id', $econsole);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print econsole data
    fwrite($bf, full_tag("ID", 4, false, $econsole->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "econsole"));
    fwrite($bf, full_tag("NAME", 4, false, $econsole->name));
    fwrite($bf, full_tag("CONTENT", 4, false, $econsole->content));
    fwrite($bf, full_tag("UNITSTRING", 4, false, $econsole->unitstring));
    fwrite($bf, full_tag("SHOWUNIT", 4, false, $econsole->showunit));
    fwrite($bf, full_tag("LESSONSTRING", 4, false, $econsole->lessonstring));
    fwrite($bf, full_tag("SHOWLESSON", 4, false, $econsole->showlesson));
    fwrite($bf, full_tag("URL1NAME", 4, false, $econsole->url1name));
    fwrite($bf, full_tag("URL1", 4, false, $econsole->url1));
    fwrite($bf, full_tag("URL2NAME", 4, false, $econsole->url2name));
    fwrite($bf, full_tag("URL2", 4, false, $econsole->url2));
    fwrite($bf, full_tag("URL3NAME", 4, false, $econsole->url3name));
    fwrite($bf, full_tag("URL3", 4, false, $econsole->url3));
    fwrite($bf, full_tag("URL4NAME", 4, false, $econsole->url4name));
    fwrite($bf, full_tag("URL4", 4, false, $econsole->url4));
    fwrite($bf, full_tag("URL5NAME", 4, false, $econsole->url5name));
    fwrite($bf, full_tag("URL5", 4, false, $econsole->url5));
    fwrite($bf, full_tag("URL6NAME", 4, false, $econsole->url6name));
    fwrite($bf, full_tag("URL6", 4, false, $econsole->url6));
    fwrite($bf, full_tag("GLOSSARY", 4, false, $econsole->glossary));
    fwrite($bf, full_tag("JOURNAL", 4, false, $econsole->journal));
    fwrite($bf, full_tag("FORUM", 4, false, $econsole->forum));
    fwrite($bf, full_tag("CHAT", 4, false, $econsole->chat));
    fwrite($bf, full_tag("CHOICE", 4, false, $econsole->choice));
    fwrite($bf, full_tag("QUIZ", 4, false, $econsole->quiz));
    fwrite($bf, full_tag("ASSIGNMENT", 4, false, $econsole->assignment));
    fwrite($bf, full_tag("WIKI", 4, false, $econsole->wiki));
    fwrite($bf, full_tag("THEME", 4, false, $econsole->theme));
    fwrite($bf, full_tag("IMAGEBARTOP", 4, false, $econsole->imagebartop));
    fwrite($bf, full_tag("IMAGEBARBOTTOM", 4, false, $econsole->imagebarbottom));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $econsole->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $econsole->timemodified));
    //if we've selected to backup users info, then execute backup_econsole_messages
    /*		
            if (backup_userdata_selected($preferences,'econsole',$econsole->id)) {
                $status = backup_econsole_messages($bf,$preferences,$econsole->id);
            }		
    */
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
function backup_lightboxgallery_metadata($bf, $preferences, $galleryid)
{
    $status = true;
    if ($records = get_records('lightboxgallery_image_meta', 'gallery', $galleryid, 'id')) {
        $status = fwrite($bf, start_tag('IMAGEMETAS', 4, true));
        foreach ($records as $record) {
            fwrite($bf, start_tag('IMAGEMETA', 5, true));
            fwrite($bf, full_tag('ID', 6, false, $record->id));
            fwrite($bf, full_tag('IMAGE', 6, false, $record->image));
            fwrite($bf, full_tag('METATYPE', 6, false, $record->metatype));
            fwrite($bf, full_tag('DESCRIPTION', 6, false, $record->description));
            $status = fwrite($bf, end_tag('IMAGEMETA', 5, true));
        }
        $status = fwrite($bf, end_tag('IMAGEMETAS', 4, true));
    }
    return $status;
}
Пример #11
0
function wwassignment_backup_one_mod($bf, $preferences, $wwassignment)
{
    $status = true;
    if (is_numeric($wwassignment)) {
        $wwassignment = get_record('wwassignment', 'id', $wwassignment);
    }
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print wwassignment data
    fwrite($bf, full_tag("ID", 4, false, $wwassignment->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "wwassignment"));
    fwrite($bf, full_tag("NAME", 4, false, $wwassignment->name));
    fwrite($bf, full_tag("DESCRIPTION", 4, false, $wwassignment->description));
    fwrite($bf, full_tag("WEBWORK_SET", 4, false, $wwassignment->webwork_set));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #12
0
function diplome_backup_one_mod($bf, $preferences, $diplome)
{
    global $CFG;
    if (is_numeric($diplome)) {
        $diplome = get_record('diplome', 'id', $diplome);
    }
    $status = true;
    fwrite($bf, start_tag("MOD", 3, true));
    fwrite($bf, full_tag("ID", 4, false, $diplome->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "diplome"));
    fwrite($bf, full_tag("NAME", 4, false, $diplome->name));
    fwrite($bf, full_tag("INTRO", 4, false, $diplome->intro));
    fwrite($bf, full_tag("INTROFORMAT", 4, false, $diplome->introformat));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $diplome->timecreated));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $diplome->timemodified));
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #13
0
function ezproxy_backup_one_mod($bf, $preferences, $ezproxy)
{
    global $CFG;
    if (is_numeric($ezproxy)) {
        $ezproxy = get_record('ezproxy', 'id', $ezproxy);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $ezproxy->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "ezproxy"));
    fwrite($bf, full_tag("NAME", 4, false, $ezproxy->name));
    fwrite($bf, full_tag("SERVERURL", 4, false, $ezproxy->serverurl));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $ezproxy->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
function skype_backup_one_mod($bf, $preferences, $skype)
{
    global $CFG;
    if (is_numeric($skype)) {
        $skype = get_record('skype', 'id', $skype);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $skype->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "skype"));
    fwrite($bf, full_tag("NAME", 4, false, $skype->name));
    fwrite($bf, full_tag("PARTICIPANTS", 4, false, $skype->participants));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $skype->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
/**
 * Format's backup routine
 *
 * @param handler $bf Backup file handler
 * @param object $preferences Backup preferences
 * @return boolean
 **/
function ebook_backup_format_data($bf, $preferences)
{
    $status = true;
    if ($pages = get_records('course_format_ebook', 'courseid', $preferences->backup_course)) {
        fwrite($bf, start_tag('PAGES', 3, true));
        foreach ($pages as $page) {
            fwrite($bf, start_tag('PAGE', 4, true));
            fwrite($bf, full_tag('ID', 5, false, $page->id));
            fwrite($bf, full_tag('COURSEID', 5, false, $page->courseid));
            fwrite($bf, full_tag('CHAPTER', 5, false, $page->chapter));
            fwrite($bf, full_tag('PAGE', 5, false, $page->page));
            fwrite($bf, full_tag('SECTION', 5, false, $page->section));
            fwrite($bf, full_tag('TITLE', 5, false, $page->title));
            fwrite($bf, end_tag('PAGE', 4, true));
        }
        $status = fwrite($bf, end_tag('PAGES', 3, true));
    }
    return $status;
}
Пример #16
0
function label_backup_one_mod($bf, $preferences, $label)
{
    global $CFG;
    if (is_numeric($label)) {
        $label = get_record('label', 'id', $label);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $label->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "label"));
    fwrite($bf, full_tag("NAME", 4, false, $label->name));
    fwrite($bf, full_tag("CONTENT", 4, false, $label->content));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $label->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
function tab_backup_one_mod($bf, $preferences, $tab)
{
    global $CFG;
    if (is_numeric($tab)) {
        $tab = get_record('tab', 'id', $tab);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $tab->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "tab"));
    fwrite($bf, full_tag("NAME", 4, false, $tab->name));
    fwrite($bf, full_tag("TAB1", 4, false, $tab->tab1));
    fwrite($bf, full_tag("TAB2", 4, false, $tab->tab2));
    fwrite($bf, full_tag("TAB3", 4, false, $tab->tab3));
    fwrite($bf, full_tag("TAB4", 4, false, $tab->tab4));
    fwrite($bf, full_tag("TAB5", 4, false, $tab->tab5));
    fwrite($bf, full_tag("TAB6", 4, false, $tab->tab6));
    fwrite($bf, full_tag("TAB7", 4, false, $tab->tab7));
    fwrite($bf, full_tag("TAB8", 4, false, $tab->tab8));
    fwrite($bf, full_tag("TAB9", 4, false, $tab->tab9));
    fwrite($bf, full_tag("TAB0", 4, false, $tab->tab0));
    fwrite($bf, full_tag("TAB1CONTENT", 4, false, $tab->tab1content));
    fwrite($bf, full_tag("TAB2CONTENT", 4, false, $tab->tab2content));
    fwrite($bf, full_tag("TAB3CONTENT", 4, false, $tab->tab3content));
    fwrite($bf, full_tag("TAB4CONTENT", 4, false, $tab->tab4content));
    fwrite($bf, full_tag("TAB5CONTENT", 4, false, $tab->tab5content));
    fwrite($bf, full_tag("TAB6CONTENT", 4, false, $tab->tab6content));
    fwrite($bf, full_tag("TAB7CONTENT", 4, false, $tab->tab7content));
    fwrite($bf, full_tag("TAB8CONTENT", 4, false, $tab->tab8content));
    fwrite($bf, full_tag("TAB9CONTENT", 4, false, $tab->tab9content));
    fwrite($bf, full_tag("TAB0CONTENT", 4, false, $tab->tab0content));
    fwrite($bf, full_tag("CSS", 4, false, $tab->css));
    fwrite($bf, full_tag("MENUCSS", 4, false, $tab->menucss));
    fwrite($bf, full_tag("DISPLAYMENU", 4, false, $tab->displaymenu));
    fwrite($bf, full_tag("MENUNAME", 4, false, $tab->menuname));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $tab->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #18
0
function voicepodcaster_backup_one_mod($bf, $preferences, $voicefeature)
{
    global $CFG;
    if (is_numeric($voicefeature)) {
        $voicefeature = get_record('voicepodcaster', 'id', $voicefeature);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print voicepodcaster data
    fwrite($bf, full_tag("ID", 4, false, $voicefeature->id));
    fwrite($bf, full_tag("RID", 4, false, $voicefeature->rid));
    fwrite($bf, full_tag("MODTYPE", 4, false, "voicepodcaster"));
    fwrite($bf, full_tag("COURSE", 4, false, $voicefeature->course));
    fwrite($bf, full_tag("NAME", 4, false, $voicefeature->name));
    fwrite($bf, full_tag("TYPE", 4, false, $voicefeature->type));
    fwrite($bf, full_tag("SECTION", 4, false, $voicefeature->section));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $voicefeature->timemodified));
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #19
0
function voiceemail_backup_one_mod($bf, $preferences, $voiceemail)
{
    global $CFG;
    if (is_numeric($voiceemail)) {
        $voiceemail = get_record('voiceemail', 'id', $voiceemail);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print voiceemail data
    fwrite($bf, full_tag("ID", 4, false, $voiceemail->id));
    fwrite($bf, full_tag("RID", 4, false, $voiceemail->rid));
    fwrite($bf, full_tag("MODTYPE", 4, false, "voiceemail"));
    fwrite($bf, full_tag("COURSE", 4, false, $voiceemail->course));
    fwrite($bf, full_tag("NAME", 4, false, $voiceemail->name));
    fwrite($bf, full_tag("RECIPIENTS_EMAIL", 4, false, $voiceemail->recipients_email));
    fwrite($bf, full_tag("SECTION", 4, false, $voiceemail->section));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $voiceemail->timemodified));
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
/**
 * Format's backup routine
 *
 * @param handler $bf Backup file handler
 * @param object $preferences Backup preferences
 * @return boolean
 **/
function page_backup_format_data($bf, $preferences)
{
    $status = true;
    if ($pages = get_records('format_page', 'courseid', $preferences->backup_course)) {
        fwrite($bf, start_tag('PAGES', 3, true));
        foreach ($pages as $page) {
            fwrite($bf, start_tag('PAGE', 4, true));
            fwrite($bf, full_tag('ID', 5, false, $page->id));
            fwrite($bf, full_tag('NAMEONE', 5, false, $page->nameone));
            fwrite($bf, full_tag('NAMETWO', 5, false, $page->nametwo));
            fwrite($bf, full_tag('DISPLAY', 5, false, $page->display));
            fwrite($bf, full_tag('PREFLEFTWIDTH', 5, false, $page->prefleftwidth));
            fwrite($bf, full_tag('PREFCENTERWIDTH', 5, false, $page->prefcenterwidth));
            fwrite($bf, full_tag('PREFRIGHTWIDTH', 5, false, $page->prefrightwidth));
            fwrite($bf, full_tag('PARENT', 5, false, $page->parent));
            fwrite($bf, full_tag('SORTORDER', 5, false, $page->sortorder));
            fwrite($bf, full_tag('TEMPLATE', 5, false, $page->template));
            fwrite($bf, full_tag('SHOWBUTTONS', 5, false, $page->showbuttons));
            fwrite($bf, full_tag('LOCKS', 5, false, $page->locks));
            // Now grab the page items
            if ($items = get_records('format_page_items', 'pageid', $page->id, 'position, sortorder')) {
                fwrite($bf, start_tag('ITEMS', 5, true));
                foreach ($items as $item) {
                    fwrite($bf, start_tag('ITEM', 6, true));
                    fwrite($bf, full_tag('ID', 7, false, $item->id));
                    fwrite($bf, full_tag('CMID', 7, false, $item->cmid));
                    fwrite($bf, full_tag('BLOCKINSTANCE', 7, false, $item->blockinstance));
                    fwrite($bf, full_tag('POSITION', 7, false, $item->position));
                    fwrite($bf, full_tag('SORTORDER', 7, false, $item->sortorder));
                    fwrite($bf, full_tag('VISIBLE', 7, false, $item->visible));
                    fwrite($bf, end_tag('ITEM', 6, true));
                }
                fwrite($bf, end_tag('ITEMS', 5, true));
            }
            fwrite($bf, end_tag('PAGE', 4, true));
        }
        $status = fwrite($bf, end_tag('PAGES', 3, true));
    }
    return $status;
}
Пример #21
0
function groupselect_backup_one_mod($bf, $preferences, $groupselect)
{
    global $CFG;
    if (is_numeric($groupselect)) {
        $groupselect = get_record('groupselect', 'id', $groupselect);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $groupselect->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "groupselect"));
    fwrite($bf, full_tag("NAME", 4, false, $groupselect->name));
    fwrite($bf, full_tag("INTRO", 4, false, $groupselect->intro));
    fwrite($bf, full_tag("PASSWORD", 4, false, $groupselect->password));
    fwrite($bf, full_tag("TIMEAVAILABLE", 4, false, $groupselect->timeavailable));
    fwrite($bf, full_tag("TIMEDUE", 4, false, $groupselect->timedue));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $groupselect->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #22
0
function voiceauthoring_backup_one_mod($bf, $preferences, $voiceauthoring)
{
    global $CFG;
    if (is_numeric($voiceauthoring)) {
        $voiceauthoring = get_record('voiceauthoring', 'id', $voiceauthoring);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print voiceauthoring data
    fwrite($bf, full_tag("ID", 4, false, $voiceauthoring->id));
    fwrite($bf, full_tag("RID", 4, false, $voiceauthoring->rid));
    fwrite($bf, full_tag("MID", 4, false, $voiceauthoring->mid));
    fwrite($bf, full_tag("MODTYPE", 4, false, "voiceauthoring"));
    fwrite($bf, full_tag("COURSE", 4, false, $voiceauthoring->course));
    fwrite($bf, full_tag("NAME", 4, false, $voiceauthoring->name));
    fwrite($bf, full_tag("ACTIVITY_NAME", 4, false, $voiceauthoring->activityname));
    fwrite($bf, full_tag("SECTION", 4, false, $voiceauthoring->section));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $voiceauthoring->timemodified));
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #23
0
function bigbluebuttonbn_backup_one_mod($bf, $preferences, $bigbluebuttonbn)
{
    global $CFG;
    if (is_numeric($bigbluebuttonbn)) {
        $bigbluebuttonbn = get_record('bigbluebuttonbn', 'id', $bigbluebuttonbn);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print assignment data
    fwrite($bf, full_tag("ID", 4, false, $bigbluebuttonbn->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "bigbluebuttonbn"));
    fwrite($bf, full_tag("NAME", 4, false, $bigbluebuttonbn->name));
    fwrite($bf, full_tag("MODERATORPASS", 4, false, $bigbluebuttonbn->moderatorpass));
    fwrite($bf, full_tag("VIEWERPASS", 4, false, $bigbluebuttonbn->viewerpass));
    fwrite($bf, full_tag("WAIT", 4, false, $bigbluebuttonbn->wait));
    fwrite($bf, full_tag("MEETINGID", 4, false, $bigbluebuttonbn->meetingid));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $bigbluebuttonbn->timemodified));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #24
0
function openmeetings_backup_one_mod($bf, $preferences, $openmeetings)
{
    global $CFG;
    if (is_numeric($openmeetings)) {
        $openmeetings = get_record('openmeetings', 'id', $openmeetings);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print openmeetings data
    fwrite($bf, full_tag("ID", 4, false, $openmeetings->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "openmeetings"));
    fwrite($bf, full_tag("NAME", 4, false, $openmeetings->name));
    fwrite($bf, full_tag("INTRO", 4, false, $openmeetings->intro));
    fwrite($bf, full_tag("INTROFORMAT", 4, false, $openmeetings->introformat));
    fwrite($bf, full_tag("TIMEMODIFIED", 4, false, $openmeetings->timemodified));
    fwrite($bf, full_tag("TIMECREATED", 4, false, $openmeetings->timecreated));
    fwrite($bf, full_tag("ROOM_ID", 4, false, $openmeetings->room_id));
    fwrite($bf, full_tag("TEACHER", 4, false, $openmeetings->teacher));
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
}
//Backup podcast_items contents (executed from podcast_backup_mods)
function backup_podcast_items($bf, $preferences, $podcast)
{
    global $CFG;
    $status = true;
    $podcast_items = get_records("podcast_structure", "id_podcast", $podcast, "id");
    //If there is items
    if ($podcast_items) {
        //Write start tag
        $status = fwrite($bf, start_tag("ITEMS", 7, true));
        //Iterate over each item
        foreach ($podcast_items as $item) {
            //Start item
            $status = fwrite($bf, start_tag("ITEM", 8, true));
            //Print item contents
            fwrite($bf, full_tag("ID", 9, false, $item->id));
            fwrite($bf, full_tag("ID_PODCAST", 9, false, $item->id_podcast));
            fwrite($bf, full_tag("TITLE", 9, false, $item->title));
            fwrite($bf, full_tag("LIEN", 9, false, $item->lien));
            fwrite($bf, full_tag("INTRO", 9, false, $item->intro));
            fwrite($bf, full_tag("PUBDATE", 9, false, $item->pubdate));
            fwrite($bf, full_tag("DATE_HTML", 9, false, $item->date_html));
            fwrite($bf, full_tag("DURATION", 9, false, $item->duration));
            fwrite($bf, full_tag("LENGTH", 9, false, $item->length));
            //End submission
            $status = fwrite($bf, end_tag("ITEM", 8, true));
        }
        //Write end tag
        $status = fwrite($bf, end_tag("ITEMS", 7, true));
    }
    // Backup of files
    if ($status) {
        // backup files for this item.
        $status = backup_podcast_files_instance($bf, $preferences);
    }
Пример #26
0
function textanalysis_backup_one_mod($bf, $preferences, $textanalysis)
{
    global $CFG;
    if (is_numeric($textanalysis)) {
        $textanalysis = get_record('textanalysis', 'id', $textanalysis);
    }
    $status = true;
    //Start mod
    fwrite($bf, start_tag("MOD", 3, true));
    //Print textanalysis data
    fwrite($bf, full_tag("ID", 4, false, $textanalysis->id));
    fwrite($bf, full_tag("MODTYPE", 4, false, "textanalysis"));
    fwrite($bf, full_tag("COURSE", 4, false, $textanalysis->course));
    fwrite($bf, full_tag("TEACHER", 4, false, $textanalysis->teacher));
    fwrite($bf, full_tag("NAME", 4, false, $textanalysis->name));
    fwrite($bf, full_tag("INTRO", 4, false, $textanalysis->intro));
    fwrite($bf, full_tag("TYPE", 4, false, $textanalysis->type));
    fwrite($bf, full_tag("TIME", 4, false, $textanalysis->time));
    fwrite($bf, full_tag("TEXTANALYSISTIME", 4, false, time()));
    //if we've selected to backup users info, then execute backup_textanalysis_messages
    //End mod
    $status = fwrite($bf, end_tag("MOD", 3, true));
    return $status;
}
Пример #27
0
function poodllpairwork_backup_one_mod($bf, $preferences, $poodllpairwork)
{
    global $CFG;
    if (is_numeric($poodllpairwork)) {
        $poodllpairwork = get_record('poodllpairwork', 'id', $poodllpairwork);
    }
    $status = true;
    fwrite($bf, start_tag('MOD', 3, true));
    //Print choice data
    fwrite($bf, full_tag('MODTYPE', 4, false, 'poodllpairwork'));
    fwrite($bf, full_tag('ID', 4, false, $poodllpairwork->id));
    fwrite($bf, full_tag('COURSE', 4, false, 'poodllpairwork'));
    fwrite($bf, full_tag('NAME', 4, false, $poodllpairwork->name));
    fwrite($bf, full_tag('INTRO', 4, false, $poodllpairwork->intro));
    fwrite($bf, full_tag('INTROA', 4, false, $poodllpairwork->introa));
    fwrite($bf, full_tag('INTROB', 4, false, $poodllpairwork->introb));
    fwrite($bf, full_tag('SESSIONTYPE', 4, false, $poodllpairwork->sessiontype));
    fwrite($bf, full_tag('INTROFORMAT', 4, false, $poodllpairwork->introformat));
    fwrite($bf, full_tag('TIMECREATED', 4, false, $poodllpairwork->timecreated));
    fwrite($bf, full_tag('TIMEMODIFIED', 4, false, $poodllpairwork->timemodified));
    /// End mod
    $status = $status && fwrite($bf, end_tag('MOD', 3, true));
    return $status;
}
Пример #28
0
/**
 * Backup all link data for a given link instance
 *
 * @param object $bf Backup file
 * @param object $preferences Backup preferences
 * @param object $link A full link record object
 * @return boolean
 **/
function backup_pagemenu_link_data($bf, $preferences, $link)
{
    $status = true;
    if ($data = get_records('pagemenu_link_data', 'linkid', $link->id)) {
        fwrite($bf, start_tag('DATA', 6, true));
        foreach ($data as $datum) {
            fwrite($bf, start_tag('DATUM', 7, true));
            fwrite($bf, full_tag('ID', 8, false, $datum->id));
            fwrite($bf, full_tag('NAME', 8, false, $datum->name));
            fwrite($bf, full_tag('VALUE', 8, false, $datum->value));
            fwrite($bf, end_tag('DATUM', 7, true));
        }
        $status = fwrite($bf, end_tag('DATA', 6, true));
    }
    return $status;
}
Пример #29
0
 function backup($bf, $preferences, $question, $level = 6)
 {
     $status = true;
     $multianswers = get_records("question_multianswer", "question", $question, "id");
     //If there are multianswers
     if ($multianswers) {
         //Print multianswers header
         $status = fwrite($bf, start_tag("MULTIANSWERS", $level, true));
         //Iterate over each multianswer
         foreach ($multianswers as $multianswer) {
             $status = fwrite($bf, start_tag("MULTIANSWER", $level + 1, true));
             //Print multianswer contents
             fwrite($bf, full_tag("ID", $level + 2, false, $multianswer->id));
             fwrite($bf, full_tag("QUESTION", $level + 2, false, $multianswer->question));
             fwrite($bf, full_tag("SEQUENCE", $level + 2, false, $multianswer->sequence));
             $status = fwrite($bf, end_tag("MULTIANSWER", $level + 1, true));
         }
         //Print multianswers footer
         $status = fwrite($bf, end_tag("MULTIANSWERS", $level, true));
         //Now print question_answers
         $status = question_backup_answers($bf, $preferences, $question);
     }
     return $status;
 }
Пример #30
0
function backup_blended_team($bf, $preferences, $assignment)
{
    global $CFG;
    $status = true;
    $blended_teams = get_records("blended_team", "itemid", $assignmnent->id, "id");
    //If there is blended_teams
    if ($blended_teams) {
        //Write start tag
        $status = fwrite($bf, start_tag("BLENDED_TEAMS", 4, true));
        //Iterate over each blended_team
        foreach ($blended_teams as $blended_team) {
            //Start blended_team
            $status = fwrite($bf, start_tag("BLENDED_TEAM", 5, true));
            //Print blended_team contents
            fwrite($bf, full_tag("ID", 6, false, $blended_team->id));
            fwrite($bf, full_tag("ID_TEAM", 6, false, $blended_team->name_team));
            fwrite($bf, full_tag("USERID_LEADER", 6, false, $blended_team->userid_leader));
            //End blended_team
            $status = fwrite($bf, end_tag("BLENDED_TEAM", 5, true));
        }
        //Write end tag
        $status = fwrite($bf, end_tag("BLENDED_TEAMS", 4, true));
    }
    return $status;
}