mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Now we are reading user_profile_fields and user_tags + some small fixes on roles. MDL-6856 ; merged from 19_STABLE
This commit is contained in:
parent
1921b95df5
commit
e464445596
1 changed files with 94 additions and 45 deletions
|
@ -5638,6 +5638,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->level == 5) {
|
||||
switch ($tagName) {
|
||||
case "ID":
|
||||
|
@ -5780,6 +5781,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->level == 6 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") {
|
||||
switch ($tagName) {
|
||||
case "ROLE":
|
||||
|
@ -5792,10 +5794,24 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
|||
$this->info->tempuser->user_preferences[$this->info->tempuserpreference->name] = $this->info->tempuserpreference;
|
||||
unset($this->info->tempuserpreference);
|
||||
break;
|
||||
case "USER_CUSTOM_PROFILE_FIELD":
|
||||
//We've finalized a user_custom_profile_field, get it
|
||||
$this->info->tempuser->user_custom_profile_fields[] = $this->info->tempusercustomprofilefield;
|
||||
unset($this->info->tempusercustomprofilefield);
|
||||
break;
|
||||
case "USER_TAG":
|
||||
//We've finalized a user_tag, get it
|
||||
$this->info->tempuser->user_tags[] = $this->info->tempusertag;
|
||||
unset($this->info->tempusertag);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->level == 7) {
|
||||
if ($this->level == 7 && $this->tree[5]!="ROLES_ASSIGNMENTS" && $this->tree[5]!="ROLES_OVERRIDES") {
|
||||
/// If we are reading roles
|
||||
if($this->tree[6] == 'ROLE') {
|
||||
switch ($tagName) {
|
||||
case "TYPE":
|
||||
$this->info->temprole->type = $this->getContents();
|
||||
|
@ -5833,6 +5849,12 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
|||
case "ENROL":
|
||||
$this->info->temprole->enrol = $this->getContents();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/// If we are reading user_preferences
|
||||
} else if ($this->tree[6] == 'USER_PREFERENCE') {
|
||||
switch ($tagName) {
|
||||
case "NAME":
|
||||
$this->info->tempuserpreference->name = $this->getContents();
|
||||
break;
|
||||
|
@ -5841,7 +5863,34 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
|
|||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
/// If we are reading user_custom_profile_fields
|
||||
} else if ($this->tree[6] == 'USER_CUSTOM_PROFILE_FIELD') {
|
||||
switch ($tagName) {
|
||||
case "FIELD_NAME":
|
||||
$this->info->tempusercustomprofilefield->field_name = $this->getContents();
|
||||
break;
|
||||
case "FIELD_TYPE":
|
||||
$this->info->tempusercustomprofilefield->field_type = $this->getContents();
|
||||
break;
|
||||
case "FIELD_DATA":
|
||||
$this->info->tempusercustomprofilefield->field_data = $this->getContents();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/// If we are reading user_tags
|
||||
} else if ($this->tree[6] == 'USER_TAG') {
|
||||
switch ($tagName) {
|
||||
case "NAME":
|
||||
$this->info->tempusertag->name = $this->getContents();
|
||||
break;
|
||||
case "RAWNAME":
|
||||
$this->info->tempusertag->rawname = $this->getContents();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue