Browse Source

2018-01-04

Visman 7 years ago
parent
commit
a704db61ad

+ 1 - 1
app/Models/Config/Save.php

@@ -30,7 +30,7 @@ class Save extends Method
             $count = $this->c->DB->exec('UPDATE ::config SET conf_value=?s:value WHERE conf_name=?s:name', $vars);
             //????
             //????
-            if ($count === 0) {
+            if (0 === $count) {
                 //????
                 //????
                 $this->c->DB->exec('INSERT INTO ::config (conf_name, conf_value) SELECT ?s:name, ?s:value FROM ::groups WHERE NOT EXISTS (SELECT 1 FROM ::config WHERE conf_name=?s:name) LIMIT 1', $vars);

+ 8 - 5
app/Models/Forum/Manager.php

@@ -4,6 +4,7 @@ namespace ForkBB\Models\Forum;
 
 use ForkBB\Models\ManagerModel;
 use ForkBB\Models\Forum\Model as Forum;
+use ForkBB\Models\Group\Model as Group;
 use RuntimeException;
 
 class Manager extends ManagerModel
@@ -29,24 +30,26 @@ class Manager extends ManagerModel
     /**
      * Инициализация списка разделов
      * 
-     * @param int $gid
+     * @param Group $group
      *
      * @return Manager
      */
-    public function init($gid = 0)
+    public function init(Group $group = null)
     {
-        if (empty($gid)) {
+        if (null === $group) {
             $gid = $this->c->user->group_id;
+        } else {
+            $gid = $group->g_id;
         }
 
         $mark = $this->c->Cache->get('forums_mark');
         if (empty($mark)) {
             $this->c->Cache->set('forums_mark', time());
-            $list = $this->refresh($gid);
+            $list = $this->refresh($group);
         } else {
             $result = $this->c->Cache->get('forums_' . $gid);
             if (empty($result['time']) || $result['time'] < $mark) {
-                $list = $this->refresh($gid);
+                $list = $this->refresh($group);
             } else {
                 $list = $result['list'];
             }

+ 13 - 12
app/Models/Forum/Refresh.php

@@ -3,6 +3,7 @@
 namespace ForkBB\Models\Forum;
 
 use ForkBB\Models\Action;
+use ForkBB\Models\Group\Model as Group;
 
 class Refresh extends Action
 {
@@ -15,25 +16,25 @@ class Refresh extends Action
      * Возвращает список доступных разделов для группы
      * Обновляет кеш
      *
-     * @param int $gid
+     * @param Group $group
      * 
      * @return array
      */
-    public function refresh($gid)
+    public function refresh(Group $group = null)
     {
-        $vars = [
-            ':gid' => $gid,
-        ];
-        
-        if ($this->c->user->group_id === $gid) {
+        if (null === $group) {
+            $gid  = $this->c->user->group_id;
             $read = $this->c->user->g_read_board;
         } else {
-            $sql = 'SELECT g_read_board FROM ::groups WHERE g_id=?i:gid';
-            $read = $this->c->DB->query($sql, $vars)->fetchColumn();
+            $gid  = $group->g_id;
+            $read = $group->g_read_board;
         }
 
-        if ($read == '1') {
+        if ('1' == $read) {
             $list = [];
+            $vars = [
+                ':gid' => $gid,
+            ];
             $sql  = 'SELECT f.cat_id, c.cat_name, f.id, f.forum_name, f.redirect_url, f.parent_forum_id,
                             f.moderators, f.no_sum_mess, f.disp_position, fp.post_topics, fp.post_replies
                      FROM ::categories AS c
@@ -91,7 +92,7 @@ class Refresh extends Action
             $sub[] = $id;
             $all   = array_merge($this->createList($list, $id), $all);
         }
-        if ($parent === 0) {
+        if (0 === $parent) {
             if (empty($sub)) {
                 return [];
             }
@@ -103,7 +104,7 @@ class Refresh extends Action
         $list[$parent]['descendants'] = $all ?: null;
         
         $this->list[$parent] = array_filter($list[$parent], function($val) {
-            return $val !== null;
+            return null !== $val;
         });
         return $all;
     }

+ 120 - 0
app/Models/Group/Perm.php

@@ -0,0 +1,120 @@
+<?php
+
+namespace ForkBB\Models\Group;
+
+use ForkBB\Models\Action;
+use ForkBB\Models\Forum\Model as Forum;
+use ForkBB\Models\Group\Model as Group;
+use RuntimeException;
+
+class Perm extends Action
+{
+    /**
+     * @var array
+     */
+    protected $fields;
+
+    /**
+     * Получение таблицы разрешений для раздела
+     *
+     * @param Forum $forum
+     * 
+     * @throws RuntimeException
+     * 
+     * @return array
+     */
+    public function get(Forum $forum)
+    {
+        if ($forum->id < 1) {
+            throw new RuntimeException('The forum does not have ID');
+        }
+
+        $vars = [
+            ':fid' => $forum->id,
+            ':adm' => $this->c->GROUP_ADMIN,
+        ];
+        $sql = 'SELECT g.g_id, fp.read_forum, fp.post_replies, fp.post_topics 
+                FROM ::groups AS g 
+                LEFT JOIN ::forum_perms AS fp ON (g.g_id=fp.group_id AND fp.forum_id=?i:fid) 
+                WHERE g.g_id!=?i:adm
+                ORDER BY g.g_id';
+        $perms = $this->c->DB->query($sql, $vars)->fetchAll(\PDO::FETCH_UNIQUE);
+
+        $result = [];
+        foreach ($perms as $gid => $perm) {
+            $group  = $this->c->groups->get($gid);
+#           $forums = $this->c->ForumManager->init($group);
+#           $group->g_read_forum = (int) ($forums->get($forum->id) instanceof Forum);
+            $group->g_read_forum = $group->g_read_board;
+
+            foreach ($perm as $field => $value) {
+                $group->{'fp_' . $field}  = $value;
+                $group->{'set_' . $field} = (1 === $group->{'g_' . $field} && 0 !== $value) || 1 === $value;
+                $group->{'def_' . $field} = 1 === $group->{'g_' . $field};
+                $group->{'dis_' . $field} = 0 === $group->g_read_board || ('read_forum' !== $field && $forum->redirect_url);
+            }
+
+            $result[$gid] = $group;
+        }
+        $this->fileds = array_keys($perm);
+
+        return $result;
+    }
+
+    /**
+     * Обновление разрешений для раздела
+     *
+     * @param Forum $forum
+     * @param array $perms
+     * 
+     * @throws RuntimeException
+     */
+    public function update(Forum $forum, array $perms)
+    {
+        if ($forum->id < 1) {
+            throw new RuntimeException('The forum does not have ID');
+        }
+
+        foreach ($this->get($forum) as $id => $group) {
+            if (0 === $group->g_read_board) {
+                continue;
+            }
+
+            $row     = [];
+            $modDef  = false;
+            $modPerm = false; 
+            foreach ($this->fileds as $field) {
+                if ($group->{'dis_' . $field}) {
+                    $row[$field] = $group->{'set_' . $field} ? 1 : 0;
+                    $modDef      = $row[$field] !== $group->{'g_' . $field} ? true : $modDef;
+                } else {
+                    $row[$field] = empty($perms[$id][$field]) ? 0 : 1;
+                    $modDef      = $row[$field] !== $group->{'g_' . $field} ? true : $modDef;
+                    $modPerm     = $row[$field] !== (int) $group->{'set_' . $field} ? true : $modPerm;
+                }
+            }
+            
+            if ($modDef || $modPerm) {
+                $vars = [
+                    ':gid' => $id,
+                    ':fid' => $forum->id,
+                ];
+                $sql = 'DELETE FROM ::forum_perms 
+                        WHERE group_id=?i:gid AND forum_id=?i:fid';
+                $this->c->DB->exec($sql, $vars);
+            }
+            
+            if ($modDef) {
+                $vars   = array_values($row);
+                $vars[] = $id;
+                $vars[] = $forum->id;
+                $list   = array_keys($row);
+                $list[] = 'group_id';
+                $list[] = 'forum_id';
+                $list2  = array_fill(0, count($list), '?i');
+                $sql = 'INSERT INTO ::forum_perms (' . implode(', ', $list) . ') VALUES (' . implode(', ', $list2) . ')';
+                $this->c->DB->exec($sql, $vars);
+            }
+        }
+    }
+}

+ 4 - 4
app/Models/Pages/Admin/Categories.php

@@ -70,7 +70,7 @@ class Categories extends Admin
         $fieldset = [];
         foreach ($this->c->categories->getList() as $key => $row) {
             $fieldset["form[{$key}][cat_name]"] = [
-                'dl'        => 'name',
+                'dl'        => ['name', 'inline'],
                 'type'      => 'text',
                 'maxlength' => 80,
                 'value'     => $row['cat_name'],
@@ -78,7 +78,7 @@ class Categories extends Admin
                 'required'  => true,
             ];
             $fieldset["form[{$key}][disp_position]"] = [
-                'dl'    => 'position',
+                'dl'    => ['position', 'inline'],
                 'type'  => 'number',
                 'min'   => 0,
                 'max'   => 9999999999,
@@ -86,7 +86,7 @@ class Categories extends Admin
                 'title' => \ForkBB\__('Category position label'),
             ];
             $fieldset[] = [
-                'dl'    => 'delete',
+                'dl'    => ['delete', 'inline'],
                 'type'  => 'btn',
                 'value' => '❌',
                 'title' => \ForkBB\__('Delete'),
@@ -109,7 +109,7 @@ class Categories extends Admin
         $this->aIndex    = 'categories';
         $this->titles    = \ForkBB\__('Categories');
         $this->form      = $form;
-        $this->classForm = ['editcategories', 'inline'];
+        $this->classForm = 'editcategories';
         $this->titleForm = \ForkBB\__('Categories');
 
         return $this;

+ 64 - 13
app/Models/Pages/Admin/Forums.php

@@ -30,7 +30,7 @@ class Forums extends Admin
     }
 
     /**
-     * Получение списка опций для выбора родителя
+     * Составление списка категорий/разделов для выбора родителя
      * 
      * @param Forum $forum
      */
@@ -39,7 +39,7 @@ class Forums extends Admin
         $cid        = null;
         $categories = $this->c->categories->getList();
         $options    = [
-            [0, \ForkBB\__('Not selected')],
+            ['', \ForkBB\__('Not selected')],
         ];
         $idxs       = [];
         foreach ($this->forumsList($this->c->forums->get(0), 0) as $f) {
@@ -146,14 +146,14 @@ class Forums extends Admin
             }
 
             $fieldset[] = [
-                'dl'        => ['name', 'depth' . $forum->depth],
+                'dl'        => ['name', 'inline', 'depth' . $forum->depth],
                 'type'      => 'btn',
                 'value'     => $forum->forum_name,
                 'title'     => \ForkBB\__('Forum label'),
                 'link'      => $this->c->Router->link('AdminForumsEdit', ['id' => $forum->id]),
             ];
             $fieldset["form[{$forum->id}][disp_position]"] = [
-                'dl'    => 'position',
+                'dl'    => ['position', 'inline'],
                 'type'  => 'number',
                 'min'   => 0,
                 'max'   => 9999999999,
@@ -161,7 +161,7 @@ class Forums extends Admin
                 'title' => \ForkBB\__('Position label'),
             ];
             $fieldset[] = [
-                'dl'    => 'delete',
+                'dl'    => ['delete', 'inline'],
                 'type'  => 'btn',
                 'value' => '❌',
                 'title' => \ForkBB\__('Delete'),
@@ -312,12 +312,15 @@ class Forums extends Admin
 
         if ('POST' === $method) {
             $v = $this->c->Validator->setRules([
-                'token'        => 'token:' . $marker,
-                'forum_name'   => 'required|string:trim|max:80',
-                'forum_desc'   => 'string:trim|max:65000 bytes',
-                'parent'       => 'required|integer|in:' . implode(',', $this->listOfIndexes),
-                'sort_by'      => 'required|integer|in:0,1,2',
-                'redirect_url' => 'string:trim|max:100',
+                'token'                => 'token:' . $marker,
+                'forum_name'           => 'required|string:trim|max:80',
+                'forum_desc'           => 'string:trim|max:65000 bytes',
+                'parent'               => 'required|integer|in:' . implode(',', $this->listOfIndexes),
+                'sort_by'              => 'required|integer|in:0,1,2',
+                'redirect_url'         => 'string:trim|max:100',
+                'perms.*.read_forum'   => 'checkbox',
+                'perms.*.post_replies' => 'checkbox',
+                'perms.*.post_topics'  => 'checkbox',
             ])->setArguments([
                 'token' => $args,
             ]);
@@ -347,7 +350,7 @@ class Forums extends Admin
                     $this->c->forums->update($forum);
                 }
 
-                //???? права
+                $this->c->groups->Perm->update($forum, $v->perms);
 
                 $this->c->DB->commit();
 
@@ -430,11 +433,59 @@ class Forums extends Admin
                     'value'     => $forum->redirect_url,
                     'title'     => \ForkBB\__('Redirect label'),
                     'info'      => \ForkBB\__('Redirect help'),
-                    'disabled'  => $forum->num_topics ? true : null,
+                    'disabled'  => $forum->num_topics || $forum->subforums ? true : null,
                 ],
             ],
         ];
 
+        $form['sets'][] = [
+            'info' => [
+                'info1' => [
+                    'type'  => '', //????
+                    'value' => \ForkBB\__('Group permissions info', $this->c->Router->link('AdminGroups'), \ForkBB\__('User groups')),
+                    'html'  => true,
+                ],
+            ],
+        ];
+
+        $aOn  = ['cando', 'inline', 'on'];
+        $aOff = ['cando', 'inline', 'off'];
+        foreach ($this->c->groups->Perm->get($forum) as $id => $group) {
+            $fieldset = [];
+            $fieldset["perms[{$id}][read_forum]"] = [
+                'dl'       => $group->def_read_forum ? $aOn : $aOff,
+                'type'     => 'checkbox',
+                'value'    => '1',
+                'title'    => \ForkBB\__('Read forum label'),
+                'label'    => \ForkBB\__('<span></span>'),
+                'checked'  => $group->set_read_forum,
+                'disabled' => $group->dis_read_forum,
+            ];
+            $fieldset["perms[{$id}][post_replies]"] = [
+                'dl'       => $group->def_post_replies ? $aOn : $aOff,
+                'type'     => 'checkbox',
+                'value'    => '1',
+                'title'    => \ForkBB\__('Post replies label'),
+                'label'    => \ForkBB\__('<span></span>'),
+                'checked'  => $group->set_post_replies,
+                'disabled' => $group->dis_post_replies,
+            ];
+            $fieldset["perms[{$id}][post_topics]"] = [
+                'dl'       => $group->def_post_topics ? $aOn : $aOff,
+                'type'     => 'checkbox',
+                'value'    => '1',
+                'title'    => \ForkBB\__('Post topics label'),
+                'label'    => \ForkBB\__('<span></span>'),
+                'checked'  => $group->set_post_topics,
+                'disabled' => $group->dis_post_topics,
+            ];
+
+            $form['sets'][] = [
+                'legend' => \ForkBB\e($group->g_title),
+                'fields' => $fieldset,
+            ];
+        }
+
         return $form;
     }
 }

+ 6 - 3
app/lang/English/admin_forums.po

@@ -120,11 +120,14 @@ msgstr "Redirect URL"
 msgid "Redirect help"
 msgstr "Only available in empty forums."
 
-msgid "Group permissions subhead"
-msgstr "Edit group permissions for this forum"
+msgid "Access rights for groups"
+msgstr "Access rights for groups"
 
 msgid "Group permissions info"
-msgstr "In this form, you can set the forum specific permissions for the different user groups. If you haven\'t made any changes to this forum\'s group permissions, what you see below is the default based on settings in %s. Administrators always have full permissions and are thus excluded. Permission settings that differ from the default permissions for the user group are marked red. The "Read forum" permission checkbox will be disabled if the group in question lacks the "Read board" permission. For redirect forums, only the "Read forum" permission is editable."
+msgstr "In this form, you can set the forum specific permissions for the different user groups. If you haven't made any changes to this forum's group permissions, what you see below is the default based on settings in <a href=\"%1$s\">%2$s</a>. Administrators always have full permissions and are thus excluded. Permission settings that differ from the default permissions for the user group are marked red. The \"Read forum\" permission checkbox will be disabled if the group in question lacks the \"Read board\" permission. For redirect forums, only the \"Read forum\" permission is editable."
+
+msgid "Group label"
+msgstr "Group"
 
 msgid "Read forum label"
 msgstr "Read forum"

+ 7 - 4
app/lang/Russian/admin_forums.po

@@ -120,11 +120,14 @@ msgstr "URL переадресации"
 msgid "Redirect help"
 msgstr "Доступно только для пустых разделов."
 
-msgid "Group permissions subhead"
-msgstr "Изменения прав доступа к разделу"
+msgid "Access rights for groups"
+msgstr "Права доступа для групп"
 
 msgid "Group permissions info"
-msgstr "Вы можете установить для этого раздела особые привилегии для различных групп пользователей. Если вы не вносили никаких изменений, то то, что вы видите внизу — права по умолчанию, установленные в "%s". Админы всегда имеют полные права, которые нельзя отнять. Права, отличающиеся от прав по умолчанию выделены красным. Галочка "Читать" будет недоступна, если у данной группы нет права "Чтение разделов". Для переадресованных разделов доступно для редактирования только право "Читать"."
+msgstr "Вы можете установить для этого раздела особые привилегии для различных групп пользователей. Если вы не вносили никаких изменений, то то, что вы видите внизу — права по умолчанию, установленные в <a href=\"%1$s\">%2$s</a>. Администраторы всегда имеют полные права, которые нельзя отнять. Права, отличающиеся от прав по умолчанию выделены красным. Галочка \"Читать раздел\" будет недоступна, если у данной группы нет права \"Читать разделы\". Для переадресованных разделов доступно для редактирования только право \"Читать раздел\"."
+
+msgid "Group label"
+msgstr "Группа"
 
 msgid "Read forum label"
 msgstr "Читать раздел"
@@ -142,7 +145,7 @@ msgid "Parent label"
 msgstr "Родитель"
 
 msgid "Parent help"
-msgstr "Категория или раздел для расположения данного раздела."
+msgstr "Категория или раздел для размещения данного раздела."
 
 msgid "Not selected"
 msgstr "Не выбран"

+ 7 - 7
app/templates/layouts/form.tpl

@@ -23,9 +23,9 @@
               <dt> @if (isset($cur['title']))<label class="f-child1 @if (isset($cur['required'])) f-req @endif" @if (is_string($key)) for="id-{{ $key }}" @endif>{!! $cur['title'] !!}</label> @endif</dt>
               <dd>
       @if ('text' === $cur['type'])
-                <input @if (isset($cur['required'])) required @endif @if (isset($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="text" @if (! empty($cur['maxlength'])) maxlength="{{ $cur['maxlength'] }}" @endif @if (isset($cur['pattern'])) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
+                <input @if (isset($cur['required'])) required @endif @if (! empty($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="text" @if (! empty($cur['maxlength'])) maxlength="{{ $cur['maxlength'] }}" @endif @if (isset($cur['pattern'])) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
       @elseif ('textarea' === $cur['type'])
-                <textarea @if (isset($cur['required'])) required @endif @if (isset($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">{{ $cur['value'] or '' }}</textarea>
+                <textarea @if (isset($cur['required'])) required @endif @if (! empty($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">{{ $cur['value'] or '' }}</textarea>
         @if (isset($cur['bb']))
                 <ul class="f-child5">
           @foreach ($cur['bb'] as $val)
@@ -34,7 +34,7 @@
                 </ul>
         @endif
       @elseif ('select' === $cur['type'])
-                <select @if (isset($cur['required'])) required @endif @if (isset($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">
+                <select @if (isset($cur['required'])) required @endif @if (! empty($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}">
         @foreach ($cur['options'] as $v => $option)
           @if (is_array($option))
                   <option value="{{ $option[0] }}" @if ($option[0] == $cur['value']) selected @endif @if (isset($option[2])) disabled @endif>{{ $option[1] }}</option>
@@ -44,15 +44,15 @@
         @endforeach
                 </select>
       @elseif ('number' === $cur['type'])
-                <input @if (isset($cur['required'])) required @endif @if (isset($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="number" min="{{ $cur['min'] }}" max="{{ $cur['max'] }}" @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
+                <input @if (isset($cur['required'])) required @endif @if (! empty($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="number" min="{{ $cur['min'] }}" max="{{ $cur['max'] }}" @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
       @elseif ('checkbox' === $cur['type'])
-                <label class="f-child2"><input @if (isset($cur['autofocus'])) autofocus @endif @if (isset($cur['disabled'])) disabled @endif type="checkbox" id="id-{{ $key }}" name="{{ $key }}" value="{{ $cur['value'] or '1' }}" @if (! empty($cur['checked'])) checked @endif>{!! $cur['label'] !!}</label>
+                <label class="f-child2"><input @if (isset($cur['autofocus'])) autofocus @endif @if (! empty($cur['disabled'])) disabled @endif type="checkbox" id="id-{{ $key }}" name="{{ $key }}" value="{{ $cur['value'] or '1' }}" @if (! empty($cur['checked'])) checked @endif>{!! $cur['label'] !!}</label>
       @elseif ('radio' === $cur['type'])
         @foreach ($cur['values'] as $v => $n)
-                <label class="f-label"><input @if (isset($cur['autofocus'])) autofocus @endif @if (isset($cur['disabled'])) disabled @endif type="radio" id="id-{{ $key }}-{{ $v }}" name="{{ $key }}" value="{{ $v }}" @if ($v == $cur['value']) checked @endif>{{ $n }}</label>
+                <label class="f-label"><input @if (isset($cur['autofocus'])) autofocus @endif @if (! empty($cur['disabled'])) disabled @endif type="radio" id="id-{{ $key }}-{{ $v }}" name="{{ $key }}" value="{{ $v }}" @if ($v == $cur['value']) checked @endif>{{ $n }}</label>
         @endforeach
       @elseif ('password' === $cur['type'])
-                <input @if (isset($cur['required'])) required @endif @if (isset($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="password" @if (! empty($cur['maxlength'])) maxlength="{{ $cur['maxlength'] }}" @endif @if (isset($cur['pattern'])) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
+                <input @if (isset($cur['required'])) required @endif @if (! empty($cur['disabled'])) disabled @endif @if (isset($cur['autofocus'])) autofocus @endif class="f-ctrl" id="id-{{ $key }}" name="{{ $key }}" type="password" @if (! empty($cur['maxlength'])) maxlength="{{ $cur['maxlength'] }}" @endif @if (isset($cur['pattern'])) pattern="{{ $cur['pattern'] }}" @endif @if (isset($cur['value'])) value="{{ $cur['value'] }}" @endif>
       @elseif ('btn' === $cur['type'])
                 <a class="f-btn" href="{!! $cur['link'] !!}">{{ $cur['value'] }}</a>
       @endif

+ 88 - 15
public/style/ForkBB/style.css

@@ -416,8 +416,7 @@ select {
   border: 0.0625rem solid #AA7939;
 }
 
-.f-fdiv h2,
-.f-fdiv fieldset {
+.f-fdiv h2 {
   padding: 0.625rem 0.625rem 0 0.625rem;
 }
 
@@ -429,6 +428,15 @@ select {
   padding: 0 0 0.625rem 0;
 }
 
+.f-fdiv fieldset {
+  padding: 0 0.625rem;
+}
+
+.f-fdiv fieldset > legend:first-child,
+.f-fdiv fieldset > dl:first-child:not(.f-field-inline) {
+  padding-top: 0.625rem;
+}
+
 .f-fdiv .f-ctrl,
 .f-fdiv .f-btn {
   line-height: 1.25rem;
@@ -518,6 +526,7 @@ select {
   padding: 0.625rem;
   color: #F8F4E3;
   margin-bottom: 0.625rem;
+  text-align: justify
 }
 
 .f-fdiv .f-finfo + .f-finfo {
@@ -529,7 +538,7 @@ select {
 }
 
 .f-fdiv .f-finfo + fieldset {
-  padding-top: 0;
+/*  padding-top: 0; */
 }
   
 .f-ctrl {
@@ -1568,54 +1577,54 @@ li + li .f-btn {
 /* Админка/Категории */
 /* Админка/Разделы   */
 /*********************/
-
-.f-inline-form dt {
+.f-field-inline > dt {
   display: none;
 }
 
-.f-inline-form dd {
+.f-field-inline > dd {
   padding-left: 0;
 }
 
-.f-inline-form .f-field-name {
+.f-field-inline.f-field-name {
   float: left;
   width: calc(100% - 8rem);
 }
 
-.f-inline-form .f-field-position {
+.f-field-inline.f-field-position {
   padding-left: 0.625rem;
   float: left;
   width: 5rem;
 }
 
-.f-inline-form .f-field-delete {
+.f-field-inline.f-field-delete {
   padding-left: 0.625rem;
   float: left;
   width: 3rem;
   overflow: hidden;
 }
 
-.f-inline-form .f-field-delete .f-btn {
+.f-field-inline .f-btn {
   margin: 0;
+}
+
+.f-field-delete .f-btn {
   text-align: center;
 }
 
-.f-inline-form .f-field-name .f-btn {
-  margin: 0;
+.f-field-name .f-btn {
   white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 }
 
-.f-inline-form fieldset dl:nth-child(-n+3) dt,
-.f-inline-form .f-field-new dt {
+.f-field-inline:nth-child(-n+3) > dt {
   display: block;
   width: 100%;
   overflow: hidden;
   float: none;
 }
 
-.f-inline-form .f-child1 {
+.f-field-inline .f-child1 {
   font-weight: normal;
 }
 
@@ -1626,3 +1635,67 @@ li + li .f-btn {
 .f-field-depth2 dd {
   padding-left: 1.25rem;
 }
+
+.f-editcategories-form .f-field-inline:nth-child(-n+3) {
+  padding-top: 0.625rem;
+}
+
+/*********************/
+/* Админка/Разделы   */
+/*********************/
+.f-field-inline.f-field-cando {
+  float: left;
+  width: 33.333%;
+  padding-left: 0.625rem;
+  margin-bottom: 0;
+  padding-bottom: 0;
+  text-align: center;
+  position: relative;
+}
+
+.f-field-inline.f-field-cando > dt {
+  display: block;
+  width: 100%;
+  overflow: hidden;
+  float: none;
+}
+
+.f-field-inline.f-field-cando > dt > label {
+  overflow: hidden;
+  white-space: nowrap;
+  text-overflow: ellipsis;
+}
+
+.f-editforum-form legend {
+  margin-bottom: 0;
+}
+
+.f-field-on input:not(:checked) + span {
+  opacity: 0.2;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: red;
+}
+
+.f-field-off input:checked + span {
+  opacity: 0.2;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: red;
+}
+
+.f-field-cando input:disabled + span {
+  opacity: 0.2;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  background: gray;
+}