-/** A multipage view for users
- * Allows the display of bounds when sorting by name or promo.
- */
-abstract class UserView extends MultipageView
-{
- protected function getBoundValue($user)
- {
- if ($user instanceof User) {
- switch ($this->bound_field) {
- case 'name':
- $name = $user->lastName();
- return strtoupper($name);
- case 'promo':
- if ($user->hasProfile()) {
- return $user->profile()->promo();
- } else {
- return null;
- }
- default:
- return null;
- }
- }
- return null;
- }
-
- public function bounds()
- {
- $order = Env::v('order', $this->defaultkey);
- $show_bounds = 0;
- if (($order == "name") || ($order == "-name")) {
- $this->bound_field = "name";
- $show_bounds = 1;
- } elseif (($order == "promo") || ($order == "-promo")) {
- $this->bound_field = "promo";
- $show_bounds = -1;
- }
- if ($order{0} == '-') {
- $show_bounds = -$show_bounds;
- }
- return $show_bounds;
- }
-}
-
-class GroupMemberView extends UserView