mirror of
https://github.com/openvk/openvk
synced 2025-07-01 21:48:17 +03:00
Добавляет возможность менять алерт у юзеров в админке
This commit is contained in:
parent
4b7d2b9b17
commit
80a45f7730
3 changed files with 17 additions and 0 deletions
|
@ -273,6 +273,16 @@ class User extends RowModel
|
||||||
return $this->getRecord()->alert;
|
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
|
public function getTextForContentBan(string $type): string
|
||||||
{
|
{
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
|
|
@ -123,6 +123,8 @@ final class AdminPresenter extends OpenVKPresenter
|
||||||
$this->flash("err", tr("error"), tr("error_shorturl_incorrect"));
|
$this->flash("err", tr("error"), tr("error_shorturl_incorrect"));
|
||||||
}
|
}
|
||||||
$user->changeEmail($this->postParam("email"));
|
$user->changeEmail($this->postParam("email"));
|
||||||
|
$alertText = $this->postParam("alert");
|
||||||
|
$user->setAlert($alertText);
|
||||||
if ($user->onlineStatus() != $this->postParam("online")) {
|
if ($user->onlineStatus() != $this->postParam("online")) {
|
||||||
$user->setOnline(intval($this->postParam("online")));
|
$user->setOnline(intval($this->postParam("online")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,11 @@
|
||||||
<input class="text medium-field" type="text" id="shortcode" name="shortcode" value="{$user->getShortCode()}" />
|
<input class="text medium-field" type="text" id="shortcode" name="shortcode" value="{$user->getShortCode()}" />
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<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">
|
<div class="field-group">
|
||||||
<label for="city">{_admin_verification}</label>
|
<label for="city">{_admin_verification}</label>
|
||||||
<input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} />
|
<input class="toggle-large" type="checkbox" id="verify" name="verify" value="1" {if $user->isVerified()} checked {/if} />
|
||||||
|
|
Loading…
Reference in a new issue