diff --git a/app/Models/Pages/Admin/Categories.php b/app/Models/Pages/Admin/Categories.php index d4740303..0322c817 100644 --- a/app/Models/Pages/Admin/Categories.php +++ b/app/Models/Pages/Admin/Categories.php @@ -95,11 +95,11 @@ class Categories extends Admin 'link' => $this->c->Router->link('AdminCategoriesDelete', ['id' => $key]), ]; } - $form['sets'][] = [ + $form['sets']['cats'] = [ 'class' => 'inline', 'fields' => $fieldset, ]; - $form['sets'][] = [ + $form['sets']['new-cat'] = [ 'fields' => [ 'new' => [ 'class' => 'new', @@ -186,7 +186,7 @@ class Categories extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['del'] = [ 'fields' => [ 'confirm' => [ 'caption' => \ForkBB\__('Confirm delete'), @@ -197,7 +197,7 @@ class Categories extends Admin ], ], ]; - $form['sets'][] = [ + $form['sets']['del-info'] = [ 'info' => [ 'info1' => [ 'type' => '', //???? diff --git a/app/Models/Pages/Admin/Censoring.php b/app/Models/Pages/Admin/Censoring.php index 6274c37b..cd3195de 100644 --- a/app/Models/Pages/Admin/Censoring.php +++ b/app/Models/Pages/Admin/Censoring.php @@ -54,7 +54,7 @@ class Censoring extends Admin 'token' => $this->c->Csrf->create('AdminCensoring'), ], 'sets' => [ - [ + 'onoff' => [ 'fields' => [ 'o_censoring' => [ 'type' => 'radio', @@ -65,7 +65,7 @@ class Censoring extends Admin ], ], ], - [ + 'onoff-info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -116,7 +116,7 @@ class Censoring extends Admin 'caption' => \ForkBB\__('Replacement label'), ]; - $form['sets'][] = [ + $form['sets']['cens'] = [ 'class' => 'inline', 'fields' => $fieldset, ]; diff --git a/app/Models/Pages/Admin/Forums.php b/app/Models/Pages/Admin/Forums.php index cd011b5c..12f518e4 100644 --- a/app/Models/Pages/Admin/Forums.php +++ b/app/Models/Pages/Admin/Forums.php @@ -149,14 +149,14 @@ class Forums extends Admin foreach ($list as $forum) { if ($cid !== $forum->cat_id) { if (null !== $cid) { - $form['sets'][] = [ + $form['sets']["cat{$cid}"] = [ 'class' => 'inline', 'fields' => $fieldset, ]; $fieldset = []; } - $form['sets'][] = [ + $form['sets']["cat{$forum->cat_id}-info"] = [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -167,7 +167,7 @@ class Forums extends Admin $cid = $forum->cat_id; } - $fieldset[] = [ + $fieldset["forum{$forum->id}"] = [ 'class' => ['name', 'adm-inline', 'depth' . $forum->depth], 'type' => 'btn', 'value' => $forum->forum_name, @@ -183,7 +183,7 @@ class Forums extends Admin 'caption' => \ForkBB\__('Position label'), ]; $disabled = (bool) $forum->subforums; - $fieldset[] = [ + $fieldset["forum{$forum->id}-del"] = [ 'class' => ['delete', 'adm-inline'], 'type' => 'btn', 'value' => '❌', @@ -193,7 +193,7 @@ class Forums extends Admin ]; } - $form['sets'][] = [ + $form['sets']["cat{$cid}"] = [ 'class' => 'inline', 'fields' => $fieldset, ]; @@ -441,7 +441,7 @@ class Forums extends Admin 'accesskey' => 's', ]; - $form['sets'][] = [ + $form['sets']['forum'] = [ 'fields' => [ 'forum_name' => [ 'type' => 'text', @@ -484,7 +484,7 @@ class Forums extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['forum-info'] = [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -526,7 +526,7 @@ class Forums extends Admin 'disabled' => $group->dis_post_topics, ]; - $form['sets'][] = [ + $form['sets']["perms{$id}"] = [ 'class' => 'inline', 'legend' => \ForkBB\e($group->g_title), 'fields' => $fieldset, diff --git a/app/Models/Pages/Admin/Groups.php b/app/Models/Pages/Admin/Groups.php index 4c526f2a..2dc6c04c 100644 --- a/app/Models/Pages/Admin/Groups.php +++ b/app/Models/Pages/Admin/Groups.php @@ -56,18 +56,20 @@ class Groups extends Admin 'hidden' => [ 'token' => $this->c->Csrf->create('AdminGroupsNew'), ], - 'sets' => [[ - 'fields' => [ - 'basegroup' => [ - 'type' => 'select', - 'options' => $this->groupsNew, - 'value' => $this->c->config->o_default_user_group, - 'caption' => \ForkBB\__('New group label'), - 'info' => \ForkBB\__('New group help'), -# 'autofocus' => true, + 'sets' => [ + 'base' => [ + 'fields' => [ + 'basegroup' => [ + 'type' => 'select', + 'options' => $this->groupsNew, + 'value' => $this->c->config->o_default_user_group, + 'caption' => \ForkBB\__('New group label'), + 'info' => \ForkBB\__('New group help'), +# 'autofocus' => true, + ], ], ], - ]], + ], 'btns' => [ 'submit' => [ 'type' => 'submit', @@ -81,17 +83,19 @@ class Groups extends Admin 'hidden' => [ 'token' => $this->c->Csrf->create('AdminGroupsDefault'), ], - 'sets' => [[ - 'fields' => [ - 'defaultgroup' => [ - 'type' => 'select', - 'options' => $this->groupsDefault, - 'value' => $this->c->config->o_default_user_group, - 'caption' => \ForkBB\__('Default group label'), - 'info' => \ForkBB\__('Default group help'), + 'sets' => [ + 'del' => [ + 'fields' => [ + 'defaultgroup' => [ + 'type' => 'select', + 'options' => $this->groupsDefault, + 'value' => $this->c->config->o_default_user_group, + 'caption' => \ForkBB\__('Default group label'), + 'info' => \ForkBB\__('Default group help'), + ], ], ], - ]], + ], 'btns' => [ 'submit' => [ 'type' => 'submit', @@ -337,7 +341,7 @@ class Groups extends Admin ]; if (! $group->groupAdmin) { - $form['sets'][] = [ + $form['sets']['def-info'] = [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -365,7 +369,7 @@ class Groups extends Admin ]; if ($group->groupAdmin) { - $form['sets'][] = [ + $form['sets']['group-data'] = [ 'fields' => $fieldset, ]; return $form; @@ -581,12 +585,12 @@ class Groups extends Admin ]; } - $form['sets'][] = [ + $form['sets']['group-data'] = [ 'fields' => $fieldset, ]; if (! empty($group->g_moderator)) { - $form['sets'][] = [ + $form['sets']['mod-info'] = [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -682,7 +686,7 @@ class Groups extends Admin ]; if ($count) { - $form['sets'][] = [ + $form['sets']['move'] = [ 'fields' => [ 'movegroup' => [ 'type' => 'select', @@ -695,7 +699,7 @@ class Groups extends Admin ]; } - $form['sets'][] = [ + $form['sets']['conf'] = [ 'fields' => [ 'confirm' => [ 'caption' => \ForkBB\__('Confirm delete'), @@ -706,7 +710,7 @@ class Groups extends Admin ], ], ]; - $form['sets'][] = [ + $form['sets']['conf-info'] = [ 'info' => [ 'info1' => [ 'type' => '', //???? diff --git a/app/Models/Pages/Admin/Maintenance.php b/app/Models/Pages/Admin/Maintenance.php index e4d84057..900f5057 100644 --- a/app/Models/Pages/Admin/Maintenance.php +++ b/app/Models/Pages/Admin/Maintenance.php @@ -56,7 +56,7 @@ class Maintenance extends Admin 'token' => $this->c->Csrf->create('AdminMaintenance'), ], 'sets' => [ - [ + 'maint' => [ 'fields' => [ 'o_maintenance' => [ 'type' => 'radio', @@ -89,7 +89,7 @@ class Maintenance extends Admin 'token' => $this->c->Csrf->create('AdminMaintenanceRebuild'), ], 'sets' => [ - [ + 'indx-info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -98,7 +98,7 @@ class Maintenance extends Admin ], ], ], - [ + 'indx' => [ 'fields' => [ 'limit' => [ 'type' => 'number', @@ -125,7 +125,7 @@ class Maintenance extends Admin ], ], ], - [ + 'indx-info2' => [ 'info' => [ 'info1' => [ 'type' => '', //???? diff --git a/app/Models/Pages/Admin/Options.php b/app/Models/Pages/Admin/Options.php index 3564fe73..8abd5311 100644 --- a/app/Models/Pages/Admin/Options.php +++ b/app/Models/Pages/Admin/Options.php @@ -208,7 +208,7 @@ class Options extends Admin $styles = $this->c->Func->getStyles(); $styles = \array_combine($styles, $styles); - $form['sets'][] = [ + $form['sets']['essentials'] = [ 'legend' => \ForkBB\__('Essentials subhead'), 'fields' => [ 'o_board_title' => [ @@ -302,7 +302,7 @@ class Options extends Admin $time = \ForkBB\dt($timestamp, false, $config->o_date_format, $config->o_time_format, true, true); $date = \ForkBB\dt($timestamp, true, $config->o_date_format, $config->o_time_format, false, true); - $form['sets'][] = [ + $form['sets']['timeouts'] = [ 'legend' => \ForkBB\__('Timeouts subhead'), 'fields' => [ 'o_time_format' => [ @@ -348,7 +348,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['display'] = [ 'legend' => \ForkBB\__('Display subhead'), 'fields' => [ 'o_show_user_info' => [ @@ -437,7 +437,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['features'] = [ 'legend' => \ForkBB\__('Features subhead'), 'fields' => [ 'o_quickpost' => [ @@ -499,7 +499,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['feed'] = [ 'legend' => \ForkBB\__('Feed subhead'), 'fields' => [ 'o_feed_type' => [ @@ -530,7 +530,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['reports'] = [ 'legend' => \ForkBB\__('Reports subhead'), 'fields' => [ 'o_report_method' => [ @@ -553,7 +553,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['avatars'] = [ 'legend' => \ForkBB\__('Avatars subhead'), 'fields' => [ 'o_avatars' => [ @@ -598,7 +598,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['email'] = [ 'legend' => \ForkBB\__('E-mail subhead'), 'fields' => [ 'o_admin_email' => [ @@ -668,7 +668,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['registration'] = [ 'legend' => \ForkBB\__('Registration subhead'), 'fields' => [ 'o_regs_allow' => [ @@ -720,7 +720,7 @@ class Options extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['announcement'] = [ 'legend' => \ForkBB\__('Announcement subhead'), 'fields' => [ 'o_announcement' => [ diff --git a/app/Models/Pages/Admin/Permissions.php b/app/Models/Pages/Admin/Permissions.php index 57e4519e..b0684979 100644 --- a/app/Models/Pages/Admin/Permissions.php +++ b/app/Models/Pages/Admin/Permissions.php @@ -96,7 +96,7 @@ class Permissions extends Admin $yn = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')]; - $form['sets'][] = [ + $form['sets']['posting'] = [ 'legend' => \ForkBB\__('Posting subhead'), 'fields' => [ 'p_message_bbcode' => [ @@ -137,7 +137,7 @@ class Permissions extends Admin ], ]; - $form['sets'][] = [ + $form['sets']['signatures'] = [ 'legend' => \ForkBB\__('Signatures subhead'), 'fields' => [ 'p_sig_bbcode' => [ diff --git a/app/Models/Pages/Delete.php b/app/Models/Pages/Delete.php index d5dd366e..e521c50f 100644 --- a/app/Models/Pages/Delete.php +++ b/app/Models/Pages/Delete.php @@ -40,15 +40,15 @@ class Delete extends Page ])->addArguments([ 'token' => $args, ]); - + if (! $v->validation($_POST) || null === $v->delete) { return $this->c->Redirect->page('ViewPost', $args)->message('Cancel redirect'); } elseif ($v->confirm !== 1) { return $this->c->Redirect->page('ViewPost', $args)->message('No confirm redirect'); } - + $this->c->DB->beginTransaction(); - + if ($deleteTopic) { $redirect = $this->c->Redirect->page('Forum', ['id' => $topic->forum_id])->message('Topic del redirect'); $this->c->topics->delete($topic); @@ -56,9 +56,9 @@ class Delete extends Page $redirect = $this->c->Redirect->page('ViewPost', ['id' => $this->c->posts->previousPost($post)])->message('Post del redirect'); $this->c->posts->delete($post); } - + $this->c->DB->commit(); - + return $redirect; } @@ -76,7 +76,7 @@ class Delete extends Page 'token' => $this->c->Csrf->create('DeletePost', ['id' => $post->id]), ], 'sets' => [ - [ + 'info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -89,7 +89,7 @@ class Delete extends Page ], ], ], - [ + 'confirm' => [ 'fields' => [ 'confirm' => [ 'type' => 'checkbox', diff --git a/app/Models/Pages/Install.php b/app/Models/Pages/Install.php index a4c59138..f078da15 100644 --- a/app/Models/Pages/Install.php +++ b/app/Models/Pages/Install.php @@ -179,7 +179,7 @@ class Install extends Page 'token' => $this->c->Csrf->create('Install'), ], 'sets' => [ - [ + 'dlang' => [ 'fields' => [ 'installlang' => [ 'type' => 'select', @@ -207,7 +207,7 @@ class Install extends Page 'installlang' => $this->user->language, ], 'sets' => [ - [ + 'db-info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -220,7 +220,7 @@ class Install extends Page ], ], ], - [ + 'db' => [ 'fields' => [ 'dbtype' => [ 'type' => 'select', @@ -264,7 +264,7 @@ class Install extends Page ], ], ], - [ + 'adm-info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -277,7 +277,7 @@ class Install extends Page ], ], ], - [ + 'adm' => [ 'fields' => [ 'username' => [ 'type' => 'text', @@ -308,7 +308,7 @@ class Install extends Page ], ], - [ + 'board-info' => [ 'info' => [ 'info1' => [ 'type' => '', //???? @@ -321,7 +321,7 @@ class Install extends Page ], ], ], - [ + 'board' => [ 'fields' => [ 'title' => [ 'type' => 'text', diff --git a/app/Models/Pages/PostFormTrait.php b/app/Models/Pages/PostFormTrait.php index 6c5a47d6..a71482f2 100644 --- a/app/Models/Pages/PostFormTrait.php +++ b/app/Models/Pages/PostFormTrait.php @@ -94,7 +94,7 @@ trait PostFormTrait ], 'autofocus' => $autofocus, ]; - $form['sets'][] = [ + $form['sets']['uesm'] = [ 'fields' => $fieldset, ]; $autofocus = null; @@ -140,7 +140,7 @@ trait PostFormTrait ]; } if ($fieldset) { - $form['sets'][] = [ + $form['sets']['sett'] = [ 'legend' => \ForkBB\__('Options'), 'fields' => $fieldset, ]; diff --git a/app/Models/Pages/Profile.php b/app/Models/Pages/Profile.php index 7a326e76..1097bba2 100644 --- a/app/Models/Pages/Profile.php +++ b/app/Models/Pages/Profile.php @@ -55,7 +55,7 @@ abstract class Profile extends Page } /** - * Возвращает хлеьные крошки + * Возвращает хлебные крошки * * @param mixed ...$args * diff --git a/app/Models/Pages/Profile/Config.php b/app/Models/Pages/Profile/Config.php index a8863a3f..ad995637 100644 --- a/app/Models/Pages/Profile/Config.php +++ b/app/Models/Pages/Profile/Config.php @@ -121,27 +121,23 @@ class Config extends Profile $dateFormat[$key] = \ForkBB\dt(\time(), true, $value, null, false, true) . ($key ? '' : ' (' . \ForkBB\__('Default') . ')'); } - $form['sets'][] = [ - 'id' => 'essentials', + $form['sets']['essentials'] = [ 'legend' => \ForkBB\__('Essentials'), 'class' => 'data-edit', 'fields' => [ 'language' => [ - 'id' => 'language', 'type' => 'select', 'options' => $langs, 'value' => $this->curUser->language, 'caption' => \ForkBB\__('Language'), ], 'style' => [ - 'id' => 'style', 'type' => 'select', 'options' => $styles, 'value' => $this->curUser->style, 'caption' => \ForkBB\__('Style'), ], 'timezone' => [ - 'id' => 'timezone', 'type' => 'select', 'options' => [ '-12' => \ForkBB\__('UTC-12:00'), @@ -189,7 +185,6 @@ class Config extends Profile 'caption' => \ForkBB\__('Time zone'), ], 'dst' => [ - 'id' => 'dst', 'type' => 'radio', 'value' => $this->curUser->dst, 'values' => $yn, @@ -197,14 +192,12 @@ class Config extends Profile 'info' => \ForkBB\__('DST help'), ], 'time_format' => [ - 'id' => 'time_format', 'type' => 'select', 'options' => $timeFormat, 'value' => $this->curUser->time_format, 'caption' => \ForkBB\__('Time format'), ], 'date_format' => [ - 'id' => 'date_format', 'type' => 'select', 'options' => $dateFormat, 'value' => $this->curUser->date_format, @@ -213,13 +206,11 @@ class Config extends Profile ], ]; - $form['sets'][] = [ - 'id' => 'viewing-posts', + $form['sets']['viewing-posts'] = [ 'legend' => \ForkBB\__('Viewing posts'), 'class' => 'data-edit', 'fields' => [ 'show_smilies' => [ - 'id' => 'show_smilies', 'type' => 'radio', 'value' => $this->curUser->show_smilies, 'values' => $yn, @@ -227,7 +218,6 @@ class Config extends Profile 'info' => \ForkBB\__('Smilies info'), ], 'show_sig' => [ - 'id' => 'show_sig', 'type' => 'radio', 'value' => $this->curUser->show_sig, 'values' => $yn, @@ -235,7 +225,6 @@ class Config extends Profile 'info' => \ForkBB\__('Sigs info'), ], 'show_avatars' => [ - 'id' => 'show_avatars', 'type' => 'radio', 'value' => $this->curUser->show_avatars, 'values' => $yn, @@ -243,7 +232,6 @@ class Config extends Profile 'info' => \ForkBB\__('Avatars info'), ], 'show_img' => [ - 'id' => 'show_img', 'type' => 'radio', 'value' => $this->curUser->show_img, 'values' => $yn, @@ -251,7 +239,6 @@ class Config extends Profile 'info' => \ForkBB\__('Images info'), ], 'show_img_sig' => [ - 'id' => 'show_img_sig', 'type' => 'radio', 'value' => $this->curUser->show_img_sig, 'values' => $yn, @@ -260,13 +247,11 @@ class Config extends Profile ], ], ]; - $form['sets'][] = [ - 'id' => 'pagination', + $form['sets']['pagination'] = [ 'legend' => \ForkBB\__('Pagination'), 'class' => 'data-edit', 'fields' => [ 'disp_topics' => [ - 'id' => 'disp_topics', 'type' => 'number', 'min' => 10, 'max' => 50, @@ -275,7 +260,6 @@ class Config extends Profile 'info' => \ForkBB\__('For default'), ], 'disp_posts' => [ - 'id' => 'disp_posts', 'type' => 'number', 'min' => 10, 'max' => 50, diff --git a/app/Models/Pages/Profile/Edit.php b/app/Models/Pages/Profile/Edit.php index e3cc8e22..abaead60 100644 --- a/app/Models/Pages/Profile/Edit.php +++ b/app/Models/Pages/Profile/Edit.php @@ -206,7 +206,6 @@ class Edit extends Profile ]; if ($this->rules->rename) { $fields['username'] = [ - 'id' => 'username', 'type' => 'text', 'maxlength' => 25, 'caption' => \ForkBB\__('Username'), @@ -216,7 +215,6 @@ class Edit extends Profile ]; } else { $fields['username'] = [ - 'id' => 'username', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Username'), @@ -224,8 +222,7 @@ class Edit extends Profile ]; } if ($this->rules->editPass) { - $fields[] = [ - 'id' => 'change_pass', + $fields['change_pass'] = [ 'type' => 'link', 'value' => \ForkBB\__('Change passphrase'), 'href' => $this->c->Router->link('EditUserPass', ['id' => $this->curUser->id]), @@ -233,7 +230,6 @@ class Edit extends Profile } if ($this->rules->setTitle) { $fields['title'] = [ - 'id' => 'title', 'type' => 'text', 'maxlength' => 50, 'caption' => \ForkBB\__('Title'), @@ -242,7 +238,6 @@ class Edit extends Profile ]; } else { $fields['title'] = [ - 'id' => 'title', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Title'), @@ -255,7 +250,6 @@ class Edit extends Profile if ($this->rules->useAvatar) { if (! $this->curUser->avatar) { $fields['avatar'] = [ - 'id' => 'avatar', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Avatar'), @@ -263,7 +257,6 @@ class Edit extends Profile ]; } elseif ($this->curUser->avatar) { $fields['avatar'] = [ - 'id' => 'avatar', 'type' => 'yield', 'caption' => \ForkBB\__('Avatar'), 'value' => 'avatar', @@ -275,7 +268,6 @@ class Edit extends Profile if ($this->curUser->avatar) { $fields['delete_avatar'] = [ - 'id' => 'delete_avatar', 'type' => 'checkbox', 'label' => \ForkBB\__('Delete avatar'), 'value' => '1', @@ -284,7 +276,6 @@ class Edit extends Profile } $fields['upload_avatar'] = [ - 'id' => 'upload_avatar', 'type' => 'file', 'caption' => \ForkBB\__('New avatar'), 'info' => \ForkBB\__('New avatar info', @@ -295,8 +286,7 @@ class Edit extends Profile ), ]; } - $form['sets'][] = [ - 'id' => 'header', + $form['sets']['header'] = [ 'class' => 'header-edit', # 'legend' => \ForkBB\__('Options'), 'fields' => $fields, @@ -304,13 +294,11 @@ class Edit extends Profile // примечание администрации if ($this->user->isAdmMod) { - $form['sets'][] = [ - 'id' => 'note', + $form['sets']['note'] = [ 'class' => 'data-edit', 'legend' => \ForkBB\__('Admin note'), 'fields' => [ 'admin_note' => [ - 'id' => 'admin_note', 'type' => 'text', 'maxlength' => 30, 'caption' => \ForkBB\__('Admin note'), @@ -323,7 +311,6 @@ class Edit extends Profile // личное $fields = []; $fields['realname'] = [ - 'id' => 'realname', 'type' => 'text', 'maxlength' => 40, 'caption' => \ForkBB\__('Realname'), @@ -335,7 +322,6 @@ class Edit extends Profile 2 => \ForkBB\__('Female'), ]; $fields['gender'] = [ - 'id' => 'gender', 'class' => 'block', 'type' => 'radio', 'value' => $this->curUser->gender, @@ -343,14 +329,12 @@ class Edit extends Profile 'caption' => \ForkBB\__('Gender'), ]; $fields['location'] = [ - 'id' => 'location', 'type' => 'text', 'maxlength' => 30, 'caption' => \ForkBB\__('Location'), 'value' => $this->curUser->location, ]; - $form['sets'][] = [ - 'id' => 'personal', + $form['sets']['personal'] = [ 'class' => 'data-edit', 'legend' => \ForkBB\__('Personal information'), 'fields' => $fields, @@ -360,7 +344,6 @@ class Edit extends Profile $fields = []; if ($this->rules->viewOEmail) { $fields['open-email'] = [ - 'id' => 'open-email', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Email info'), @@ -368,15 +351,13 @@ class Edit extends Profile ]; } if ($this->rules->editEmail) { - $fields[] = [ - 'id' => 'change_email', + $fields['change_email'] = [ 'type' => 'link', 'value' => \ForkBB\__('To change email'), 'href' => $this->c->Router->link('EditUserEmail', ['id' => $this->curUser->id]), ]; } $fields['email_setting'] = [ - 'id' => 'email_setting', 'class' => 'block', 'type' => 'radio', 'value' => $this->curUser->email_setting, @@ -406,8 +387,7 @@ class Edit extends Profile 'href' => \ForkBB\cens($this->curUser->url), ]; } - $form['sets'][] = [ - 'id' => 'contacts', + $form['sets']['contacts'] = [ 'class' => 'data-edit', 'legend' => \ForkBB\__('Contact details'), 'fields' => $fields, @@ -417,14 +397,12 @@ class Edit extends Profile if ($this->rules->useSignature) { $fields = []; $fields['signature'] = [ - 'id' => 'signature', 'type' => 'textarea', 'value' => $this->curUser->signature, 'caption' => \ForkBB\__('Signature'), 'info' => \ForkBB\__('Sig max size', \ForkBB\num($this->c->config->p_sig_length), \ForkBB\num($this->c->config->p_sig_lines)), ]; - $form['sets'][] = [ - 'id' => 'signature', + $form['sets']['signature'] = [ 'class' => 'data-edit', 'legend' => \ForkBB\__('Signature'), 'fields' => $fields, diff --git a/app/Models/Pages/Profile/Email.php b/app/Models/Pages/Profile/Email.php index 5b557b00..ad96cde3 100644 --- a/app/Models/Pages/Profile/Email.php +++ b/app/Models/Pages/Profile/Email.php @@ -147,11 +147,10 @@ class Email extends Profile 'token' => $this->c->Csrf->create('EditUserEmail', ['id' => $this->curUser->id]), ], 'sets' => [ - [ + 'new-email' => [ 'class' => 'data-edit', 'fields' => [ 'new_email' => [ - 'id' => 'new_email', 'type' => 'text', 'maxlength' => 80, 'caption' => \ForkBB\__('New email'), @@ -161,7 +160,6 @@ class Email extends Profile 'info' => ! $this->user->isAdmin && '1' == $this->c->config->o_regs_verify ? \ForkBB\__('Email instructions') : null, ], 'password' => [ - 'id' => 'password', 'type' => 'password', 'caption' => \ForkBB\__('Your passphrase'), 'required' => true, diff --git a/app/Models/Pages/Profile/Pass.php b/app/Models/Pages/Profile/Pass.php index 73a15fcf..33d509d7 100644 --- a/app/Models/Pages/Profile/Pass.php +++ b/app/Models/Pages/Profile/Pass.php @@ -84,11 +84,10 @@ class Pass extends Profile 'token' => $this->c->Csrf->create('EditUserPass', ['id' => $this->curUser->id]), ], 'sets' => [ - [ + 'new-pass' => [ 'class' => 'data-edit', 'fields' => [ 'new_pass' => [ - 'id' => 'new_pass', 'type' => 'password', 'maxlength' => 25, 'caption' => \ForkBB\__('New pass'), @@ -97,7 +96,6 @@ class Pass extends Profile 'info' => \ForkBB\__('Pass format') . ' ' . \ForkBB\__('Pass info'), ], 'password' => [ - 'id' => 'password', 'type' => 'password', 'caption' => \ForkBB\__('Your passphrase'), 'required' => true, diff --git a/app/Models/Pages/Profile/View.php b/app/Models/Pages/Profile/View.php index c6071337..f941744e 100644 --- a/app/Models/Pages/Profile/View.php +++ b/app/Models/Pages/Profile/View.php @@ -47,14 +47,12 @@ class View extends Profile 'type' => 'wrap', ]; $fields['username'] = [ - 'id' => 'username', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Username'), 'value' => $this->curUser->username, ]; $fields['title'] = [ - 'id' => 'title', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Title'), @@ -65,14 +63,12 @@ class View extends Profile ]; if ($this->rules->useAvatar) { $fields['avatar'] = [ - 'id' => 'avatar', 'type' => 'yield', 'caption' => \ForkBB\__('Avatar'), 'value' => 'avatar', ]; } - $form['sets'][] = [ - 'id' => 'header', + $form['sets']['header'] = [ 'class' => 'header', # 'legend' => \ForkBB\__('Options'), 'fields' => $fields, @@ -80,13 +76,11 @@ class View extends Profile // примечание администрации if ($this->user->isAdmMod && '' != $this->curUser->admin_note) { - $form['sets'][] = [ - 'id' => 'note', + $form['sets']['note'] = [ 'class' => 'data', 'legend' => \ForkBB\__('Admin note'), 'fields' => [ 'admin_note' => [ - 'id' => 'admin_note', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Admin note'), @@ -100,7 +94,6 @@ class View extends Profile $fields = []; if ('' != $this->curUser->realname) { $fields['realname'] = [ - 'id' => 'realname', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Realname'), @@ -114,7 +107,6 @@ class View extends Profile ]; if ($this->curUser->gender && isset($genders[$this->curUser->gender])) { $fields['gender'] = [ - 'id' => 'gender', 'class' => 'pline', 'type' => 'str', 'value' => $genders[$this->curUser->gender], @@ -123,7 +115,6 @@ class View extends Profile } if ('' != $this->curUser->location) { $fields['location'] = [ - 'id' => 'location', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Location'), @@ -131,8 +122,7 @@ class View extends Profile ]; } if (! empty($fields)) { - $form['sets'][] = [ - 'id' => 'personal', + $form['sets']['personal'] = [ 'class' => 'data', 'legend' => \ForkBB\__('Personal information'), 'fields' => $fields, @@ -143,7 +133,6 @@ class View extends Profile $fields = []; if ($this->rules->viewOEmail) { $fields['open-email'] = [ - 'id' => 'open-email', 'class' => 'pline', 'type' => 2 === $this->curUser->email_setting ? 'str' : 'link', 'caption' => \ForkBB\__('Email info'), @@ -154,7 +143,6 @@ class View extends Profile if ($this->rules->viewEmail) { if (0 === $this->curUser->email_setting) { $fields['email'] = [ - 'id' => 'email', 'class' => 'pline', 'type' => 'link', 'caption' => \ForkBB\__('Email info'), @@ -163,7 +151,6 @@ class View extends Profile ]; } elseif (1 === $this->curUser->email_setting) { $fields['email'] = [ - 'id' => 'email', 'class' => 'pline', 'type' => 'link', 'caption' => \ForkBB\__('Email info'), @@ -183,8 +170,7 @@ class View extends Profile ]; } if (! empty($fields)) { - $form['sets'][] = [ - 'id' => 'contacts', + $form['sets']['contacts'] = [ 'class' => 'data', 'legend' => \ForkBB\__('Contact details'), 'fields' => $fields, @@ -196,15 +182,13 @@ class View extends Profile $fields = []; if ('' != $this->curUser->signature) { $fields['signature'] = [ - 'id' => 'signature', 'type' => 'yield', 'caption' => \ForkBB\__('Signature'), 'value' => 'signature', ]; } if (! empty($fields)) { - $form['sets'][] = [ - 'id' => 'signature', + $form['sets']['signature'] = [ 'class' => 'data', 'legend' => \ForkBB\__('Signature'), 'fields' => $fields, @@ -215,7 +199,6 @@ class View extends Profile // активность $fields = []; $fields['registered'] = [ - 'id' => 'registered', 'class' => 'pline', 'type' => 'str', 'value' => \ForkBB\dt($this->curUser->registered, true), @@ -223,7 +206,6 @@ class View extends Profile ]; if ($this->rules->viewLastVisit) { $fields['lastvisit'] = [ - 'id' => 'lastvisit', 'class' => 'pline', 'type' => 'str', 'value' => \ForkBB\dt($this->curUser->last_visit, true), @@ -231,7 +213,6 @@ class View extends Profile ]; } $fields['lastpost'] = [ - 'id' => 'lastpost', 'class' => 'pline', 'type' => 'str', 'value' => \ForkBB\dt($this->curUser->last_post, true), @@ -240,7 +221,6 @@ class View extends Profile if ($this->curUser->num_posts) { if ('1' == $this->user->g_search) { $fields['posts'] = [ - 'id' => 'posts', 'class' => 'pline', 'type' => 'link', 'caption' => \ForkBB\__('Posts info'), @@ -249,7 +229,6 @@ class View extends Profile 'title' => \ForkBB\__('Show posts'), ]; $fields['topics'] = [ - 'id' => 'topics', 'class' => 'pline', 'type' => 'link', 'caption' => \ForkBB\__('Topics info'), @@ -259,14 +238,12 @@ class View extends Profile ]; } elseif ($this->user->showPostCount) { $fields['posts'] = [ - 'id' => 'posts', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Posts info'), 'value' => \ForkBB\num($this->curUser->num_posts), ]; $fields['topics'] = [ - 'id' => 'topics', 'class' => 'pline', 'type' => 'str', 'caption' => \ForkBB\__('Topics info'), @@ -276,7 +253,6 @@ class View extends Profile } if ($this->rules->viewIP) { $fields['ip'] = [ - 'id' => 'ip', 'class' => 'pline', 'type' => 'link', 'caption' => \ForkBB\__('IP'), @@ -285,8 +261,7 @@ class View extends Profile 'title' => \ForkBB\__('IP title'), ]; } - $form['sets'][] = [ - 'id' => 'activity', + $form['sets']['activity'] = [ 'class' => 'data', 'legend' => \ForkBB\__('User activity'), 'fields' => $fields, diff --git a/app/Models/Pages/Search.php b/app/Models/Pages/Search.php index 2f26b145..edbf24a0 100644 --- a/app/Models/Pages/Search.php +++ b/app/Models/Pages/Search.php @@ -143,7 +143,7 @@ class Search extends Page ]; if ($advanced) { - $form['sets'][] = [ + $form['sets']['what'] = [ 'fields' => [ [ 'type' => 'info', @@ -173,7 +173,7 @@ class Search extends Page ], ], ]; - $form['sets'][] = [ + $form['sets']['where'] = [ 'legend' => \ForkBB\__('Search in legend'), 'fields' => [ 'forums' => [ @@ -206,7 +206,7 @@ class Search extends Page ], ]; - $form['sets'][] = [ + $form['sets']['how'] = [ 'legend' => \ForkBB\__('Search results legend'), 'fields' => [ 'sort_by' => [ @@ -249,7 +249,7 @@ class Search extends Page ]; } else { - $form['sets'][] = [ + $form['sets']['what'] = [ 'fields' => [ [ 'type' => 'info', diff --git a/app/Models/Pages/Userlist.php b/app/Models/Pages/Userlist.php index d2ea75d8..9f527a9d 100644 --- a/app/Models/Pages/Userlist.php +++ b/app/Models/Pages/Userlist.php @@ -172,7 +172,7 @@ class Userlist extends Page ], 'caption' => \ForkBB\__('User sort order'), ]; - $form['sets'][] = ['fields' => $fields]; + $form['sets']['users'] = ['fields' => $fields]; $this->fIndex = 'userlist'; $this->nameTpl = 'userlist'; diff --git a/app/templates/layouts/form.forkbb.php b/app/templates/layouts/form.forkbb.php index 7f1d7ac6..d5697cf3 100644 --- a/app/templates/layouts/form.forkbb.php +++ b/app/templates/layouts/form.forkbb.php @@ -6,26 +6,26 @@ @endforeach @endif @endif -@foreach ($form['sets'] as $set) - @if ($set['info']) - @foreach ($set['info'] as $key => $cur) +@foreach ($form['sets'] as $setKey => $setVal) + @if ($setVal['info']) + @foreach ($setVal['info'] as $key => $cur)

@if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif

@endforeach - @elseif ($set['fields']) -
- @if ($set['legend']) - {!! $set['legend'] !!} + @elseif ($setVal['fields']) +
+ @if ($setVal['legend']) + {!! $setVal['legend'] !!} @endif - @foreach ($set['fields'] as $key => $cur) + @foreach ($setVal['fields'] as $key => $cur) @if ('info' === $cur['type']) -

@if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif

+

@if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif

@elseif ('wrap' === $cur['type']) -
+
@elseif ('endwrap' === $cur['type'])
@else -
-
@if ($cur['caption']) @endif
+
+
@if ($cur['caption']) @endif
@if ('text' === $cur['type']) @@ -40,10 +40,10 @@ @endif @elseif ('select' === $cur['type']) @elseif ('multiselect' === $cur['type'])