This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
accm-website/pages/UsersPage.inc.php
2010-08-14 22:32:09 +02:00

58 lines
1.3 KiB
PHP

<?php
include_once './pages/PageInterface.inc.php';
include_once './includes/users/MemberFormatter.inc.php';
include_once './includes/tournaments/TournamentEntryLister.inc.php';
/**
* This class represents the public list of users.
*
* @author Thomas Schwery <thomas.schwery@epfl.ch>
*/
class UsersPage implements PageInterface {
public function __construct() {
if (key_exists("userIdentifier", $_GET)) {
$this->itemView();
} else {
$this->listing();
}
}
private function itemView() {
$userIdentifier = $_GET['userIdentifier'];
$member = Member::Get($userIdentifier);
if ($member) {
$this->title = $member->getFullName();
$this->content = MemberFormatter::getFullView($member);
}
}
private function listing() {
$this->title = Localization::memberList;
$content = "";
$userArray = MemberLister::getAllMembers();
foreach ($userArray as $user) {
$content .= MemberFormatter::getSummaryBox($user);
}
$this->content = $content;
}
public function getContent() {
return $this->content;
}
public function getTitle() {
return $this->title;
}
public static function getStaticTitle() {
return Localization::memberList;
}
}
?>