Добавляет возможность менять алерт у юзеров в админке

This commit is contained in:
zavolo 2025-05-22 13:54:19 +03:00
parent 4b7d2b9b17
commit 80a45f7730
3 changed files with 17 additions and 0 deletions

View file

@ -273,6 +273,16 @@ class User extends RowModel
return $this->getRecord()->alert;
}
public function setAlert(?string $alert): void
{
$this->stateChanges("alert", $alert);
}
public function hasAlert(): bool
{
return !empty($this->getAlert());
}
public function getTextForContentBan(string $type): string
{
switch ($type) {

View file

@ -123,6 +123,8 @@ final class AdminPresenter extends OpenVKPresenter
$this->flash("err", tr("error"), tr("error_shorturl_incorrect"));
}
$user->changeEmail($this->postParam("email"));
$alertText = $this->postParam("alert");
$user->setAlert($alertText);
if ($user->onlineStatus() != $this->postParam("online")) {
$user->setOnline(intval($this->postParam("online")));
}

View file

@ -56,6 +56,11 @@
<input class="text medium-field" type="text" id="shortcode" name="shortcode" value="{$user->getShortCode()}" />
</div>
<hr>
<div class="field-group">
<label for="alert">Алерт</label>
<textarea class="textarea medium-field" id="alert" name="alert" placeholder="">{$user->getAlert()}</textarea>
</div>
<hr>
<div class="field-group">
<label for="city">{_admin_verification}</label>
<input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} />