From 366a5bb8fd91facfb9f751d455039f80e5620f80 Mon Sep 17 00:00:00 2001 From: Rossiani Wijaya Date: Fri, 8 Jan 2010 02:27:32 +0000 Subject: [PATCH] MDL-18774 - fixed fullname format label. --- lib/tablelib.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/tablelib.php b/lib/tablelib.php index 9c7477483d3..b69225ae805 100644 --- a/lib/tablelib.php +++ b/lib/tablelib.php @@ -658,8 +658,21 @@ class flexible_table { $fsortorder = get_string('asc'); $lsortorder = get_string('asc'); } - $this->headers[$index] = ''.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).' '.$icon_sort_first.' / '. - ''.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).' '.$icon_sort_last; + + $override = new object(); + $override->firstname = 'firstname'; + $override->lastname = 'lastname'; + $fullnamelanguage = get_string('fullnamedisplay', '', $override); + + if (($CFG->fullnamedisplay == 'firstname lastname') or + ($CFG->fullnamedisplay == 'firstname') or + ($CFG->fullnamedisplay == 'language' and $fullnamelanguage == 'firstname lastname' )) { + $this->headers[$index] = ''.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).' '.$icon_sort_first.' / '. + ''.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).' '.$icon_sort_last; + } else { + $this->headers[$index] = ''.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).' '.$icon_sort_last.' / '. + ''.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).' '.$icon_sort_first; + } } break;