projects
/
platal.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a5e30e5
)
Order educations by graduation year in the database and in the display.
author
Stéphane Jacob
<jacou@melix.net>
Thu, 21 Aug 2008 13:42:37 +0000
(15:42 +0200)
committer
Stéphane Jacob
<jacou@melix.net>
Thu, 21 Aug 2008 14:38:42 +0000
(16:38 +0200)
modules/profile/general.inc.php
patch
|
blob
|
blame
|
history
diff --git
a/modules/profile/general.inc.php
b/modules/profile/general.inc.php
index
0c4191b
..
794f746
100644
(file)
--- a/
modules/profile/general.inc.php
+++ b/
modules/profile/general.inc.php
@@
-86,6
+86,13
@@
class ProfileEdu implements ProfileSetting
{
}
+ static function sortByGradYear($line1, $line2) {
+ if ($line1['grad_year'] == $line2['grad_year']) {
+ return 0;
+ }
+ return ($line1['grad_year'] < $line2['grad_year']) ? -1 : 1;
+ }
+
public function value(ProfilePage &$page, $field, $value, &$success)
{
$success = true;
@@
-113,6
+120,7
@@
class ProfileEdu implements ProfileSetting
}
$i++;
}
+ usort($value, array("ProfileEdu", "sortByGradYear"));
}
return $value;
}