diff --git a/core/Views/Admin/AdminView.class.php b/core/Views/Admin/AdminView.class.php deleted file mode 100644 index f1ef92b..0000000 --- a/core/Views/Admin/AdminView.class.php +++ /dev/null @@ -1,46 +0,0 @@ -errorMessages = array(); - } - - public function getErrorMessages() { - return $this->errorMessages; - } - - public function getCode() { - $html = parent::getCode(); - - $home = L("Home"); - - $html .= - "
-
-
-
-

$this->title

-
-
-
    -
  1. $home
  2. -
  3. $this->title
  4. -
-
-
-
-
"; - - return $html; - } -} \ No newline at end of file diff --git a/core/Views/Admin/Dashboard.class.php b/core/Views/Admin/Dashboard.class.php deleted file mode 100644 index 43d924b..0000000 --- a/core/Views/Admin/Dashboard.class.php +++ /dev/null @@ -1,25 +0,0 @@ -title = L("Dashboard"); - } - - public function getCode() { - $html = parent::getCode(); - - return $html; - } - -} \ No newline at end of file diff --git a/core/Views/Admin/UserOverview.class.php b/core/Views/Admin/UserOverview.class.php deleted file mode 100644 index 4f467a0..0000000 --- a/core/Views/Admin/UserOverview.class.php +++ /dev/null @@ -1,163 +0,0 @@ -users = array(); - $this->pageCount = 0; - $this->page = 1; - } - - public function loadView() { - parent::loadView(); - $this->title = L("User Control"); - $this->requestUsers(); - } - - private function requestUsers() { - - if(isset($_GET["page"]) && is_numeric($_GET["page"])) { - $this->page = intval($_GET["page"]); - } else { - $this->page = 1; - } - - $req = new \Api\User\Fetch($this->getDocument()->getUser()); - if (!$req->execute(array("page" => $this->page))) { - $this->errorMessages[] = $req->getLastError(); - } else { - $result = $req->getResult(); - $this->users = $result["users"]; - $this->pageCount = $result["pages"]; - } - } - - private function getGroups($groups) { - $badges = []; - - foreach($groups as $groupId => $group) { - $badgeClass = "secondary"; - if ($groupId === USER_GROUP_ADMIN) { - $badgeClass = "danger"; - } - - $badges[] = $this->createBadge($badgeClass, $group); - } - - return implode(" ", $badges); - } - - private function getPagination() { - - $userPageNavigation = L("User page navigation"); - $previousDisabled = ($this->page == 1 ? " disabled" : ""); - $nextDisabled = ($this->page >= $this->pageCount ? " disabled" : ""); - - $html = - ""; - - return $html; - } - - private function getUserRows() { - - $userRows = array(); - - foreach($this->users as $uid => $user) { - $name = $user["name"]; - $email = $user["email"] ?? ""; - $registeredAt = formatDate($user["registered_at"]); - $groups = $this->getGroups($user["groups"]); - - $userRows[] = - " - $name - $email - $groups - $registeredAt - "; - } - - return implode("", $userRows); - } - - public function getCode() { - $html = parent::getCode(); - - // Icons - $iconRefresh = $this->createIcon("sync"); - - // Locale - $users = L("Users"); - $name = L("Name"); - $email = L("Email"); - $groups = L("Groups"); - $registeredAt = L("Registered At"); - - // Content - $pagination = $this->getPagination(); - $userRows = $this->getUserRows(); - - $html .= - "
-
-
-
-
-
-

$users

- -
-
- - - - - - - - - - - $userRows - -
$name$email$groups$registeredAt
- $pagination -
-
-
-
-
-
"; - - return $html; - } -}