2021-12-14 18:32:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2019-08-07 19:53:59 +00:00
|
|
|
|
2023-01-10 22:44:09 +00:00
|
|
|
namespace Shimmie2;
|
|
|
|
|
2019-08-07 19:53:59 +00:00
|
|
|
class UserBlockBuildingEvent extends Event
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public array $parts = [];
|
2019-08-07 19:53:59 +00:00
|
|
|
|
2021-03-14 23:43:50 +00:00
|
|
|
public function add_link(string $name, string $link, int $position=50): void
|
2019-08-07 19:53:59 +00:00
|
|
|
{
|
|
|
|
while (isset($this->parts[$position])) {
|
|
|
|
$position++;
|
|
|
|
}
|
|
|
|
$this->parts[$position] = ["name" => $name, "link" => $link];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-26 15:13:28 +00:00
|
|
|
class UserOperationsBuildingEvent extends Event
|
2019-08-07 19:53:59 +00:00
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public array $parts = [];
|
|
|
|
public User $user;
|
|
|
|
public BaseConfig $user_config;
|
2020-10-26 15:13:28 +00:00
|
|
|
|
|
|
|
public function __construct(User $user, BaseConfig $user_config)
|
|
|
|
{
|
|
|
|
parent::__construct();
|
|
|
|
$this->user = $user;
|
|
|
|
$this->user_config = $user_config;
|
|
|
|
}
|
2019-08-07 19:53:59 +00:00
|
|
|
|
2021-03-14 23:43:50 +00:00
|
|
|
public function add_html(string $html): void
|
2019-08-07 19:53:59 +00:00
|
|
|
{
|
|
|
|
$this->parts[] = $html;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class UserPageBuildingEvent extends Event
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public User $display_user;
|
|
|
|
public array $stats = [];
|
2019-08-07 19:53:59 +00:00
|
|
|
|
|
|
|
public function __construct(User $display_user)
|
|
|
|
{
|
2020-01-26 13:19:35 +00:00
|
|
|
parent::__construct();
|
2019-08-07 19:53:59 +00:00
|
|
|
$this->display_user = $display_user;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function add_stats(string $html, int $position=50)
|
|
|
|
{
|
|
|
|
while (isset($this->stats[$position])) {
|
|
|
|
$position++;
|
|
|
|
}
|
|
|
|
$this->stats[$position] = $html;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class UserCreationEvent extends Event
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public string $username;
|
|
|
|
public string $password;
|
|
|
|
public string $email;
|
|
|
|
public bool $login;
|
2019-08-07 19:53:59 +00:00
|
|
|
|
2020-05-19 18:33:51 +00:00
|
|
|
public function __construct(string $name, string $pass, string $email, bool $login)
|
2019-08-07 19:53:59 +00:00
|
|
|
{
|
2020-01-26 13:19:35 +00:00
|
|
|
parent::__construct();
|
2019-08-07 19:53:59 +00:00
|
|
|
$this->username = $name;
|
|
|
|
$this->password = $pass;
|
|
|
|
$this->email = $email;
|
2020-05-19 18:33:51 +00:00
|
|
|
$this->login = $login;
|
2019-08-07 19:53:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class UserLoginEvent extends Event
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public User $user;
|
2019-08-07 19:53:59 +00:00
|
|
|
public function __construct(User $user)
|
|
|
|
{
|
2020-01-26 13:19:35 +00:00
|
|
|
parent::__construct();
|
2019-08-07 19:53:59 +00:00
|
|
|
$this->user = $user;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class UserDeletionEvent extends Event
|
|
|
|
{
|
2021-03-14 23:43:50 +00:00
|
|
|
public int $id;
|
2019-08-07 19:53:59 +00:00
|
|
|
|
|
|
|
public function __construct(int $id)
|
|
|
|
{
|
2020-01-26 13:19:35 +00:00
|
|
|
parent::__construct();
|
2019-08-07 19:53:59 +00:00
|
|
|
$this->id = $id;
|
|
|
|
}
|
|
|
|
}
|