2018-04-23
This commit is contained in:
parent
009754078b
commit
5d28e0be05
5 changed files with 195 additions and 100 deletions
|
@ -69,36 +69,37 @@ class Categories extends Admin
|
|||
],
|
||||
];
|
||||
|
||||
$fieldset = [];
|
||||
foreach ($this->c->categories->getList() as $key => $row) {
|
||||
$fieldset["form[{$key}][cat_name]"] = [
|
||||
'class' => ['name', 'adm-inline'],
|
||||
$fields = [];
|
||||
$fields["form[{$key}][cat_name]"] = [
|
||||
'class' => ['name', 'category'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 80,
|
||||
'value' => $row['cat_name'],
|
||||
'caption' => \ForkBB\__('Category name label'),
|
||||
'required' => true,
|
||||
];
|
||||
$fieldset["form[{$key}][disp_position]"] = [
|
||||
'class' => ['position', 'adm-inline'],
|
||||
$fields["form[{$key}][disp_position]"] = [
|
||||
'class' => ['position', 'category'],
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 9999999999,
|
||||
'value' => $row['disp_position'],
|
||||
'caption' => \ForkBB\__('Category position label'),
|
||||
];
|
||||
$fieldset[] = [
|
||||
'class' => ['delete', 'adm-inline'],
|
||||
$fields["delete-btn{$key}"] = [
|
||||
'class' => ['delete', 'category'],
|
||||
'type' => 'btn',
|
||||
'value' => '❌',
|
||||
'caption' => \ForkBB\__('Delete'),
|
||||
'link' => $this->c->Router->link('AdminCategoriesDelete', ['id' => $key]),
|
||||
];
|
||||
$form['sets']["category{$key}"] = [
|
||||
'class' => 'category',
|
||||
'legend' => $row['cat_name'],
|
||||
'fields' => $fields,
|
||||
];
|
||||
}
|
||||
$form['sets']['cats'] = [
|
||||
'class' => 'inline',
|
||||
'fields' => $fieldset,
|
||||
];
|
||||
$form['sets']['new-cat'] = [
|
||||
'fields' => [
|
||||
'new' => [
|
||||
|
|
|
@ -87,14 +87,14 @@ class Censoring extends Admin
|
|||
$fieldset = [];
|
||||
foreach ($this->c->censorship->load() as $id => $row) {
|
||||
$fieldset["form[{$id}][search_for]"] = [
|
||||
'class' => ['censor', 'adm-inline'],
|
||||
'class' => ['censor'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 60,
|
||||
'value' => $row['search_for'],
|
||||
'caption' => \ForkBB\__('Censored word label'),
|
||||
];
|
||||
$fieldset["form[{$id}][replace_with]"] = [
|
||||
'class' => ['censor', 'adm-inline'],
|
||||
'class' => ['censor'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 60,
|
||||
'value' => $row['replace_with'],
|
||||
|
@ -102,14 +102,14 @@ class Censoring extends Admin
|
|||
];
|
||||
}
|
||||
$fieldset["form[0][search_for]"] = [
|
||||
'class' => ['censor', 'adm-inline'],
|
||||
'class' => ['censor'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 60,
|
||||
'value' => '',
|
||||
'caption' => \ForkBB\__('Censored word label'),
|
||||
];
|
||||
$fieldset["form[0][replace_with]"] = [
|
||||
'class' => ['censor', 'adm-inline'],
|
||||
'class' => ['censor'],
|
||||
'type' => 'text',
|
||||
'maxlength' => 60,
|
||||
'value' => '',
|
||||
|
@ -117,7 +117,7 @@ class Censoring extends Admin
|
|||
];
|
||||
|
||||
$form['sets']['cens'] = [
|
||||
'class' => 'inline',
|
||||
'class' => 'censor',
|
||||
'fields' => $fieldset,
|
||||
];
|
||||
|
||||
|
|
|
@ -143,20 +143,11 @@ class Forums extends Admin
|
|||
|
||||
if ($root instanceof Forum) {
|
||||
$list = $this->c->forums->depthList($root, -1);
|
||||
$cid = null;
|
||||
|
||||
$fieldset = [];
|
||||
$cid = null;
|
||||
foreach ($list as $forum) {
|
||||
if ($cid !== $forum->cat_id) {
|
||||
if (null !== $cid) {
|
||||
$form['sets']["cat{$cid}"] = [
|
||||
'class' => 'inline',
|
||||
'fields' => $fieldset,
|
||||
];
|
||||
$fieldset = [];
|
||||
}
|
||||
|
||||
$form['sets']["cat{$forum->cat_id}-info"] = [
|
||||
$form['sets']["category{$forum->cat_id}-info"] = [
|
||||
'info' => [
|
||||
'info1' => [
|
||||
'type' => '', //????
|
||||
|
@ -167,15 +158,16 @@ class Forums extends Admin
|
|||
$cid = $forum->cat_id;
|
||||
}
|
||||
|
||||
$fieldset["forum{$forum->id}"] = [
|
||||
'class' => ['name', 'adm-inline', 'depth' . $forum->depth],
|
||||
$fields = [];
|
||||
$fields["name-btn{$forum->id}"] = [
|
||||
'class' => ['name', 'forum', 'depth' . $forum->depth],
|
||||
'type' => 'btn',
|
||||
'value' => $forum->forum_name,
|
||||
'caption' => \ForkBB\__('Forum label'),
|
||||
'link' => $this->c->Router->link('AdminForumsEdit', ['id' => $forum->id]),
|
||||
];
|
||||
$fieldset["form[{$forum->id}][disp_position]"] = [
|
||||
'class' => ['position', 'adm-inline'],
|
||||
$fields["form[{$forum->id}][disp_position]"] = [
|
||||
'class' => ['position', 'forum'],
|
||||
'type' => 'number',
|
||||
'min' => 0,
|
||||
'max' => 9999999999,
|
||||
|
@ -183,20 +175,20 @@ class Forums extends Admin
|
|||
'caption' => \ForkBB\__('Position label'),
|
||||
];
|
||||
$disabled = (bool) $forum->subforums;
|
||||
$fieldset["forum{$forum->id}-del"] = [
|
||||
'class' => ['delete', 'adm-inline'],
|
||||
$fields["delete-btn{$forum->id}"] = [
|
||||
'class' => ['delete', 'forum'],
|
||||
'type' => 'btn',
|
||||
'value' => '❌',
|
||||
'caption' => \ForkBB\__('Delete'),
|
||||
'link' => $disabled ? '#' : $this->c->Router->link('AdminForumsDelete', ['id' => $forum->id]),
|
||||
'disabled' => $disabled,
|
||||
];
|
||||
$form['sets']["forum{$forum->id}"] = [
|
||||
'class' => 'forum',
|
||||
'legend' => $forum->cat_name . ' / ' . $forum->forum_name,
|
||||
'fields' => $fields,
|
||||
];
|
||||
}
|
||||
|
||||
$form['sets']["cat{$cid}"] = [
|
||||
'class' => 'inline',
|
||||
'fields' => $fieldset,
|
||||
];
|
||||
}
|
||||
|
||||
$this->nameTpl = 'admin/form';
|
||||
|
@ -495,11 +487,11 @@ class Forums extends Admin
|
|||
],
|
||||
];
|
||||
|
||||
$aOn = ['cando', 'adm-inline', 'on'];
|
||||
$aOff = ['cando', 'adm-inline', 'off'];
|
||||
$aOn = ['cando', 'on'];
|
||||
$aOff = ['cando', 'off'];
|
||||
foreach ($this->c->groups->Perm->get($forum) as $id => $group) {
|
||||
$fieldset = [];
|
||||
$fieldset["perms[{$id}][read_forum]"] = [
|
||||
$fields = [];
|
||||
$fields["perms[{$id}][read_forum]"] = [
|
||||
'class' => $group->def_read_forum ? $aOn : $aOff,
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
|
@ -508,7 +500,7 @@ class Forums extends Admin
|
|||
'checked' => $group->set_read_forum,
|
||||
'disabled' => $group->dis_read_forum,
|
||||
];
|
||||
$fieldset["perms[{$id}][post_replies]"] = [
|
||||
$fields["perms[{$id}][post_replies]"] = [
|
||||
'class' => $group->def_post_replies ? $aOn : $aOff,
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
|
@ -517,7 +509,7 @@ class Forums extends Admin
|
|||
'checked' => $group->set_post_replies,
|
||||
'disabled' => $group->dis_post_replies,
|
||||
];
|
||||
$fieldset["perms[{$id}][post_topics]"] = [
|
||||
$fields["perms[{$id}][post_topics]"] = [
|
||||
'class' => $group->def_post_topics ? $aOn : $aOff,
|
||||
'type' => 'checkbox',
|
||||
'value' => '1',
|
||||
|
@ -528,9 +520,9 @@ class Forums extends Admin
|
|||
];
|
||||
|
||||
$form['sets']["perms{$id}"] = [
|
||||
'class' => 'inline',
|
||||
'class' => 'permission',
|
||||
'legend' => \ForkBB\e($group->g_title),
|
||||
'fields' => $fieldset,
|
||||
'fields' => $fields,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -509,7 +509,7 @@ class Users extends Admin
|
|||
$fields = [];
|
||||
|
||||
$fields["l{$number}-username"] = [
|
||||
# 'class' => 'pline',
|
||||
'class' => ['result'],
|
||||
'type' => 'link',
|
||||
'caption' => \ForkBB\__('Results username head'),
|
||||
'value' => $user->username,
|
||||
|
@ -517,7 +517,7 @@ class Users extends Admin
|
|||
# 'title' => \ForkBB\__('Show posts'),
|
||||
];
|
||||
$fields["l{$number}-email"] = [
|
||||
# 'class' => 'pline',
|
||||
'class' => ['result'],
|
||||
'type' => 'link',
|
||||
'caption' => \ForkBB\__('Results e-mail head'),
|
||||
'value' => $user->email,
|
||||
|
@ -525,13 +525,13 @@ class Users extends Admin
|
|||
# 'title' => \ForkBB\__('Show posts'),
|
||||
];
|
||||
$fields["l{$number}-title"] = [
|
||||
# 'class' => 'pline',
|
||||
'class' => ['result'],
|
||||
'type' => 'str',
|
||||
'caption' => \ForkBB\__('Results title head'),
|
||||
'value' => $user->title(),
|
||||
];
|
||||
$fields["l{$number}-posts"] = [
|
||||
# 'class' => 'pline',
|
||||
'class' => ['result'],
|
||||
'type' => $user->num_posts ? 'link' : 'str',
|
||||
'caption' => \ForkBB\__('Results posts head'),
|
||||
'value' => \ForkBB\num($user->num_posts),
|
||||
|
@ -539,7 +539,7 @@ class Users extends Admin
|
|||
'title' => \ForkBB\__('Results show posts link'),
|
||||
];
|
||||
$fields["l{$number}-note"] = [
|
||||
# 'class' => 'pline',
|
||||
'class' => ['result'],
|
||||
'type' => 'str',
|
||||
'caption' => \ForkBB\__('Примечание админа'),
|
||||
'value' => $user->admin_note,
|
||||
|
@ -549,6 +549,7 @@ class Users extends Admin
|
|||
|
||||
|
||||
$form['sets']["l{$number}"] = [
|
||||
'class' => 'result',
|
||||
'legend' => $number,
|
||||
'fields' => $fields,
|
||||
];
|
||||
|
|
|
@ -1663,62 +1663,107 @@ select {
|
|||
|
||||
/*********************/
|
||||
/* Админка/Категории */
|
||||
/* Админка/Разделы */
|
||||
/*********************/
|
||||
.f-fs-inline {
|
||||
.f-fs-category {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.f-fs-inline .f-field-adm-inline,
|
||||
.f-fs-inline .f-field-cando {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.f-field-adm-inline > dt {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
.f-fs-category > legend {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-field-adm-inline > dd {
|
||||
display: block;
|
||||
.f-fs-category .f-child1 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.f-field-category {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.f-field-category > dt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-field-category > dd {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-name {
|
||||
.f-fs-category:first-of-type .f-field-category > dt {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.f-field-category.f-field-name {
|
||||
width: calc(100% - 8rem);
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-position {
|
||||
.f-field-category.f-field-position {
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-delete {
|
||||
.f-field-category.f-field-delete {
|
||||
width: 3rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.f-field-adm-inline .f-btn {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.f-field-delete .f-btn {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.f-field-name .f-btn {
|
||||
/*********************/
|
||||
/* Админка/Разделы */
|
||||
/*********************/
|
||||
.f-fs-forum {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.f-fs-forum > legend {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-fs-forum .f-child1 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.f-field-forum {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.f-field-forum > dt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-field-forum > dd {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.f-finfo + .f-fs-forum .f-field-forum > dt {
|
||||
display: block;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.f-field-adm-inline:nth-child(-n+3) > dt {
|
||||
display: block;
|
||||
.f-field-forum.f-field-name {
|
||||
width: calc(100% - 8rem);
|
||||
}
|
||||
|
||||
.f-field-adm-inline .f-child1 {
|
||||
font-weight: normal;
|
||||
.f-field-forum.f-field-position {
|
||||
width: 5rem;
|
||||
}
|
||||
|
||||
.f-field-forum.f-field-delete {
|
||||
width: 3rem;
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.f-field-forum.f-field-name .f-btn {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
@ -1744,27 +1789,33 @@ select {
|
|||
padding-left: 3.125rem;
|
||||
}
|
||||
|
||||
/*********************/
|
||||
/* Админка/Разделы */
|
||||
/*********************/
|
||||
.f-field-adm-inline.f-field-cando {
|
||||
.f-fs-permission {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.f-fs-permission > legend {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.f-fs-permission .f-child1 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.f-fs-permission .f-field-cando {
|
||||
width: 33.333%;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-cando > dt {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* .f-field-adm-inline > dt > label {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
} */
|
||||
|
||||
.f-editforum-form legend {
|
||||
margin-bottom: 0;
|
||||
.f-fs-permission .f-field-cando > dt,
|
||||
.f-fs-permission .f-field-cando > dd {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.f-field-on input:not(:checked) + span {
|
||||
|
@ -1813,16 +1864,34 @@ select {
|
|||
/*********************/
|
||||
/* Админка/Цензура */
|
||||
/*********************/
|
||||
.f-field-adm-inline.f-field-censor {
|
||||
width: 50%;
|
||||
.f-fs-censor {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-censor > dt {
|
||||
.f-fs-censor .f-child1 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.f-fs-censor .f-field-censor {
|
||||
width: 50%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.f-fs-censor .f-field-censor > dt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-field-adm-inline.f-field-censor:nth-child(-n+2) > dt {
|
||||
.f-fs-censor .f-field-censor > dd {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.f-field-censor:nth-child(-n+2) > dt {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/*************/
|
||||
|
@ -2208,3 +2277,35 @@ select {
|
|||
width: 67%
|
||||
}
|
||||
}
|
||||
|
||||
/************************/
|
||||
/* Админка/Пользователи */
|
||||
/************************/
|
||||
.f-fs-result {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.f-fs-result > legend {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-fs-result .f-field-result {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.f-fs-result .f-field-result > dt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.f-fs-result .f-field-result > dd {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.f-fs-result:first-of-type .f-field-result > dt {
|
||||
display: block;
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
}
|
Loading…
Add table
Reference in a new issue