2018-03-25

This commit is contained in:
Visman 2018-03-25 14:50:22 +07:00
parent 430fb5d8fd
commit abe2ebb477
6 changed files with 32 additions and 22 deletions

View file

@ -2,6 +2,8 @@
namespace ForkBB\Core;
use ForkBB\Core\Container;
class Func
{
/**

View file

@ -140,13 +140,19 @@ class Profile extends Page
];
}
if ($isEdit) {
$form['enctype'] = 'multipart/form-data';
$form['hidden']['MAX_FILE_SIZE'] = 999999999;
$fields['upload_avatar'] = [
'id' => 'upload_avatar',
'type' => 'text',
'maxlength' => 50,
'type' => 'file',
'caption' => \ForkBB\__('New avatar'),
'value' => '',
'info' => \ForkBB\__('New avatar info', \ForkBB\num($this->c->config->o_avatars_width), \ForkBB\num($this->c->config->o_avatars_height), \ForkBB\num($this->c->config->o_avatars_size), \ForkBB\size($this->c->config->o_avatars_size)),
'info' => \ForkBB\__('New avatar info',
\ForkBB\num($this->c->config->o_avatars_width),
\ForkBB\num($this->c->config->o_avatars_height),
\ForkBB\num($this->c->config->o_avatars_size),
\ForkBB\size($this->c->config->o_avatars_size)
),
];
}
}

View file

@ -35,22 +35,22 @@ class Profile extends Rules
return $this;
}
public function getrename()
protected function getrename()
{
return $this->admin || ($this->moderator && '1' == $this->user->g_mod_rename_users);
}
public function getsetTitle()
protected function getsetTitle()
{
return $this->admin || $this->moderator || '1' == $this->user->g_set_title;
}
public function getviewOEmail()
protected function getviewOEmail()
{
return $this->my || $this->user->isAdmMod;
}
public function getviewEmail() // ?????
protected function getviewEmail() // ?????
{
return ! $this->my
&& (($this->user->isAdmMod && 1 === $this->curUser->email_setting)
@ -58,27 +58,27 @@ class Profile extends Rules
);
}
public function getviewLastVisit()
protected function getviewLastVisit()
{
return $this->my || $this->user->isAdmMod;
}
public function getbanUser()
protected function getbanUser()
{
return ! $this->my && ($this->admin || ($this->moderator && '1' == $this->user->g_mod_ban_users));
}
public function getdeleteUser()
protected function getdeleteUser()
{
return ! $this->my && ($this->admin || $this->moderator); // ????
}
public function getviewIP()
protected function getviewIP()
{
return $this->user->isAdmin;
}
public function getuseAvatar()
protected function getuseAvatar()
{
return '1' == $this->c->config->o_avatars;
}

View file

@ -133,10 +133,10 @@ msgid "UTC+14:00"
msgstr "(UTC+14:00) Line Islands"
msgid "Display e-mail label"
msgstr "Display email address to other users."
msgstr "Display email address to other users"
msgid "Hide allow form label"
msgstr "Hide email address but allow form e-mail."
msgstr "Hide email address but allow form e-mail"
msgid "Hide both label"
msgstr "Hide email address and disallow form email."
msgstr "Hide email address and disallow form email"

View file

@ -133,10 +133,10 @@ msgid "UTC+14:00"
msgstr "(UTC+14:00) о-ва Лайн"
msgid "Display e-mail label"
msgstr "Показывать email другим пользователя."
msgstr "Показывать email другим пользователя"
msgid "Hide allow form label"
msgstr "Спрятать email, но разрешить отправку писем через специальную форму."
msgstr "Спрятать email, но разрешить отправку писем через специальную форму"
msgid "Hide both label"
msgstr "Спрятать email и запретить отправку писем."
msgstr "Спрятать email и запретить отправку писем"

View file

@ -1,5 +1,5 @@
@if ($form['action'])
<form class="f-form" method="post" action="{!! $form['action'] !!}">
<form class="f-form" method="post" action="{!! $form['action'] !!}" @if ($form['enctype']) enctype="{{ $form['enctype'] }}" @endif>
@if ($form['hidden'])
@foreach ($form['hidden'] as $key => $val)
<input type="hidden" name="{{ $key }}" value="{{ $val }}">
@ -100,12 +100,14 @@
<input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="password" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
@elseif ('btn' === $cur['type'])
<a class="f-btn @if ($cur['disabled']) f-disabled @endif" href="{!! $cur['link'] !!}" @if ($cur['disabled']) tabindex="-1" @endif>{{ $cur['value'] }}</a>
@elseif ('yield' === $cur['type'])
{!! $this->block($cur['value']) !!}
@elseif ('str' === $cur['type'])
<p class="f-str" id="id-{{ $key }}">{{ $cur['value'] }}</p>
@elseif ('link' === $cur['type'])
<a class="f-link" id="id-{{ $key }}" href="{{ $cur['href'] or '' }}" title="{{ $cur['title'] or '' }}">{{ $cur['value'] or '' }}</a>
@elseif ('yield' === $cur['type'])
{!! $this->block($cur['value']) !!}
@elseif ('file' === $cur['type'])
<input @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="file">
@endif
@if ($cur['info'])
<p class="f-child4">{!! $cur['info'] !!}</p>