Fix files for new structure of iswev/errors

This commit is contained in:
Visman 2021-03-11 23:28:07 +07:00
parent f5caf4fe6d
commit a60dd3b507
22 changed files with 59 additions and 54 deletions

View file

@ -263,14 +263,14 @@ abstract class Page extends Model
'1' == $this->c->config->o_maintenance
&& $this->user->isAdmin
) {
$this->fIswev = ['w', __(['Maintenance mode enabled', $this->c->Router->link('AdminMaintenance')])];
$this->fIswev = ['w', ['Maintenance mode enabled', $this->c->Router->link('AdminMaintenance')]];
}
if (
$this->user->isAdmMod
&& $this->user->last_report_id < $this->c->reports->lastId()
) {
$this->fIswev = ['i', __(['New reports', $this->c->Router->link('AdminReports')])];
$this->fIswev = ['i', ['New reports', $this->c->Router->link('AdminReports')]];
}
}
@ -432,7 +432,7 @@ abstract class Page extends Model
if (
isset($value[0], $value[1])
&& \is_string($value[0])
&& \is_string($value[1])
&& 2 === \count($value)
) {
$attr[$value[0]][] = $value[1];
} else {

View file

@ -354,7 +354,7 @@ class Bans extends Admin
$number = \count($idsN);
if (0 == $number) {
$this->fIswev = ['i', __('No bans found')];
$this->fIswev = ['i', 'No bans found'];
return $this->view([], 'GET', $data);
}

View file

@ -36,12 +36,17 @@ class Host extends Admin
$this->back = true;
$this->fIswev = [
'i',
__(['Host info', $ip, $host, $this->c->Router->link(
'AdminUsersResult',
[
'data' => "ip:{$ip}",
]
)]),
[
'Host info',
$ip,
$host,
$this->c->Router->link(
'AdminUsersResult',
[
'data' => "ip:{$ip}",
]
)
],
];
return $this;

View file

@ -96,14 +96,14 @@ class Install extends Admin
// версия PHP
if (\version_compare(\PHP_VERSION, self::PHP_MIN, '<')) {
$this->fIswev = ['e', __(['You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN])];
$this->fIswev = ['e', ['You are running error', 'PHP', \PHP_VERSION, $this->c->FORK_REVISION, self::PHP_MIN]];
}
// типы БД
$this->dbTypes = $this->DBTypes();
if (empty($this->dbTypes)) {
$this->fIswev = ['e', __('No DB extensions')];
$this->fIswev = ['e', 'No DB extensions'];
}
// доступность папок на запись
@ -116,7 +116,7 @@ class Install extends Admin
foreach ($folders as $folder) {
if (! \is_writable($folder)) {
$folder = \str_replace(\dirname($this->c->DIR_APP), '', $folder);
$this->fIswev = ['e', __(['Alert folder', $folder])];
$this->fIswev = ['e', ['Alert folder', $folder]];
}
}
@ -124,7 +124,7 @@ class Install extends Admin
$config = @\file_get_contents($this->c->DIR_APP . '/config/main.dist.php');
if (false === $config) {
$this->fIswev = ['e', __('No access to main.dist.php')];
$this->fIswev = ['e', 'No access to main.dist.php'];
}
unset($config);
@ -133,17 +133,17 @@ class Install extends Admin
$langs = $this->c->Func->getNameLangs();
if (empty($langs)) {
$this->fIswev = ['e', __('No language packs')];
$this->fIswev = ['e', 'No language packs'];
}
// стили
$styles = $this->c->Func->getStyles();
if (empty($styles)) {
$this->fIswev = ['e', __('No styles')];
$this->fIswev = ['e', 'No styles'];
}
$fIswev = $this->getAttr('fIswev'); // ????
$fIswev = $this->getAttr('fIswev');
if (
'POST' === $method

View file

@ -78,10 +78,10 @@ class Update extends Admin
protected function returnMaintenance(bool $isStage = true): Page
{
$maintenance = $this->c->Maintenance;
$maintenance->fIswev = ['w', __('Update script is running')];
$maintenance->fIswev = ['w', 'Update script is running'];
if ($isStage) {
$maintenance->fIswev = ['e', __('Script runs error')];
$maintenance->fIswev = ['e', 'Script runs error'];
}
return $maintenance;
@ -238,7 +238,7 @@ class Update extends Admin
$uid = $this->setLock();
if (null === $uid) {
$this->fIswev = ['e', __('Unable to write update lock')];
$this->fIswev = ['e', 'Unable to write update lock'];
} else {
$this->c->config->o_maintenance_message = $v->o_maintenance_message;

View file

@ -87,7 +87,7 @@ abstract class Users extends Admin
});
if (! empty($bad)) {
$this->fIswev = ['v', __('Action not available')];
$this->fIswev = ['v', 'Action not available'];
return false;
}
@ -102,14 +102,14 @@ abstract class Users extends Admin
switch ($action) {
case self::ACTION_BAN:
if ($this->c->bans->banFromName($user->username) > 0) {
$this->fIswev = ['i', __(['User is ban', $user->username])];
$this->fIswev = ['i', ['User is ban', $user->username]];
return false;
}
if (! $this->c->userRules->canBanUser($user)) {
$this->fIswev = ['v', __(['You are not allowed to ban the %s', $user->username])];
$this->fIswev = ['v', ['You are not allowed to ban the %s', $user->username]];
if ($user->isAdmMod) {
$this->fIswev = ['i', __('No ban admins message')];
$this->fIswev = ['i', 'No ban admins message'];
}
return false;
@ -117,9 +117,9 @@ abstract class Users extends Admin
break;
case self::ACTION_DEL:
if (! $this->c->userRules->canDeleteUser($user)) {
$this->fIswev = ['v', __(['You are not allowed to delete the %s', $user->username])];
$this->fIswev = ['v', ['You are not allowed to delete the %s', $user->username]];
if ($user->isAdmMod) {
$this->fIswev = ['i', __('No delete admins message')];
$this->fIswev = ['i', 'No delete admins message'];
}
return false;
@ -127,28 +127,28 @@ abstract class Users extends Admin
break;
case self::ACTION_CHG:
if (! $this->c->userRules->canChangeGroup($user, $profile)) {
$this->fIswev = ['v', __(['You are not allowed to change group for %s', $user->username])];
$this->fIswev = ['v', ['You are not allowed to change group for %s', $user->username]];
if ($user->isAdmin) {
$this->fIswev = ['i', __('No move admins message')];
$this->fIswev = ['i', 'No move admins message'];
}
return false;
}
break;
default:
$this->fIswev = ['v', __('Action not available')];
$this->fIswev = ['v', 'Action not available'];
return false;
}
$result[] = $user->id;
if ($user->id === $this->user->id) {
$this->fIswev = ['i', __('You are trying to change your own group')];
$this->fIswev = ['i', 'You are trying to change your own group'];
}
}
if (empty($result)) {
$this->fIswev = ['v', __('No users selected')];
$this->fIswev = ['v', 'No users selected'];
return false;
}

View file

@ -43,7 +43,7 @@ class Result extends Users
$number = \count($idsN);
if (0 == $number) {
$view = $this->c->AdminUsers;
$view->fIswev = ['i', __('No users found')];
$view->fIswev = ['i', 'No users found'];
return $view->view([], 'GET', $data);
}
@ -94,7 +94,7 @@ class Result extends Users
) {
$action = self::ACTION_CHG;
} else {
$this->fIswev = ['v', __('Action not available')];
$this->fIswev = ['v', 'Action not available'];
}
if (empty($this->fIswev)) {

View file

@ -38,7 +38,7 @@ class Stat extends Users
$user = $this->c->users->load($args['id']);
if (0 == $number) {
$this->fIswev = ['i', __('Results no posts found')];
$this->fIswev = ['i', 'Results no posts found'];
}
$this->nameTpl = 'admin/users_result';

View file

@ -52,7 +52,7 @@ class View extends Users
$ip = \filter_var($v->ip, \FILTER_VALIDATE_IP);
if (false === $ip) {
$this->fIswev = ['v', __('Bad IP message')];
$this->fIswev = ['v', 'Bad IP message'];
$data = $v->getData();
} else {
return $this->c->Redirect->page('AdminUsersResult', ['data' => $this->encodeData($ip)]);

View file

@ -404,7 +404,7 @@ class Auth extends Page
$this->c->users->update($user);
$this->fIswev = ['s', __('Pass updated')];
$this->fIswev = ['s', 'Pass updated'];
$this->c->Log->info('Passphrase reset: ok', [
'user' => $user->fLog(),
@ -430,7 +430,7 @@ class Auth extends Page
$this->c->users->update($user);
$this->fIswev = ['i', __('Account activated')];
$this->fIswev = ['i', 'Account activated'];
$this->c->Log->info('Account activation: ok', [
'user' => $user->fLog(),

View file

@ -58,7 +58,7 @@ class Email extends Page
$floodSize = \time() - (int) $this->user->last_email_sent;
$floodSize = $floodSize < $this->user->g_email_flood ? $this->user->g_email_flood - $floodSize : 0;
if ($floodSize > 0) {
$this->fIswev = ['e', __(['Flood message', $floodSize])];
$this->fIswev = ['e', ['Flood message', $floodSize]];
}
$data = [

View file

@ -55,7 +55,7 @@ class Forum extends Page
$this->crumbs = $this->crumbs($forum);
if (empty($this->topics)) {
$this->fIswev = ['i', __('Empty forum')];
$this->fIswev = ['i', 'Empty forum'];
} elseif (
$this->user->isAdmin
|| $this->user->isModerator($forum)

View file

@ -43,7 +43,7 @@ class Index extends Page
$ctgs = [];
if (empty($forums)) {
$this->fIswev = ['i', __('Empty board')];
$this->fIswev = ['i', 'Empty board'];
} else {
foreach ($forums as $forum) {
$ctgs[$forum->cat_id][] = $forum;

View file

@ -32,7 +32,7 @@ class Maintenance extends Page
$this->header('Retry-After', '3600');
$this->fIswev = ['i', __($this->c->config->o_maintenance_message)];
$this->fIswev = ['i', $this->c->config->o_maintenance_message];
}
/**

View file

@ -49,7 +49,7 @@ class Message extends Page
}
if ('' !== $message) {
$this->fIswev = [$type, __($message)];
$this->fIswev = [$type, $message];
}
return $this;

View file

@ -267,14 +267,14 @@ class Register extends Page
// форма сброса пароля
} else {
$auth = $this->c->Auth;
$auth->fIswev = ['w', __(['Error welcom mail', $this->c->config->o_admin_email])];
$auth->fIswev = ['w', ['Error welcom mail', $this->c->config->o_admin_email]];
return $auth->forget([], 'GET', $v->email);
}
// форма логина
} else {
$auth = $this->c->Auth;
$auth->fIswev = ['s', __('Reg complete')];
$auth->fIswev = ['s', 'Reg complete'];
return $auth->login([], 'GET', $v->username);
}
@ -337,14 +337,14 @@ class Register extends Page
// форма сброса пароля
} else {
$auth = $this->c->Auth;
$auth->fIswev = ['w', __(['Error welcom mail', $this->c->config->o_admin_email])];
$auth->fIswev = ['w', ['Error welcom mail', $this->c->config->o_admin_email]];
return $auth->forget([], 'GET', $v->email);
}
// форма логина
} else {
$auth = $this->c->Auth;
$auth->fIswev = ['s', __('Reg complete')];
$auth->fIswev = ['s', 'Reg complete'];
return $auth->login([], 'GET', $v->username);
}
@ -381,7 +381,7 @@ class Register extends Page
$this->c->Lang->load('register');
$auth = $this->c->Auth;
$auth->fIswev = ['s', __('Reg complete')];
$auth->fIswev = ['s', 'Reg complete'];
return $auth->login([], 'GET', $user->username);
}

View file

@ -37,7 +37,7 @@ class Report extends Page
$floodSize = \time() - (int) $this->user->last_report_sent;
$floodSize = $floodSize < $this->user->g_report_flood ? $this->user->g_report_flood - $floodSize : 0;
if ($floodSize > 0) {
$this->fIswev = ['e', __(['Flood message', $floodSize])];
$this->fIswev = ['e', ['Flood message', $floodSize]];
}
$data = [];
@ -95,7 +95,7 @@ class Report extends Page
}
if (false === $result && 1 === $this->c->config->i_report_method) {
$this->fIswev = ['e', __(['Error mail', $this->c->config->o_admin_email])];
$this->fIswev = ['e', ['Error mail', $this->c->config->o_admin_email]];
} else {
return $this->c->Redirect->page('ViewPost', ['id' => $post->id])->message('Report redirect');
}

View file

@ -500,7 +500,7 @@ class Search extends Page
if (false === $list) {
return $this->c->Message->message('Bad request');
} elseif (empty($list)) {
$this->fIswev = ['i', __('No hits')];
$this->fIswev = ['i', 'No hits'];
return $this->view([], 'GET', true);
}

View file

@ -134,7 +134,7 @@ class Userlist extends Page
$this->startNum = 0;
$this->userList = null;
$this->links = [null, null, null, null, null, null];
$this->fIswev = ['i', __('No users found')];
$this->fIswev = ['i', 'No users found'];
}
$this->fIndex = 'userlist';

View file

@ -65,7 +65,7 @@
<div class="f-hcell f-clast">{!! __('Last post') !!}</div>
</li>
@foreach ($p->topics as $id => $topic)
@if (empty($topic->id) && $iswev = ['e' => [__(['Topic %s was not found in the database', $id])]])
@if (empty($topic->id) && $iswev = ['e' => [['Topic %s was not found in the database', $id]]])
<li id="topic-{{ $id }}" class="f-row">
@include ('layouts/iswev')
</li>

View file

@ -42,7 +42,7 @@
<section class="f-main f-topic">
<h2>{{ $p->model->censorSubject }}</h2>
@foreach ($p->posts as $id => $post)
@if (empty($post->id) && $iswev = ['e' => [__(['Message %s was not found in the database', $id])]])
@if (empty($post->id) && $iswev = ['e' => [['Message %s was not found in the database', $id]]])
@include ('layouts/iswev')
@else
<article id="p{{ $post->id }}" class="f-post @if (1 == $post->user->gender) f-user-male @elseif (2 == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif @if (1 === $post->postNumber) f-post-first @endif">

View file

@ -32,7 +32,7 @@
<section class="f-main f-topic">
<h2>{{ $p->model->name }}</h2>
@foreach ($p->posts as $id => $post)
@if (empty($post->id) && $iswev = ['e' => [__(['Message %s was not found in the database', $id])]])
@if (empty($post->id) && $iswev = ['e' => [['Message %s was not found in the database', $id]]])
@include ('layouts/iswev')
@else
<article id="p{{ $post->id }}" class="f-post f-post-search @if (1 == $post->user->gender) f-user-male @elseif (2 == $post->user->gender) f-user-female @endif @if ($post->user->online) f-user-online @endif">