Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-18774 - fixed fullname format label.

  • Loading branch information...
commit 366a5bb8fd91facfb9f751d455039f80e5620f80 1 parent deb03b4
Rossiani Wijaya authored
Showing with 15 additions and 2 deletions.
  1. +15 −2 lib/tablelib.php
View
17 lib/tablelib.php
@@ -658,8 +658,21 @@ function print_html() {
$fsortorder = get_string('asc');
$lsortorder = get_string('asc');
}
- $this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first.' / '.
- '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$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] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first.' / '.
+ '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last;
+ } else {
+ $this->headers[$index] = '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=lastname">'.get_string('lastname').get_accesshide(get_string('sortby').' '.get_string('lastname').' '.$lsortorder).'</a> '.$icon_sort_last.' / '.
+ '<a href="'.$this->baseurl.$this->request[TABLE_VAR_SORT].'=firstname">'.get_string('firstname').get_accesshide(get_string('sortby').' '.get_string('firstname').' '.$fsortorder).'</a> '.$icon_sort_first;
+ }
}
break;
Please sign in to comment.
Something went wrong with that request. Please try again.