Commit ee8f39b7 authored by Shamim Rezaie's avatar Shamim Rezaie
Browse files

MDL-55915 core_user: let fullname() know if user has viewfullnames cap

Added $viewfullnames property to the user_selector_base class so anyone using a child class of this class can
let it know if user has viewfullnames capability or not.
parent 20b2bbb9
......@@ -82,6 +82,9 @@ abstract class user_selector_base {
/** @var int this is used to define maximum number of users visible in list */
public $maxusersperpage = 100;
/** @var boolean Whether to override fullname() */
public $viewfullnames = false;
* Constructor. Each subclass must have a constructor with this signature.
......@@ -571,7 +574,7 @@ abstract class user_selector_base {
* @return string a string representation of the user.
public function output_user($user) {
$out = fullname($user);
$out = fullname($user, $this->viewfullnames);
if ($this->extrafields) {
$displayfields = array();
foreach ($this->extrafields as $field) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment