MDL-71099 Lib: Move new user_fields class from core to core_user
This class would belong more appropriately within the 'user' API (core_user) instead of within the 'core' API, since it is directly related to user data. Since the class has only just been added to Moodle, now is a good time to move it.
This commit is contained in:
+3
-3
@@ -608,7 +608,7 @@ class flexible_table {
|
||||
if (isset($this->columns[$column])) {
|
||||
continue; // This column is OK.
|
||||
}
|
||||
if (in_array($column, \core\user_fields::get_name_fields()) &&
|
||||
if (in_array($column, \core_user\fields::get_name_fields()) &&
|
||||
isset($this->columns['fullname'])) {
|
||||
continue; // This column is OK.
|
||||
}
|
||||
@@ -1235,7 +1235,7 @@ class flexible_table {
|
||||
$nameformat = get_string('fullnamedisplay');
|
||||
}
|
||||
|
||||
$requirednames = order_in_string(\core\user_fields::get_name_fields(), $nameformat);
|
||||
$requirednames = order_in_string(\core_user\fields::get_name_fields(), $nameformat);
|
||||
|
||||
if (!empty($requirednames)) {
|
||||
if ($this->is_sortable($column)) {
|
||||
@@ -1315,7 +1315,7 @@ class flexible_table {
|
||||
$sortdata = array_merge([$sortby => $sortorder], $sortdata);
|
||||
}
|
||||
|
||||
$usernamefields = \core\user_fields::get_name_fields();
|
||||
$usernamefields = \core_user\fields::get_name_fields();
|
||||
$sortdata = array_filter($sortdata, function($sortby) use ($usernamefields) {
|
||||
$isvalidsort = $sortby && $this->is_sortable($sortby);
|
||||
$isvalidsort = $isvalidsort && empty($this->prefs['collapse'][$sortby]);
|
||||
|
||||
Reference in New Issue
Block a user