protected function define_structure() { $lockdownbrowser = new backup_nested_element("lockdownbrowser", array("id"), array("course", "name", "intro", "introformat", "timecreated", "timemodified")); $settings = new backup_nested_element("settings", array("id"), array("course", "quizid", "attempts", "reviews", "password", "monitor")); $lockdownbrowser->add_child($settings); $lockdownbrowser->set_source_table("block_lockdownbrowser", array("id" => backup::VAR_BLOCKID)); $lockdownbrowser->set_source_table("block_lockdownbrowser_sett", array("course" => backup::VAR_COURSEID)); $settings->annotate_ids("quiz", "quizid"); return $this->prepare_block_structure($lockdownbrowser); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $groupselect = new backup_nested_element('groupselect', array('id'), array('course', 'name', 'intro', 'introformat', 'targetgrouping', 'signuptype', 'password', 'maxmembers', 'individual_limits', 'timeavailable', 'timedue', 'timecreated', 'timemodified')); $limits = new backup_nested_element('limits'); $limit = new backup_nested_element('limit', array('id'), array('groupselect', 'groupid', 'lim')); // Build the tree $groupselect->add_child($limits); $limits->add_child($limit); // Define sources $groupselect->set_source_table('groupselect', array('id' => backup::VAR_ACTIVITYID)); $limit->set_source_sql(' SELECT * FROM {groupselect_limits} WHERE groupselect = ?', array(backup::VAR_PARENTID)); // Define id annotations $groupselect->annotate_ids('grouping', 'targetgrouping'); $limit->annotate_ids('group', 'groupid'); // Define file annotations $groupselect->annotate_files('mod_groupselect', 'intro', null); // This file area hasn't itemid // Return the root element (groupselect), wrapped into standard activity structure return $this->prepare_activity_structure($groupselect); }
/** * Define the structure for the publication activity * @return void */ protected function define_structure() { // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. $publication = new backup_nested_element('publication', array('id'), array('name', 'intro', 'introformat', 'alwaysshowdescription', 'duedate', 'allowsubmissionsfromdate', 'timemodified', 'cutoffdate', 'mode', 'importfrom', 'obtainstudentapproval', 'maxfiles', 'maxbytes', 'allowedfiletypes', 'obtainteacherapproval')); $extduedates = new backup_nested_element('extduedates'); $extduedate = new backup_nested_element('extduedate', array('id'), array('userid', 'publication', 'extensionduedate')); $files = new backup_nested_element('files'); $file = new backup_nested_element('file', array('id'), array('userid', 'timecreated', 'fileid', 'filename', 'contenthash', 'type', 'teacherapproval', 'studentapproval')); // Define sources. $publication->set_source_table('publication', array('id' => backup::VAR_ACTIVITYID)); if ($userinfo) { // Build the tree. $publication->add_child($extduedates); $extduedates->add_child($extduedate); $publication->add_child($files); $files->add_child($file); $extduedate->set_source_table('publication_extduedates', array('publication' => backup::VAR_PARENTID)); $file->set_source_table('publication_file', array('publication' => backup::VAR_PARENTID)); $file->annotate_files('mod_publication', 'attachment', null); // Define id annotations. $extduedate->annotate_ids('user', 'userid'); $file->annotate_ids('user', 'userid'); // Define file annotations. // This file area hasn't itemid. $publication->annotate_files('mod_publication', 'attachment', null); } // Return the root element (publication), wrapped into standard activity structure. return $this->prepare_activity_structure($publication); }
/** * Define the structure for the assign activity * @return void */ protected function define_structure() { // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. $blended = new backup_nested_element('blended', array('id'), array('name', 'intro', 'introformat', 'idmethod', 'idtype', 'codebartype', 'lengthuserinfo', 'teammethod', 'numteams', 'nummembers', 'assignment', 'randomkey')); $teams = new backup_nested_element('teams'); $team = new backup_nested_element('team', array('id'), array('id_team', 'itemid', 'name_team', 'userid_leader')); $members = new backup_nested_element('members'); $member = new backup_nested_element('member', array('id'), array('userid', 'id_member', 'id_team', 'leader')); //Build the tree $blended->add_child($teams); $teams->add_child($team); $team->add_child($members); $members->add_child($member); // Define sources $blended->set_source_table('blended', array('id' => backup::VAR_ACTIVITYID)); //TODO remove blended_member estructure $member->set_source_table('blended_member', array('id_team' => backup::VAR_PARENTID)); //$team->set_source_table('blended_team', array('blendedid' => backup::VAR_PARENTID)); //$assign_grouping->set_source_table('blended_assign_grouping', array('blendedid' => backup::VAR_PARENTID)); //$member->set_source_table('blended_member', array('blendedid' => backup::VAR_PARENTID)); //$grade->set_source_table('blended_grade', array('blendedid' => backup::VAR_PARENTID)); //Anotate ids $team->annotate_ids('group', 'id_team'); $team->annotate_ids('user', 'userid_leader'); $member->annotate_ids('user', 'userid'); $member->annotate_ids('group', 'id_team'); // This file area hasn't itemid. $blended->annotate_files('mod_blended', 'intro', null); // Return the root element (blended), wrapped into standard activity structure. return $this->prepare_activity_structure($blended); }
protected function define_structure() { $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. $chat = new backup_nested_element('chat', array('id'), array('name', 'intro', 'introformat', 'keepdays', 'studentlogs', 'chattime', 'schedule', 'timemodified')); $messages = new backup_nested_element('messages'); $message = new backup_nested_element('message', array('id'), array('userid', 'groupid', 'system', 'message_text', 'timestamp')); // It is not cool to have two tags with same name, so we need to rename message field to message_text. $message->set_source_alias('message', 'message_text'); // Build the tree. $chat->add_child($messages); $messages->add_child($message); // Define sources. $chat->set_source_table('chat', array('id' => backup::VAR_ACTIVITYID)); // User related messages only happen if we are including user info. if ($userinfo) { $message->set_source_table('chat_messages', array('chatid' => backup::VAR_PARENTID)); } // Define id annotations. $message->annotate_ids('user', 'userid'); $message->annotate_ids('group', 'groupid'); // Annotate the file areas in chat module. $chat->annotate_files('mod_chat', 'intro', null); // The chat_intro area doesn't use itemid. // Return the root element (chat), wrapped into standard activity structure. return $this->prepare_activity_structure($chat); }
protected function define_structure() { // Define each element separated $dialogue = new backup_nested_element('dialogue', array('id'), array('course', 'deleteafter', 'dialoguetype', 'multipleconversations', 'maildefault', 'timemodified', 'name', 'intro', 'edittime')); $conversations = new backup_nested_element('conversations'); $conversation = new backup_nested_element('conversation', array('id'), array('dialogueid', 'userid', 'recipientid', 'lastid', 'lastrecipientid', 'timemodified', 'closed', 'seenon', 'ctype', 'format', 'subject', 'groupid', 'grouping')); $entries = new backup_nested_element('entries'); $entry = new backup_nested_element('entry', array('id'), array('dialogueid', 'conversationid', 'userid', 'recipientid', 'timecreated', 'timemodified', 'mailed', 'text', 'attachment')); $readentries = new backup_nested_element('read_entries'); $read = new backup_nested_element('read_entry', array('id'), array('entryid', 'userid', 'firstread', 'lastread', 'conversationid')); // Build the tree $dialogue->add_child($conversations); $conversations->add_child($conversation); $conversation->add_child($entries); $entries->add_child($entry); $conversation->add_child($readentries); $readentries->add_child($read); // Define sources $dialogue->set_source_table('dialogue', array('id' => backup::VAR_ACTIVITYID)); $conversation->set_source_table('dialogue_conversations', array('dialogueid' => backup::VAR_PARENTID)); $entry->set_source_table('dialogue_entries', array('conversationid' => backup::VAR_PARENTID)); $read->set_source_table('dialogue_read', array('conversationid' => backup::VAR_PARENTID)); // Define id annotations $conversation->annotate_ids('user', 'userid'); $conversation->annotate_ids('user', 'recipientid'); $entry->annotate_ids('user', 'userid'); $entry->annotate_ids('user', 'recipientid'); $read->annotate_ids('user', 'userid'); // Define file annotations $dialogue->annotate_files('mod_dialogue', 'intro', null); // This file area hasn't itemid $entry->annotate_files('mod_dialogue', 'attachment', 'id'); // Return the root element, wrapped into standard activity structure return $this->prepare_activity_structure($dialogue); }
protected function define_structure() { global $CFG; // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $certificate = new backup_nested_element('simplecertificate', array('id'), array('name', 'intro', 'introformat', 'timemodified', 'width', 'height', 'certificateimage', 'certificatetext', 'certificatetextformat', 'certificatetextx', 'certificatetexty', 'coursename', 'coursehours', 'outcome', 'certdate', 'certdatefmt', 'certgrade', 'gradefmt', 'emailfrom', 'emailothers', 'emailteachers', 'reportcert', 'delivery', 'requiredtime', 'printqrcode', 'qrcodefirstpage', 'codex', 'codey', 'enablesecondpage', 'secondpagex', 'secondpagey', 'secondpagetext', 'secondpagetextformat', 'secondimage', 'timestartdatefmt')); $issues = new backup_nested_element('issues'); $issue = new backup_nested_element('issue', array('id'), array('userid', 'certificatename', 'timecreated', 'code', 'timedeleted')); // Build the tree $certificate->add_child($issues); $issues->add_child($issue); // Define sources $certificate->set_source_table('simplecertificate', array('id' => backup::VAR_ACTIVITYID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $issue->set_source_table('simplecertificate_issues', array('certificateid' => backup::VAR_PARENTID)); } // Annotate the user id's where required. $certificate->annotate_ids('outcome', 'outcome'); $certificate->annotate_ids('certdate', 'certdate'); $certificate->annotate_ids('certgrade', 'certgrade'); $issue->annotate_ids('user', 'userid'); // Define file annotations //$certificate->annotate_files('mod_simplecertificate', 'intro', null); $certificate->annotate_files(simplecertificate::CERTIFICATE_COMPONENT_NAME, simplecertificate::CERTIFICATE_IMAGE_FILE_AREA, null); $issue->annotate_files(simplecertificate::CERTIFICATE_COMPONENT_NAME, simplecertificate::CERTIFICATE_ISSUES_FILE_AREA, 'id'); // Return the root element (certificate), wrapped into standard activity structure return $this->prepare_activity_structure($certificate); }
protected function define_structure() { $equella = new backup_nested_element('equella', array('id'), array('course', 'name', 'intro', 'introformat', 'timecreated', 'timemodified', 'url', 'mimetype', 'popup', 'activation', 'uuid', 'version', 'path', 'attachmentuuid', 'ltisalt')); $equella->set_source_table('equella', array('id' => backup::VAR_ACTIVITYID)); $equella->annotate_files('mod_equella', 'intro', null); return $this->prepare_activity_structure($equella); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $voiceshadow = new backup_nested_element('voiceshadow', array('id'), array('course', 'name', 'intro', 'introformat', 'timeopen', 'timeclose', 'teacher', 'embedvideo', 'recordtype', 'timemodified')); $files = new backup_nested_element('files', array('id'), array('instance', 'userid', 'summary', 'itemoldid', 'itemid', 'itemimgid', 'filename', 'time')); $ratings = new backup_nested_element('ratings', array('id'), array('fileid', 'userid', 'rating', 'ratingrhythm', 'ratingclear', 'ratingintonation', 'ratingspeed', 'ratingreproduction', 'summary', 'time')); $comments = new backup_nested_element('comments', array('id'), array('instance', 'fileid', 'userid', 'summary', 'itemoldid', 'itemid', 'itemimgid', 'filename', 'time')); $process = new backup_nested_element('process', array('id'), array('itemid', 'type')); // Build the tree $voiceshadow->add_child($files); $voiceshadow->add_child($ratings); $voiceshadow->add_child($comments); $voiceshadow->add_child($process); // Define sources $voiceshadow->set_source_table('voiceshadow', array('id' => backup::VAR_ACTIVITYID, 'course' => backup::VAR_COURSEID)); $files->set_source_table('voiceshadow_files', array('instance' => backup::VAR_ACTIVITYID)); $comments->set_source_table('voiceshadow_comments', array('instance' => backup::VAR_ACTIVITYID)); // Define id annotations $voiceshadow->annotate_ids('teacher', 'userid'); $files->annotate_ids('userid', 'userid'); $ratings->annotate_ids('userid', 'userid'); $comments->annotate_ids('userid', 'userid'); // Return the root element (voiceshadow), wrapped into standard activity structure return $this->prepare_activity_structure($voiceshadow); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $geogebra = new backup_nested_element('geogebra', array('id'), array('name', 'intro', 'introformat', 'url', 'attributes', 'width', 'height', 'showsubmit', 'grade', 'autograde', 'maxattempts', 'grademethod', 'timeavailable', 'timedue', 'timecreated', 'timemodified')); $attempts = new backup_nested_element('attempts'); $attempt = new backup_nested_element('attempt', array('id'), array('geogebra', 'userid', 'vars', 'gradecomment', 'finished', 'dateteacher', 'datestudent')); // Build the tree $geogebra->add_child($attempts); $attempts->add_child($attempt); // Define sources $geogebra->set_source_table('geogebra', array('id' => backup::VAR_ACTIVITYID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $attempt->set_source_table('geogebra_attempts', array('geogebra' => backup::VAR_PARENTID)); } // Define id annotations $geogebra->annotate_ids('scale', 'grade'); $attempt->annotate_ids('user', 'userid'); // Define file annotations $geogebra->annotate_files('mod_geogebra', 'intro', null); // This file area hasn't itemid $geogebra->annotate_files('mod_geogebra', 'content', null); // This file area hasn't itemid // Return the root element (geogebra), wrapped into standard activity structure return $this->prepare_activity_structure($geogebra); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $hvp = new backup_nested_element('hvp', array('id'), array('course', 'name', 'json_content', 'embed_type', 'disable', 'main_library_id', 'content_type', 'author', 'license', 'meta_keywords', 'meta_description', 'filtered', 'slug', 'timecreated', 'timemodified')); $hvp_libraries = new backup_nested_element('libraries'); $hvp_library = new backup_nested_element('library', null, array('machine_name', 'major_version', 'minor_version', 'patch_version', 'dependency_type', 'drop_css', 'weight')); $content_user_data_entries = new backup_nested_element('content_user_data'); $content_user_data = new backup_nested_element('entry', array('id'), array('user_id', 'hvp_id', 'sub_content_id', 'data_id', 'data', 'preloaded', 'delete_on_content_change')); // Build the tree $hvp->add_child($content_user_data_entries); $content_user_data_entries->add_child($content_user_data); $hvp->add_child($hvp_libraries); $hvp_libraries->add_child($hvp_library); // Define sources $hvp->set_source_table('hvp', array('id' => backup::VAR_ACTIVITYID)); $lib_sql = "SELECT\n machine_name,\n major_version,\n minor_version,\n patch_version,\n dependency_type,\n drop_css,\n weight\n FROM {hvp_libraries} hl\n JOIN {hvp_contents_libraries} hcl\n ON hl.id = hcl.library_id\n JOIN {hvp} h\n ON h.id = hcl.hvp_id\n WHERE h.id = ?"; $hvp_library->set_source_sql($lib_sql, array(backup::VAR_ACTIVITYID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $content_user_data->set_source_table('hvp_content_user_data', array('hvp_id' => backup::VAR_PARENTID), 'id ASC'); } // Define id annotations $content_user_data->annotate_ids('user', 'user_id'); // Define file annotations $hvp->annotate_files('mod_hvp', 'content', null); // Return the root element (hvp), wrapped into standard activity structure return $this->prepare_activity_structure($hvp); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $groupselect = new backup_nested_element('groupselect', array('id'), array('name', 'intro', 'introformat', 'targetgrouping', 'maxmembers', 'timeavailable', 'timedue', 'timecreated', 'timemodified', 'hidefullgroups', 'deleteemptygroups', 'studentcancreate', 'minmembers', 'assignteachers', 'studentcansetdesc', 'showassignedteacher', 'studentcansetenrolmentkey', 'studentcansetgroupname', 'notifyexpiredselection')); $passwords = new backup_nested_element('passwords'); $password = new backup_nested_element('password', array('id'), array('groupid', 'password')); $groupteachers = new backup_nested_element('groupteachers'); $groupteacher = new backup_nested_element('groupteacher', array('id'), array('groupid', 'teacherid')); // Build the tree $groupselect->add_child($passwords); $passwords->add_child($password); $groupselect->add_child($groupteachers); $groupteachers->add_child($groupteacher); // Define sources $groupselect->set_source_table('groupselect', array('id' => backup::VAR_ACTIVITYID)); $password->set_source_table('groupselect_passwords', array('instance_id' => backup::VAR_ACTIVITYID)); if ($userinfo) { $groupteacher->set_source_table('groupselect_groups_teachers', array('instance_id' => backup::VAR_ACTIVITYID)); } // Define id annotations $groupselect->annotate_ids('grouping', 'targetgrouping'); $password->annotate_ids('group', 'groupid'); $groupteacher->annotate_ids('group', 'groupid'); $groupteacher->annotate_ids('user', 'teacherid'); // Define file annotations $groupselect->annotate_files('mod_groupselect', 'intro', null); // This file areas haven't itemid // Return the root element (groupselect), wrapped into standard activity structure return $this->prepare_activity_structure($groupselect); }
protected function define_structure() { // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. $teambuilder = new backup_nested_element('teambuilder', array('id'), array('course', 'name', 'intro', 'introformat', 'open', 'close', 'groupid', 'allowupdate')); $questions = new backup_nested_element('questions'); $question = new backup_nested_element('question', array('id'), array('builder', 'question', 'type', 'display', 'ordinal')); $answers = new backup_nested_element('answers'); $answer = new backup_nested_element('answer', array('id'), array('question', 'answer', 'ordinal')); $responses = new backup_nested_element('responses'); $response = new backup_nested_element('response', array('id'), array('userid', 'answerid')); // Build the tree. $teambuilder->add_child($questions); $questions->add_child($question); $question->add_child($answers); $answers->add_child($answer); $answer->add_child($responses); $responses->add_child($response); // Define sources. $teambuilder->set_source_table('teambuilder', array('id' => backup::VAR_ACTIVITYID)); $question->set_source_table('teambuilder_question', array('builder' => backup::VAR_PARENTID)); $answer->set_source_table('teambuilder_answer', array('question' => backup::VAR_PARENTID)); // All the rest of elements only happen if we are including user info. if ($userinfo) { $response->set_source_table('teambuilder_response', array('answerid' => backup::VAR_PARENTID)); } $teambuilder->annotate_ids('group', 'groupid'); $response->annotate_ids('user', 'userid'); // Define file annotations. $teambuilder->annotate_files('mod_teambuilder', 'intro', null); // Return the root element (teambuilder), wrapped into standard activity structure. return $this->prepare_activity_structure($teambuilder); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $jclic = new backup_nested_element('jclic', array('id'), array('name', 'intro', 'introformat', 'url', 'skin', 'maxattempts', 'width', 'height', 'avaluation', 'maxgrade', 'grade', 'lang', 'exiturl', 'timeavailable', 'timedue')); $sessions = new backup_nested_element('sessions'); $session = new backup_nested_element('session', array('id'), array('session_id', 'user_id', 'session_datetime', 'project_name', 'session_key', 'session_code', 'session_context')); $activities = new backup_nested_element('sessionactivities'); $activity = new backup_nested_element('sessionactivity', array('id'), array('session_id', 'activity_id', 'activity_name', 'num_actions', 'score', 'activity_solved', 'qualification', 'total_time', 'activity_code')); // Build the tree $jclic->add_child($sessions); $sessions->add_child($session); $session->add_child($activities); $activities->add_child($activity); // Define sources $jclic->set_source_table('jclic', array('id' => backup::VAR_ACTIVITYID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $session->set_source_table('jclic_sessions', array('jclicid' => backup::VAR_PARENTID)); $activity->set_source_table('jclic_activities', array('session_id' => '../../session_id')); } // Define id annotations $jclic->annotate_ids('scale', 'grade'); $session->annotate_ids('user', 'user_id'); // Define file annotations $jclic->annotate_files('mod_jclic', 'intro', null); // This file area hasn't itemid $jclic->annotate_files('mod_jclic', 'content', null); // This file area hasn't itemid // Return the root element (jclic), wrapped into standard activity structure return $this->prepare_activity_structure($jclic); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $scheduler = new backup_nested_element('scheduler', array('id'), array('name', 'intro', 'introformat', 'schedulermode', 'maxbookings', 'guardtime', 'defaultslotduration', 'allownotifications', 'staffrolename', 'scale', 'gradingstrategy', 'bookingrouping', 'timemodified')); $slots = new backup_nested_element('slots'); $slot = new backup_nested_element('slot', array('id'), array('starttime', 'duration', 'teacherid', 'appointmentlocation', 'timemodified', 'notes', 'exclusivity', 'appointmentnote', 'emaildate', 'hideuntil')); $appointments = new backup_nested_element('appointments'); $appointment = new backup_nested_element('appointment', array('id'), array('studentid', 'attended', 'grade', 'appointmentnote', 'timecreated', 'timemodified')); // Build the tree $scheduler->add_child($slots); $slots->add_child($slot); $slot->add_child($appointments); $appointments->add_child($appointment); // Define sources $scheduler->set_source_table('scheduler', array('id' => backup::VAR_ACTIVITYID)); $scheduler->annotate_ids('grouping', 'bookingrouping'); // Include appointments only if we back up user information if ($userinfo) { $slot->set_source_table('scheduler_slots', array('schedulerid' => backup::VAR_PARENTID)); $appointment->set_source_table('scheduler_appointment', array('slotid' => backup::VAR_PARENTID)); } // Define id annotations $scheduler->annotate_ids('scale', 'scale'); if ($userinfo) { $slot->annotate_ids('user', 'teacherid'); $appointment->annotate_ids('user', 'studentid'); } // Define file annotations $scheduler->annotate_files('mod_scheduler', 'intro', null); // This file area has no itemid // Return the root element (scheduler), wrapped into standard activity structure return $this->prepare_activity_structure($scheduler); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $elluminate = new backup_nested_element('elluminate', array('id'), array('meetingid', 'meetinginit', 'course', 'creator', 'sessiontype', 'groupingid', 'groupmode', 'groupid', 'groupparentid', 'name', 'sessionname', 'description', 'intro', 'introformat', 'customname', 'customdescription', 'timestart', 'timeend', 'recordingmode', 'boundarytime', 'boundarytimedisplay', 'maxtalkers', 'chairlist', 'nonchairlist', 'grade', 'timemodified')); $recordings = new backup_nested_element('recordings'); $recording = new backup_nested_element('recording', array('id'), array('meetingid', 'recordingid', 'description', 'recordingsize', 'visible', 'groupvisible', 'created')); $preloads = new backup_nested_element('preloads'); $preload = new backup_nested_element('preload', array('id'), array('meetingid', 'presentationid', 'description', 'size', 'creatorid')); $attendance = new backup_nested_element('attendance'); $attendee = new backup_nested_element('attendee', array('id'), array('userid', 'elluminateid', 'grade', 'timemodified')); // Build the tree $elluminate->add_child($recordings); $recordings->add_child($recording); $elluminate->add_child($preloads); $preloads->add_child($preload); $elluminate->add_child($attendance); $attendance->add_child($attendee); // Define sources $elluminate->set_source_table('elluminate', array('id' => backup::VAR_ACTIVITYID)); $recording->set_source_table('elluminate_recordings', array('meetingid' => '../../meetingid')); $preload->set_source_table('elluminate_preloads', array('meetingid' => '../../meetingid')); // All the rest of elements only happen if we are including user info if ($userinfo) { $attendance->set_source_table('elluminate_attendance', array('elluminateid' => backup::VAR_ACTIVITYID)); } // Define id annotations // Define file annotations // Return the root element (elluminate), wrapped into standard activity structure return $this->prepare_activity_structure($elluminate); }
/** * The settings table is a bit simpler, since no files are used. * Simply create the backup element and then grab the information * from the database. * */ protected function define_structure() { // Notice the use of 'setting' here rather than 'settings', this is how it gets written to the XML file. $nursnavigationsettings = new backup_nested_element('nurs_navigation_setting', array('id'), array('courseid', 'sectionname', 'disableicon', 'customlabel')); $nursnavigationsettings->set_source_table('nurs_navigation_settings', array('courseid' => backup::VAR_COURSEID)); return $this->prepare_block_structure($nursnavigationsettings); }
protected function define_structure() { // Define each element separated $organizer = new backup_nested_element('organizer', array('id'), array('course', 'name', 'intro', 'introformat', 'timemodified', 'isgrouporganizer', 'emailteachers', 'allowregistrationsfromdate', 'duedate', 'relativedeadline', 'grade')); $slots = new backup_nested_element('slots'); $slot = new backup_nested_element('slot', array('id'), array('organizerid', 'starttime', 'duration', 'location', 'locationlink', 'maxparticipants', 'teacherid', 'isanonymous', 'availablefrom', 'timemodified', 'notificationtime', 'comments', 'teachervisible', 'eventid', 'notified')); $appointments = new backup_nested_element('appointments'); $appointment = new backup_nested_element('appointment', array('id'), array('slotid', 'userid', 'groupid', 'applicantid', 'registrationtime', 'attended', 'grade', 'feedback', 'comments', 'eventid', 'notified', 'allownewappointments')); // Build the tree $organizer->add_child($slots); $slots->add_child($slot); $slot->add_child($appointments); $appointments->add_child($appointment); // Define sources $organizer->set_source_table('organizer', array('id' => backup::VAR_ACTIVITYID)); // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); if ($userinfo) { $slot->set_source_table('organizer_slots', array('organizerid' => backup::VAR_PARENTID)); $appointment->set_source_table('organizer_slot_appointments', array('slotid' => backup::VAR_PARENTID)); } // Annotate the user id's where required. $slot->annotate_ids('user', 'teacherid'); $appointment->annotate_ids('user', 'userid'); $appointment->annotate_ids('user', 'applicantid'); $appointment->annotate_ids('group', 'groupid'); // Return the root element (organizer), wrapped into standard activity structure return $this->prepare_activity_structure($organizer); }
/** * Define the structure of the backup file. * * @return backup_nested_element */ protected function define_structure() { // The instance. $customcert = new backup_nested_element('customcert', array('id'), array('name', 'intro', 'introformat', 'requiredtime', 'protection', 'timecreated', 'timemodified')); // The issues. $issues = new backup_nested_element('issues'); $issue = new backup_nested_element('issue', array('id'), array('customcertid', 'userid', 'timecreated', 'code')); // The pages. $pages = new backup_nested_element('pages'); $page = new backup_nested_element('page', array('id'), array('customcertid', 'width', 'height', 'margin', 'pagenumber', 'timecreated', 'timemodified')); // The elements. $element = new backup_nested_element('element', array('id'), array('pageid', 'name', 'element', 'data', 'font', 'size', 'colour', 'width', 'refpoint', 'align', 'posx', 'posy', 'sequence', 'timecreated', 'timemodified')); // Build the tree. $customcert->add_child($issues); $issues->add_child($issue); $customcert->add_child($pages); $pages->add_child($page); $page->add_child($element); // Define sources. $customcert->set_source_table('customcert', array('id' => backup::VAR_ACTIVITYID)); // Define page source. $page->set_source_table('customcert_pages', array('customcertid' => backup::VAR_ACTIVITYID)); // Define element source, each element belongs to a page. $element->set_source_table('customcert_elements', array('pageid' => backup::VAR_PARENTID)); // If we are including user info then save the issues. if ($this->get_setting_value('userinfo')) { $issue->set_source_table('customcert_issues', array('customcertid' => backup::VAR_ACTIVITYID)); } // Annotate the user id's where required. $issue->annotate_ids('user', 'userid'); // Return the root element (customcert), wrapped into standard activity structure. return $this->prepare_activity_structure($customcert); }
/** * Used in activity_task * * @return prepared structure of elang for activity task */ protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $elang = new backup_nested_element('elang', array('id'), array('course', 'name', 'intro', 'introformat', 'timecreated', 'timemodified', 'language', 'options')); $cues = new backup_nested_element('cues'); $cue = new backup_nested_element('cue', array('id'), array('id_elang', 'number', 'begin', 'end', 'title', 'json')); $users = new backup_nested_element('users'); $user = new backup_nested_element('user', array('id'), array('id_user', 'json')); // Build the tree $elang->add_child($cues); $cues->add_child($cue); $cue->add_child($users); $users->add_child($user); // Define sources $elang->set_source_table('elang', array('id' => backup::VAR_ACTIVITYID)); $cue->set_source_table('elang_cues', array('id_elang' => backup::VAR_PARENTID), 'id ASC'); // Define source for users if userinfo is set if ($userinfo) { $user->set_source_table('elang_users', array('id_cue' => backup::VAR_PARENTID), 'id ASC'); } // Define id annotations $user->annotate_ids('user', 'id_user'); // Define file annotations-These files areas haven't itemid $elang->annotate_files('mod_elang', 'videos', null); $elang->annotate_files('mod_elang', 'poster', null); $elang->annotate_files('mod_elang', 'subtitle', null); // Return the root element (elang), wrapped into standard activity structure return $this->prepare_activity_structure($elang); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $certificate = new backup_nested_element('certificate', array('id'), array('name', 'intro', 'introformat', 'emailteachers', 'emailothers', 'savecert', 'reportcert', 'delivery', 'certificatetype', 'orientation', 'borderstyle', 'bordercolor', 'printwmark', 'printdate', 'datefmt', 'printnumber', 'printgrade', 'gradefmt', 'printoutcome', 'printhours', 'printteacher', 'customtext', 'printsignature', 'printseal', 'timecreated', 'timemodified')); $issues = new backup_nested_element('issues'); $issue = new backup_nested_element('issue', array('id'), array('certificateid', 'userid', 'timecreated', 'code')); // Build the tree $certificate->add_child($issues); $issues->add_child($issue); // Define sources $certificate->set_source_table('certificate', array('id' => backup::VAR_ACTIVITYID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $issue->set_source_table('certificate_issues', array('certificateid' => backup::VAR_PARENTID)); } // Annotate the user id's where required. $issue->annotate_ids('user', 'userid'); // Define file annotations $certificate->annotate_files('mod_certificate', 'intro', null); // This file area hasn't itemid $issue->annotate_files('mod_certificate', 'issue', 'id'); // Return the root element (certificate), wrapped into standard activity structure return $this->prepare_activity_structure($certificate); }
protected function define_structure() { // To know if we are including userinfo. $userinfo = $this->get_setting_value('userinfo'); // Define each element separated. $lightboxgallery = new backup_nested_element('lightboxgallery', array('id'), array('course', 'folder', 'name', 'perpage', 'comments', 'extinfo', 'timemodified', 'ispublic', 'rss', 'autoresize', 'resize', 'perrow', 'captionfull', 'captionpos', 'intro', 'introformat')); $comments = new backup_nested_element('usercomments'); $comment = new backup_nested_element('comment', array('id'), array('gallery', 'userid', 'commenttext', 'timemodified')); $imagemetas = new backup_nested_element('image_metas'); $imagemeta = new backup_nested_element('image_meta', array('id'), array('gallery', 'image', 'description', 'metatype')); // Build the tree. $lightboxgallery->add_child($comments); $comments->add_child($comment); $lightboxgallery->add_child($imagemetas); $imagemetas->add_child($imagemeta); // Define sources. $lightboxgallery->set_source_table('lightboxgallery', array('id' => backup::VAR_ACTIVITYID)); $imagemeta->set_source_table('lightboxgallery_image_meta', array('gallery' => backup::VAR_PARENTID)); // All the rest of elements only happen if we are including user info. if ($userinfo) { $comment->set_source_table('lightboxgallery_comments', array('gallery' => backup::VAR_PARENTID)); } // Define file annotations. $lightboxgallery->annotate_files('mod_lightboxgallery', 'gallery_images', null); $lightboxgallery->annotate_files('mod_lightboxgallery', 'gallery_thumbs', null); $lightboxgallery->annotate_files('mod_lightboxgallery', 'gallery_index', null); $lightboxgallery->annotate_files('mod_lightboxgallery', 'intro', null); $comment->annotate_ids('user', 'userid'); // Return the root element (lightboxgallery), wrapped into standard activity structure. return $this->prepare_activity_structure($lightboxgallery); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $choice = new backup_nested_element('choice', array('id'), array('name', 'intro', 'introformat', 'publish', 'showresults', 'display', 'allowupdate', 'allowunanswered', 'limitanswers', 'timeopen', 'timeclose', 'timemodified', 'completionsubmit')); $options = new backup_nested_element('options'); $option = new backup_nested_element('option', array('id'), array('text', 'maxanswers', 'timemodified')); $answers = new backup_nested_element('answers'); $answer = new backup_nested_element('answer', array('id'), array('userid', 'optionid', 'timemodified')); // Build the tree $choice->add_child($options); $options->add_child($option); $choice->add_child($answers); $answers->add_child($answer); // Define sources $choice->set_source_table('choice', array('id' => backup::VAR_ACTIVITYID)); $option->set_source_sql(' SELECT * FROM {choice_options} WHERE choiceid = ?', array(backup::VAR_PARENTID)); // All the rest of elements only happen if we are including user info if ($userinfo) { $answer->set_source_table('choice_answers', array('choiceid' => '../../id')); } // Define id annotations $answer->annotate_ids('user', 'userid'); // Define file annotations $choice->annotate_files('mod_choice', 'intro', null); // This file area hasn't itemid // Return the root element (choice), wrapped into standard activity structure return $this->prepare_activity_structure($choice); }
protected function define_structure() { $journal = new backup_nested_element('journal', array('id'), array('name', 'intro', 'introformat', 'days', 'grade', 'timemodified')); $entries = new backup_nested_element('entries'); $entry = new backup_nested_element('entry', array('id'), array('userid', 'modified', 'text', 'format', 'rating', 'entrycomment', 'teacher', 'timemarked', 'mailed')); // journal -> entries -> entry $journal->add_child($entries); $entries->add_child($entry); // Sources $journal->set_source_table('journal', array('id' => backup::VAR_ACTIVITYID)); if ($this->get_setting_value('userinfo')) { $entry->set_source_table('journal_entries', array('journal' => backup::VAR_PARENTID)); } // Define id annotations $entry->annotate_ids('user', 'userid'); $entry->annotate_ids('user', 'teacher'); // Define file annotations $journal->annotate_files('mod_journal', 'intro', null); // This file areas haven't itemid $entry->annotate_files('mod_journal_entries', 'text', null); // This file areas haven't itemid $entry->annotate_files('mod_journal_entries', 'entrycomment', null); // This file areas haven't itemid return $this->prepare_activity_structure($journal); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $survey = new backup_nested_element('survey', array('id'), array('name', 'intro', 'introformat', 'template', 'questions', 'days', 'timecreated', 'timemodified', 'completionsubmit')); $answers = new backup_nested_element('answers'); $answer = new backup_nested_element('answer', array('id'), array('userid', 'question', 'time', 'answer1', 'answer2')); $analysis = new backup_nested_element('analysis'); $analys = new backup_nested_element('analys', array('id'), array('userid', 'notes')); // Build the tree $survey->add_child($answers); $answers->add_child($answer); $survey->add_child($analysis); $analysis->add_child($analys); // Define sources $survey->set_source_table('survey', array('id' => backup::VAR_ACTIVITYID)); $answer->set_source_table('survey_answers', array('survey' => backup::VAR_PARENTID)); $analys->set_source_table('survey_analysis', array('survey' => backup::VAR_PARENTID)); // Define id annotations $answer->annotate_ids('user', 'userid'); $analys->annotate_ids('user', 'userid'); // Define file annotations $survey->annotate_files('mod_survey', 'intro', null); // This file area hasn't itemid // Return the root element (survey), wrapped into standard activity structure return $this->prepare_activity_structure($survey); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element $attendanceregister = new backup_nested_element('attendanceregister', array('id'), array('name', 'intro', 'introformat', 'type', 'offlinesessions', 'sessiontimeout', 'dayscertificable', 'offlinecomments', 'mandatoryofflinecomm', 'offlinespecifycourse', 'mandofflspeccourse', 'timemodified', 'completiontotaldurationmins')); $sessions = new backup_nested_element('sessions'); $session = new backup_nested_element('session', array('id'), array('userid', 'login', 'logout', 'duration', 'onlinesess', 'refcourseshortname', 'comments', 'addedbyuserid')); // Builds the tree $attendanceregister->add_child($sessions); $sessions->add_child($session); // Define sources $attendanceregister->set_source_table('attendanceregister', array('id' => backup::VAR_ACTIVITYID)); if ($userinfo) { $session->set_source_sql(' SELECT s.id, s.register, s.userid, s.login, s.logout, s.duration, s.onlinesess, s.comments, c.shortname AS refcourseshortname, s.addedbyuserid FROM {attendanceregister_session} s LEFT JOIN {course} c ON c.id = s.refcourse WHERE s.register = ? AND s.onlinesess = 0 ', array(backup::VAR_PARENTID)); } // Define ID annotations $session->annotate_ids('user', 'userid'); $session->annotate_ids('user', 'addedbyuserid'); // Define file annotations $attendanceregister->annotate_files('mod_attendanceregister', 'intro', null); // This file area hasn't itemid // Return the root element (attendanceregister), wrapped into standard activity structure return $this->prepare_activity_structure($attendanceregister); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $folder = new backup_nested_element('folder', array('id'), array( 'name', 'intro', 'introformat', 'revision', 'timemodified')); // Build the tree // (nice mono-tree, lol) // Define sources $folder->set_source_table('folder', array('id' => backup::VAR_ACTIVITYID)); // Define id annotations // (none) // Define file annotations $folder->annotate_files('mod_folder', 'intro', null); $folder->annotate_files('mod_folder', 'content', null); // Return the root element (folder), wrapped into standard activity structure return $this->prepare_activity_structure($folder); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $imscp = new backup_nested_element('imscp', array('id'), array('name', 'intro', 'introformat', 'revision', 'keepold', 'structure', 'timemodified')); // Build the tree // (love this) // Define sources $imscp->set_source_table('imscp', array('id' => backup::VAR_ACTIVITYID)); // Define id annotations // (none) // Define file annotations $imscp->annotate_files('mod_imscp', 'intro', null); // This file area hasn't itemid $imscp->annotate_files('mod_imscp', 'backup', null); // This file area hasn't itemid /** * I don't like itemid used for "imaginative" things like "revisions"! * I don't like itemid used for "imaginative" things like "revisions"! * I don't like itemid used for "imaginative" things like "revisions"! */ $imscp->annotate_files('mod_imscp', 'content', null); // Horrible use of itemid here. Ignoring for backup/restore purposes // Return the root element (imscp), wrapped into standard activity structure return $this->prepare_activity_structure($imscp); }
protected function define_structure() { $userinfo = $this->get_setting_value('userinfo'); $bootstrapelements = new backup_nested_element('bootstrapelements', array('id'), array('name', 'intro', 'introformat', 'timemodified', 'title', 'bootstraptype', 'bootstrapicon')); $bootstrapelements->set_source_table('bootstrapelements', array('id' => backup::VAR_ACTIVITYID)); $bootstrapelements->annotate_files('mod_bootstrapelements', 'intro', null); return $this->prepare_activity_structure($bootstrapelements); }
protected function define_structure() { // To know if we are including userinfo $userinfo = $this->get_setting_value('userinfo'); // Define each element separated $webinar = new backup_nested_element('webinar', array('id'), array('course', 'name', 'description', 'agenda', 'sitexmlapiurl', 'adminpassword', 'adminemail')); $sessions = new backup_nested_element('sessions'); $session = new backup_nested_element('session', array('id'), array('webinar', 'capacity', 'presenter', 'scoid', 'urlpath', 'timecreated', 'timemodified')); $signups = new backup_nested_element('signups'); $signup = new backup_nested_element('signup', array('id'), array('sessionid', 'userid', 'mailedreminder', 'discountcode', 'notificationtype')); $signups_status = new backup_nested_element('signups_status'); $signup_status = new backup_nested_element('signup_status', array('id'), array('signupid', 'statuscode', 'superceded', 'grade', 'note', 'advice', 'createdby', 'timecreated')); $session_roles = new backup_nested_element('session_roles'); $session_role = new backup_nested_element('session_role', array('id'), array('sessionid', 'roleid', 'userid')); $session_data = new backup_nested_element('session_data'); //May need to replace first item 'data' with better value $session_data_element = new backup_nested_element('data', array('id'), array('fieldid', 'sessionid', 'data')); //$session_field = new backup_nested_element('session_field'); //May need to replace first item 'field' with better value /*$session_field_element = new backup_nested_element('field', array('id'), array( 'name', 'shortname', 'type', 'possiblevalues', 'required', 'defaultvalue', 'isfilter', 'showinsummary'));*/ $sessions_dates = new backup_nested_element('sessions_dates'); $sessions_date = new backup_nested_element('sessions_date', array('id'), array('sessionid', 'timestart', 'timefinish')); // Build the tree $webinar->add_child($sessions); $sessions->add_child($session); $session->add_child($signups); $signups->add_child($signup); $signup->add_child($signups_status); $signups_status->add_child($signup_status); $session->add_child($session_roles); $session_roles->add_child($session_role); $session->add_child($session_data); $session_data->add_child($session_data_element); /*$session->add_child($session_field); $session_field->add_child($session_field_element);*/ $session->add_child($sessions_dates); $sessions_dates->add_child($sessions_date); // Define sources $webinar->set_source_table('webinar', array('id' => backup::VAR_ACTIVITYID)); $session->set_source_table('webinar_sessions', array('webinar' => backup::VAR_PARENTID)); $sessions_date->set_source_table('webinar_sessions_dates', array('sessionid' => backup::VAR_PARENTID)); if ($userinfo) { $signup->set_source_table('webinar_signups', array('sessionid' => backup::VAR_PARENTID)); $signup_status->set_source_table('webinar_signups_status', array('signupid' => backup::VAR_PARENTID)); $session_role->set_source_table('webinar_session_roles', array('sessionid' => backup::VAR_PARENTID)); $session_data_element->set_source_table('webinar_session_data', array('sessionid' => backup::VAR_PARENTID)); } // Define id annotations $signup->annotate_ids('user', 'userid'); $session_role->annotate_ids('role', 'roleid'); $session_role->annotate_ids('user', 'userid'); $session_data_element->annotate_ids('webinar_session_field', 'fieldid'); // Define file annotations // None for F2F // Return the root element (webinar), wrapped into standard activity structure return $this->prepare_activity_structure($webinar); }