https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114567
Revision: 114567
Author: jeroendedauw
Date: 2012-03-28 18:24:58 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
do not use real names after all
Modified Paths:
--------------
trunk/extensions/EducationProgram/EducationProgram.settings.php
trunk/extensions/EducationProgram/includes/EPRoleObject.php
Modified: trunk/extensions/EducationProgram/EducationProgram.settings.php
===================================================================
--- trunk/extensions/EducationProgram/EducationProgram.settings.php
2012-03-28 18:19:30 UTC (rev 114566)
+++ trunk/extensions/EducationProgram/EducationProgram.settings.php
2012-03-28 18:24:58 UTC (rev 114567)
@@ -64,6 +64,7 @@
'fallbackFlag' => 'Nuvola unknown flag.svg',
'courseDescPage' => 'MediaWiki:Course description',
'courseOrgDescPage' => '$2/$1', // $1 = org name, $2 =
courseDescPage setting
+ 'useStudentRealNames' => false,
);
}
Modified: trunk/extensions/EducationProgram/includes/EPRoleObject.php
===================================================================
--- trunk/extensions/EducationProgram/includes/EPRoleObject.php 2012-03-28
18:19:30 UTC (rev 114566)
+++ trunk/extensions/EducationProgram/includes/EPRoleObject.php 2012-03-28
18:24:58 UTC (rev 114567)
@@ -95,14 +95,15 @@
}
/**
- * Returns the name of the instroctor, using their real name when
available.
+ * Returns the name of the user, possibly using their real name when
available.
*
* @since 0.1
*
* @return string
*/
public function getName() {
- return $this->getUser()->getRealName() === '' ?
$this->getUser()->getName() : $this->getUser()->getRealName();
+ return !EPSettings::get( 'useStudentRealNames' ) ||
$this->getUser()->getRealName() === '' ?
+ $this->getUser()->getName() :
$this->getUser()->getRealName();
}
/**
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs