本文整理汇总了PHP中backup_nested_element类的典型用法代码示例。如果您正苦于以下问题:PHP backup_nested_element类的具体用法?PHP backup_nested_element怎么用?PHP backup_nested_element使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了backup_nested_element类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: define_grade_subplugin_structure
/**
* Returns the subplugin information to attach to feedback element
* @return backup_subplugin_element
*/
protected function define_grade_subplugin_structure()
{
// Create XML elements.
$subplugin = $this->get_subplugin_element();
$subpluginwrapper = new backup_nested_element($this->get_recommended_name());
$subpluginelementfiles = new backup_nested_element('feedback_editpdf_files', null, array('gradeid'));
$subpluginelementannotations = new backup_nested_element('feedback_editpdf_annotations');
$subpluginelementannotation = new backup_nested_element('annotation', null, array('gradeid', 'pageno', 'type', 'x', 'y', 'endx', 'endy', 'colour', 'path', 'draft'));
$subpluginelementcomments = new backup_nested_element('feedback_editpdf_comments');
$subpluginelementcomment = new backup_nested_element('comment', null, array('gradeid', 'pageno', 'x', 'y', 'width', 'rawtext', 'colour', 'draft'));
// Connect XML elements into the tree.
$subplugin->add_child($subpluginwrapper);
$subpluginelementannotations->add_child($subpluginelementannotation);
$subpluginelementcomments->add_child($subpluginelementcomment);
$subpluginwrapper->add_child($subpluginelementfiles);
$subpluginwrapper->add_child($subpluginelementannotations);
$subpluginwrapper->add_child($subpluginelementcomments);
// Set source to populate the data.
$subpluginelementfiles->set_source_sql('SELECT id AS gradeid from {assign_grades} where id = :gradeid', array('gradeid' => backup::VAR_PARENTID));
$subpluginelementannotation->set_source_table('assignfeedback_editpdf_annot', array('gradeid' => backup::VAR_PARENTID));
$subpluginelementcomment->set_source_table('assignfeedback_editpdf_cmnt', array('gradeid' => backup::VAR_PARENTID));
// We only need to backup the files in the final pdf area - all the others can be regenerated.
$subpluginelementfiles->annotate_files('assignfeedback_editpdf', 'download', 'gradeid');
$subpluginelementfiles->annotate_files('assignfeedback_editpdf', 'stamps', 'gradeid');
return $subplugin;
}
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:30,代码来源:backup_assignfeedback_editpdf_subplugin.class.php
示例2: define_structure
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);
}
开发者ID:POETGroup,项目名称:moodle-mod_journal,代码行数:25,代码来源:backup_journal_stepslib.php
示例3: define_structure
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);
}
开发者ID:evltuma,项目名称:moodle,代码行数:27,代码来源:backup_chat_stepslib.php
示例4: define_structure
protected function define_structure()
{
// Create really simple structure (1 nested with 1 attr and 2 fields)
$test = new backup_nested_element('test', array('id'), array('field1', 'field2'));
$test->set_source_array(array(array('id' => 1, 'field1' => 'value1', 'field2' => 'value2')));
return $test;
}
开发者ID:JP-Git,项目名称:moodle,代码行数:7,代码来源:plan_fixtures.php
示例5: define_structure
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);
}
开发者ID:nmisic,项目名称:moodle-mod_organizer,代码行数:29,代码来源:backup_organizer_stepslib.php
示例6: define_structure
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);
}
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:26,代码来源:backup_certificate_stepslib.php
示例7: define_structure
/**
* 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);
}
开发者ID:rezaies,项目名称:moodle-mod_customcert,代码行数:38,代码来源:backup_customcert_stepslib.php
示例8: define_structure
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);
}
开发者ID:CTANZ,项目名称:moodle-mod_equella,代码行数:7,代码来源:backup_equella_stepslib.php
示例9: define_structure
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);
}
开发者ID:gname,项目名称:moodle-mod_attendanceregister,代码行数:31,代码来源:backup_attendanceregister_stepslib.php
示例10: define_structure
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);
}
开发者ID:JP-Git,项目名称:moodle,代码行数:26,代码来源:backup_folder_stepslib.php
示例11: define_structure
/**
* 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);
}
开发者ID:juacas,项目名称:moodle-mod_blended,代码行数:37,代码来源:backup_blended_stepslib.php
示例12: define_structure
protected function define_structure()
{
global $DB;
// Get the block
$block = $DB->get_record('block_instances', array('id' => $this->task->get_blockid()));
// Extract configdata
$config = unserialize(base64_decode($block->configdata));
// Get array of used rss feeds
if (!empty($config->rssid)) {
$feedids = $config->rssid;
// Get the IN corresponding query
list($in_sql, $in_params) = $DB->get_in_or_equal($feedids);
// Define all the in_params as sqlparams
foreach ($in_params as $key => $value) {
$in_params[$key] = backup_helper::is_sqlparam($value);
}
}
// Define each element separated
$rss_client = new backup_nested_element('rss_client', array('id'), null);
$feeds = new backup_nested_element('feeds');
$feed = new backup_nested_element('feed', array('id'), array('title', 'preferredtitle', 'description', 'shared', 'url'));
// Build the tree
$rss_client->add_child($feeds);
$feeds->add_child($feed);
// Define sources
$rss_client->set_source_array(array((object) array('id' => $this->task->get_blockid())));
// Only if there are feeds
if (!empty($config->rssid)) {
$feed->set_source_sql("\n SELECT *\n FROM {block_rss_client}\n WHERE id {$in_sql}", $in_params);
}
// Annotations (none)
// Return the root element (rss_client), wrapped into standard block structure
return $this->prepare_block_structure($rss_client);
}
开发者ID:evltuma,项目名称:moodle,代码行数:34,代码来源:backup_rss_client_stepslib.php
示例13: define_structure
protected function define_structure()
{
// Define each element separated
$attendance = new backup_nested_element('attendance');
$block = new backup_nested_element('block', array('id'), array('course', 'name', 'grade'));
$statuses = new backup_nested_element('statuses');
$status = new backup_nested_element('status', array('id'), array('courseid', 'acronym', 'description', 'grade', 'visible', 'deleted'));
$sessions = new backup_nested_element('session', array('id'), array('courseid', 'sessdate', 'duration', 'lasttaken', 'lasttakenby', 'description', 'timemodified'));
$logs = new backup_nested_element('logs');
$log = new backup_nested_element('log', array('id'), array('sessionid', 'studentid', 'statusid', 'statusset', 'timetaken', 'takenby', 'remarks'));
// Build the tree
$attendance->add_child($block);
$attendance->add_child($statuses);
$statuses->add_child($status);
$attendance->add_child($sessions);
$sessions->add_child($logs);
$logs->add_child($log);
/*
$sessions->add_child($logs);
$logs->add_child($log);
$sessions->add_child($status);
$sessions->add_child($block);
*/
// Define sources
$block->set_source_table('attforblock', array('id' => backup::VAR_ACTIVITYID));
$status->set_source_table('attendance_statuses', array('courseid' => backup::VAR_COURSEID));
$sessions->set_source_table('attendance_sessions', array('courseid' => backup::VAR_COURSEID));
$log->set_source_table('attendance_log', array('sessionid' => backup::VAR_PARENTID));
// Define id annotations
$log->annotate_ids('user', 'studentid');
// Return the root element (chat), wrapped into standard activity structure
return $this->prepare_activity_structure($attendance);
}
开发者ID:netspotau,项目名称:moodle-mod_attforblock,代码行数:33,代码来源:backup_attforblock_stepslib.php
示例14: define_structure
/**
* 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);
}
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:13,代码来源:backup_nurs_navigation_stepslib.php
示例15: define_structure
/**
* Define structure.
*/
protected function define_structure()
{
global $DB;
$userinfo = $this->get_setting_value('users');
// Define each element separated.
$xpconfig = new backup_nested_element('config', array('courseid'), array('enabled', 'enablelog', 'keeplogs', 'levels', 'lastlogpurge', 'enableladder', 'enableinfos', 'levelsdata', 'enablelevelupnotif', 'enablecustomlevelbadges', 'maxactionspertime', 'timeformaxactions', 'timebetweensameactions', 'identitymode', 'rankmode', 'neighbours'));
$xpfilters = new backup_nested_element('filters');
$xpfilter = new backup_nested_element('filter', array('courseid'), array('ruledata', 'points', 'sortorder'));
$xplevels = new backup_nested_element('xps');
$xplevel = new backup_nested_element('xp', array('courseid'), array('userid', 'xp', 'lvl'));
$xplogs = new backup_nested_element('logs');
$xplog = new backup_nested_element('log', array('courseid'), array('userid', 'eventname', 'xp', 'time'));
// Prepare the structure.
$xp = $this->prepare_block_structure($xpconfig);
$xpfilters->add_child($xpfilter);
$xp->add_child($xpfilters);
if ($userinfo) {
$xplevels->add_child($xplevel);
$xp->add_child($xplevels);
$xplogs->add_child($xplog);
$xp->add_child($xplogs);
}
// Define sources.
$xpconfig->set_source_table('block_xp_config', array('courseid' => backup::VAR_COURSEID));
$xpfilter->set_source_table('block_xp_filters', array('courseid' => backup::VAR_COURSEID));
$xplevel->set_source_table('block_xp', array('courseid' => backup::VAR_COURSEID));
$xplog->set_source_table('block_xp_log', array('courseid' => backup::VAR_COURSEID));
// Annotations.
$xplevel->annotate_ids('user', 'userid');
$xplog->annotate_ids('user', 'userid');
$xp->annotate_files('block_xp', 'badges', null, context_course::instance($this->get_courseid())->id);
// Return the root element.
return $xp;
}
开发者ID:antoniorodrigues,项目名称:redes-digitais,代码行数:37,代码来源:backup_xp_stepslib.php
示例16: define_structure
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);
}
开发者ID:netspotau,项目名称:moodle-mod_dialogue,代码行数:35,代码来源:backup_dialogue_stepslib.php
示例17: define_structure
protected function define_structure()
{
// To know if we are including userinfo
$userinfo = $this->get_setting_value('userinfo');
// Define each element separated
$rcontent = new backup_nested_element('rcontent', array('id'), array('course', 'name', 'intro', 'introformat', 'levelid', 'whatgrade', 'popup', 'popup_options', 'frame', 'width', 'height', 'timecreated', 'timemodified', 'levelcode', 'isbn', 'unitcode', 'activitycode'));
$grades = new backup_nested_element('grades');
$grade = new backup_nested_element('grade', array('id'), array('userid', 'rcontentid', 'grade', 'mingrade', 'maxgrade', 'attempt', 'maxattempts', 'starttime', 'totaltime', 'maxtotaltime', 'status', 'comments', 'urlviewresults', 'sumweights', 'timecreated', 'timemodified', 'unitcode', 'activitycode'));
$grades_details = new backup_nested_element('grades_details');
$grade_detail = new backup_nested_element('grade_detail', array('id'), array('userid', 'rcontentid', 'code', 'typeid', 'description', 'grade', 'mingrade', 'maxgrade', 'starttime', 'totaltime', 'maxtotaltime', 'attempt', 'maxattempts', 'weight', 'urlviewresults', 'timecreated', 'timemodified', 'unitcode', 'activitycode'));
$track_credentials = new backup_nested_element('track_credentials');
$track_credential = new backup_nested_element('track_credential', array('id'), array('username', 'password', 'publisherid', 'timecreated', 'timemodified'));
// Build the tree
$rcontent->add_child($grades);
$grades->add_child($grade);
$grade->add_child($grades_details);
$grades_details->add_child($grade_detail);
$rcontent->add_child($track_credentials);
$track_credentials->add_child($track_credential);
// Define sources
//$rcontent->set_source_table('rcontent', array('id' => backup::VAR_ACTIVITYID));
$rcontent->set_source_sql('SELECT rc.*,rlevel.code as levelcode, rcb.isbn as isbn, unit.code as unitcode, activity.code as activitycode
FROM {rcontent} rc
LEFT outer JOIN {rcommon_level} rlevel on rlevel.id=rc.levelid
LEFT outer JOIN {rcommon_books} rcb on rcb.id=rc.bookid and rcb.levelid=rc.levelid
LEFT outer JOIN {rcommon_books_units} unit on unit.id=rc.unitid and unit.bookid=rc.bookid
LEFT outer JOIN {rcommon_books_activities} activity on activity.id=rc.activityid and activity.bookid=rc.bookid and activity.unitid = rc.unitid
WHERE rc.id = ?', array(backup::VAR_ACTIVITYID));
// Use set_source_sql for other calls as set_source_table returns records in reverse order
// and order is important for several rcontent fields - esp rcontent_scoes.
$grade->set_source_sql('
SELECT rg.*, unit.code as unitcode, activity.code as activitycode
FROM {rcontent_grades} rg
INNER JOIN {rcontent} rc ON rc.id=rg.rcontentid
LEFT outer JOIN {rcommon_books_units} unit on unit.id=rc.unitid and unit.bookid=rc.bookid
LEFT outer JOIN {rcommon_books_activities} activity on activity.id=rc.activityid and activity.bookid=rc.bookid and activity.unitid = rc.unitid
WHERE rg.rcontentid = :rcontent
ORDER BY rg.id', array('rcontent' => backup::VAR_PARENTID));
$grade_detail->set_source_sql('
SELECT rc.*, unit.code as unitcode, activity.code as activitycode
FROM {rcontent_grades_details} rg
INNER JOIN {rcontent} rc ON rc.id=rg.rcontentid
LEFT outer JOIN {rcommon_books_units} unit on unit.id=rc.unitid and unit.bookid=rc.bookid
LEFT outer JOIN {rcommon_books_activities} activity on activity.id=rc.activityid and activity.bookid=rc.bookid and activity.unitid = rc.unitid
WHERE rg.rcontentid = :rcontent
ORDER BY rg.id', array('rcontent' => backup::VAR_PARENTID));
$track_credentials->set_source_sql('
SELECT *
FROM {rcontent_track_credentials}
ORDER BY id', array());
// Define id annotations
$grade->annotate_ids('user', 'userid');
$grade_detail->annotate_ids('user', 'userid');
// Define file annotations
$rcontent->annotate_files('mod_rcontent', 'intro', null);
// This file area hasn't itemid
// Return the root element (rcontent), wrapped into standard activity structure
return $this->prepare_activity_structure($rcontent);
}
开发者ID:kevin-bruton,项目名称:marsupial,代码行数:59,代码来源:backup_rcontent_stepslib.php
示例18: define_structure
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);
}
开发者ID:ninelanterns,项目名称:moodle-mod_bootstrapelements,代码行数:8,代码来源:backup_bootstrapelements_stepslib.php
示例19: define_structure
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);
}
开发者ID:pavelsokolov,项目名称:webinar,代码行数:58,代码来源:backup_webinar_stepslib.php
示例20: define_structure
/**
* Define the structure for the links block.
* @return void
*/
protected function define_structure()
{
// Define each element separated.
$link = new backup_nested_element('link', null, array('id', 'linktext', 'url', 'notes', 'defaultshow', 'department'));
// Define sources.
$link->set_source_sql("SELECT * FROM {block_links}", array());
// Annotations (none).
// Return the root element (links), wrapped into standard block structure.
return $this->prepare_block_structure($link);
}
开发者ID:sbourget,项目名称:moodle-block_links,代码行数:14,代码来源:backup_links_stepslib.php
注:本文中的backup_nested_element类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论