Visman 7 роки тому
батько
коміт
6f603fd923

+ 4 - 4
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'  => '', //????

+ 3 - 3
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,
         ];

+ 8 - 8
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,

+ 30 - 26
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'  => '', //????

+ 4 - 4
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'  => '', //????

+ 10 - 10
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' => [

+ 2 - 2
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' => [

+ 7 - 7
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',

+ 7 - 7
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',

+ 2 - 2
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,
             ];

+ 1 - 1
app/Models/Pages/Profile.php

@@ -55,7 +55,7 @@ abstract class Profile extends Page
     }
 
     /**
-     * Возвращает хлеьные крошки
+     * Возвращает хлебные крошки
      *
      * @param mixed ...$args
      *

+ 3 - 19
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,

+ 7 - 29
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,

+ 1 - 3
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,

+ 1 - 3
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,

+ 6 - 31
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,

+ 4 - 4
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',

+ 1 - 1
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';

+ 19 - 19
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)
           <p class="f-finfo"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
         @endforeach
-    @elseif ($set['fields'])
-          <fieldset @if ($set['id']) id="id-fs-{{ $set['id'] }}" @endif @if ($set['class']) class="f-fs-{!! implode(' f-fs-', (array) $set['class']) !!}" @endif>
-        @if ($set['legend'])
-            <legend>{!! $set['legend'] !!}</legend>
+    @elseif ($setVal['fields'])
+          <fieldset id="id-fs-{{ $setKey }}" @if ($setVal['class']) class="f-fs-{!! implode(' f-fs-', (array) $setVal['class']) !!}" @endif>
+        @if ($setVal['legend'])
+            <legend>{!! $setVal['legend'] !!}</legend>
         @endif
-        @foreach ($set['fields'] as $key => $cur)
+        @foreach ($setVal['fields'] as $key => $cur)
             @if ('info' === $cur['type'])
-            <p class="f-child6"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
+            <p id="id-{{ $cur['id'] or $key }}" class="f-child6"> @if ($cur['html']){!! $cur['value'] !!} @else{{ $cur['value'] }} @endif</p>
             @elseif ('wrap' === $cur['type'])
-            <div @if ($cur['id']) id="id-{{ $cur['id'] }}" @endif @if ($cur['class']) class="f-wrap-{!! implode(' f-wrap-', (array) $cur['class']) !!}" @endif>
+            <div id="id-{{ $cur['id'] or $key }}" @if ($cur['class']) class="f-wrap-{!! implode(' f-wrap-', (array) $cur['class']) !!}" @endif>
             @elseif ('endwrap' === $cur['type'])
             </div>
             @else
-            <dl @if ($cur['id']) id="id-dl-{{ $cur['id'] }}" @endif @if ($cur['class']) class="f-field-{!! implode(' f-field-', (array) $cur['class']) !!}" @endif>
-              <dt> @if ($cur['caption'])<label class="f-child1 @if ($cur['required']) f-req @endif" @if (is_string($key) && 'radio' !== $cur['type'] && 'yield' !== $cur['type']) for="id-{{ $key }}" @endif>{!! $cur['caption'] !!}</label> @endif</dt>
+            <dl id="id-dl-{{ $cur['id'] or $key }}" @if ($cur['class']) class="f-field-{!! implode(' f-field-', (array) $cur['class']) !!}" @endif>
+              <dt> @if ($cur['caption'])<label class="f-child1 @if ($cur['required']) f-req @endif" @if (false === \strpos('.radio.yield.str.btn.', ".{$cur['type']}.")) for="id-{{ $key }}" @endif>{!! $cur['caption'] !!}</label> @endif</dt>
               <dd>
                 @if ('text' === $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="text" @if ($cur['maxlength']) maxlength="{{ $cur['maxlength'] }}" @endif @if ($cur['pattern']) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
@@ -40,10 +40,10 @@
                     @endif
                 @elseif ('select' === $cur['type'])
                 <select @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">
-                    @if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
+                    @if (null === ($count = null) && \is_array(reset($cur['options'])) && 1 === \count(reset($cur['options'])) && $count = 0) @endif
                     @foreach ($cur['options'] as $v => $option)
-                        @if (is_array($option))
-                            @if (null !== $count && 1 === count($option))
+                        @if (\is_array($option))
+                            @if (null !== $count && 1 === \count($option))
                                 @if (++$count > 1)
                 </optgroup>
                                 @endif
@@ -61,19 +61,19 @@
                 </select>
                 @elseif ('multiselect' === $cur['type'])
                 <select @if ($cur['required']) required @endif @if ($cur['disabled']) disabled @endif @if ($cur['autofocus']) autofocus @endif @if ($cur['size']) size="{{ $cur['size'] }}" @endif multiple class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}[]">
-                    @if (null === ($count = null) && is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
+                    @if (null === ($count = null) && \is_array(reset($cur['options'])) && 1 === count(reset($cur['options'])) && $count = 0) @endif
                     @foreach ($cur['options'] as $v => $option)
-                        @if (is_array($option))
+                        @if (\is_array($option))
                             @if (null !== $count && 1 === count($option))
                                 @if (++$count > 1)
                 </optgroup>
                                 @endif
                 <optgroup label="{{ $option[0] }}">
                             @else
-                  <option value="{{ $option[0] }}" @if ((is_array($cur['value']) && in_array($option[0], $cur['value'])) || $option[0] == $cur['value']) selected @endif @if ($option[2]) disabled @endif>{{ $option[1] }}</option>
+                  <option value="{{ $option[0] }}" @if ((\is_array($cur['value']) && in_array($option[0], $cur['value'])) || $option[0] == $cur['value']) selected @endif @if ($option[2]) disabled @endif>{{ $option[1] }}</option>
                             @endif
                         @else
-                  <option value="{{ $v }}" @if ((is_array($cur['value']) && in_array($v, $cur['value'])) || $v == $cur['value']) selected @endif>{{ $option }}</option>
+                  <option value="{{ $v }}" @if ((\is_array($cur['value']) && in_array($v, $cur['value'])) || $v == $cur['value']) selected @endif>{{ $option }}</option>
                         @endif
                     @endforeach
                     @if (null !== $count)