2017-12-29

This commit is contained in:
Visman 2017-12-29 23:51:36 +07:00
parent 616c84ef0d
commit 6dfc6c9ec0
15 changed files with 880 additions and 40 deletions

View file

@ -105,6 +105,9 @@ class Routing
if ($user->isAdmin) {
$r->add('GET', '/admin/statistics/info', 'AdminStatistics:info', 'AdminInfo' );
$r->add(['GET', 'POST'], '/admin/options', 'AdminOptions:edit', 'AdminOptions' );
$r->add(['GET', 'POST'], '/admin/permissions', 'AdminPermissions:edit', 'AdminPermissions' );
$r->add(['GET', 'POST'], '/admin/categories', 'AdminCategories:view', 'AdminCategories' );
$r->add('GET', '/admin/forums', 'AdminForums:view', 'AdminForums' );
$r->add('GET', '/admin/groups', 'AdminGroups:view', 'AdminGroups' );
$r->add('POST', '/admin/groups/default', 'AdminGroups:defaultSet', 'AdminGroupsDefault');
$r->add('POST', '/admin/groups/new[/{base:[1-9]\d*}]', 'AdminGroups:edit', 'AdminGroupsNew' );

View file

@ -147,10 +147,16 @@ class Validator
$this->arguments = [];
$this->fields = [];
foreach ($list as $field => $raw) {
$suffix = null;
// правило для элементов массива
if (strpos($field, '.') > 0) {
list($field, $suffix) = explode('.', $field, 2);
}
$rules = [];
// псевдоним содержится в списке правил
if (is_array($raw)) {
list($raw, $this->aliases[$field]) = $raw; //????
$this->aliases[$field] = $raw[1]; //????????????????
$raw = $raw[0];
}
// перебор правил для текущего поля
foreach (explode('|', $raw) as $rule) {
@ -160,7 +166,11 @@ class Validator
}
$rules[$tmp[0]] = isset($tmp[1]) ? $tmp[1] : '';
}
$this->rules[$field] = $rules;
if (isset($suffix)) {
$this->rules[$field]['array'][$suffix] = $rules;
} else {
$this->rules[$field] = $rules;
}
$this->fields[$field] = $field;
}
return $this;
@ -227,7 +237,7 @@ class Validator
foreach ($this->fields as $field) {
$this->__get($field);
}
$this->raw = null;
$this->raw = null;
return empty($this->errors);
}
@ -271,6 +281,25 @@ class Validator
}
}
$value = $this->checkValue($value, $rules, $field);
$this->status[$field] = true !== $this->error; // в $this->error может быть состояние false
$this->result[$field] = $value;
return $value;
}
/**
* Проверка значения списком правил
*
* @param mixed $value
* @param array $rules
* @param string $field
*
* @return mixed
*/
protected function checkValue($value, array $rules, $field)
{
foreach ($rules as $validator => $attr) {
// данные для обработчика ошибок
$this->error = null;
@ -288,10 +317,6 @@ class Validator
break;
}
}
$this->status[$field] = true !== $this->error; // в $this->error может быть состояние false
$this->result[$field] = $value;
return $value;
}
@ -493,16 +518,59 @@ class Validator
}
}
protected function vArray($v, $value)
protected function vArray($v, $value, $attr)
{
if (null !== $value && ! is_array($value)) {
$this->addError('The :alias must be array');
return null;
} else {
} elseif (! $attr) {
return $value;
}
if (empty($vars = end($this->curData))) {
throw new RuntimeException('The array of variables is empty');
}
$result = [];
foreach ($attr as $name => $rules) {
$this->recArray($value, $result, $name, $rules, $vars['field'] . '.' . $name);
}
return $result;
}
protected function recArray(&$value, &$result, $name, $rules, $field)
{
$idxs = explode('.', $name);
$key = array_shift($idxs);
$name = implode('.', $idxs);
if ('*' === $key) {
if (! is_array($value)) {
return; //????
}
foreach ($value as $i => $cur) {
if ('' === $name) {
$result[$i] = $this->checkValue($cur, $rules, $field);
} else {
$this->recArray($value[$i], $result[$i], $name, $rules, $field);
}
}
} else {
if (! array_key_exists($key, $value)) {
return; //????
}
if ('' === $name) {
$result[$key] = $this->checkValue($value[$key], $rules, $field);
} else {
$this->recArray($value[$key], $result[$key], $name, $rules, $field);
}
}
}
protected function vMin($v, $value, $attr)
{
if (is_string($value)) {

View file

@ -0,0 +1,99 @@
<?php
namespace ForkBB\Models\Categories;
use ForkBB\Models\ManagerModel;
//use ForkBB\Models\Categories\Model as Categories;
use InvalidArgumentException;
use RuntimeException;
class Manager extends ManagerModel
{
/**
* Массив флагов измененных категорий
* @var array
*/
protected $modified = [];
/**
* Загрузка категорий из БД
*
* @return Manager
*/
public function init()
{
$sql = 'SELECT id, cat_name, disp_position
FROM ::categories
ORDER BY disp_position';
$this->repository = $this->c->DB->query($sql)->fetchAll(\PDO::FETCH_UNIQUE);
return $this;
}
public function getList()
{
return $this->repository;
}
public function set($key, $value)
{
if (! isset($value['cat_name']) || ! isset($value['disp_position'])) {
throw new InvalidArgumentException('Expected array with cat_name and disp_position elements');
}
$old = $this->get($key);
if (empty($old)) {
throw new RuntimeException("Category number {$key} is missing");
}
parent::set($key, $value);
if ($old != $value) {
$this->modified[$key] = true;
}
}
public function update()
{
foreach ($this->modified as $key => $value) {
$cat = $this->get($key);
$vars = [
':name' => $cat['cat_name'],
':position' => $cat['disp_position'],
':cid' => $key,
];
$sql = 'UPDATE ::categories
SET cat_name=?s:name, disp_position=?i:position
WHERE id=?i:cid';
$this->c->DB->query($sql, $vars); //????
}
$this->modified = [];
return $this;
}
public function insert($name)
{
$pos = 0;
foreach ($this->repository as $cat) {
if ($cat['disp_position'] > $pos) {
$pos = $cat['disp_position'];
}
}
++$pos;
$vars = [
':name' => $name,
':position' => $pos,
];
$sql = 'INSERT INTO ::categories (cat_name, disp_position)
VALUES (?s:name, ?i:position)';
$this->c->DB->query($sql, $vars);
$cid = $this->c->DB->lastInsertId();
parent::set($cid, ['cat_name' => $name, 'disp_position' => $pos]);
return $cid;
}
}

View file

@ -59,9 +59,9 @@ class Admin extends Page
if ($user->isAdmin) {
$nav['Admin menu'] = [
'options' => [$r->link('AdminOptions'), \ForkBB\__('Admin options')],
'permissions' => ['admin_permissions.php', \ForkBB\__('Permissions')],
'categories' => ['admin_categories.php', \ForkBB\__('Categories')],
'forums' => ['admin_forums.php', \ForkBB\__('Forums')],
'permissions' => [$r->link('AdminPermissions'), \ForkBB\__('Permissions')],
'categories' => [$r->link('AdminCategories'), \ForkBB\__('Categories')],
'forums' => [$r->link('AdminForums'), \ForkBB\__('Forums')],
'groups' => [$r->link('AdminGroups'), \ForkBB\__('User groups')],
'censoring' => ['admin_censoring.php', \ForkBB\__('Censoring')],
'maintenance' => ['admin_maintenance.php', \ForkBB\__('Maintenance')]

View file

@ -0,0 +1,110 @@
<?php
namespace ForkBB\Models\Pages\Admin;
use ForkBB\Core\Container;
use ForkBB\Models\Forum\Model as Forum;
use ForkBB\Models\Pages\Admin;
class Categories extends Admin
{
/**
* Подготавливает данные для шаблона
*
* @param array $args
* @param string $method
*
* @return Page
*/
public function view(array $args, $method)
{
$this->c->Lang->load('admin_categories');
if ('POST' === $method) {
$v = $this->c->Validator->setRules([
'token' => 'token:AdminCategories',
'form.*.cat_name' => 'required|string:trim|max:80',
'form.*.disp_position' => 'required|integer|min:0|max:9999999999',
'new' => 'string:trim|max:80'
])->setArguments([
])->setMessages([
]);
if ($v->validation($_POST)) {
$this->c->DB->beginTransaction();
foreach ($v->form as $key => $row) {
$this->c->categories->set($key, $row);
}
$this->c->categories->update();
if (strlen($v->new) > 0) {
$this->c->categories->insert($v->new); //????
}
$this->c->DB->commit();
$this->c->Cache->delete('forums_mark'); //????
return $this->c->Redirect->page('AdminCategories')->message(\ForkBB\__('Categories updated redirect'));
}
$this->fIswev = $v->getErrors();
}
$this->nameTpl = 'admin/categories';
$this->aIndex = 'categories';
$form = [
'action' => $this->c->Router->link('AdminCategories'),
'hidden' => [
'token' => $this->c->Csrf->create('AdminCategories'),
],
'sets' => [],
'btns' => [
'submit' => [
'type' => 'submit',
'value' => \ForkBB\__('Submit'),
'accesskey' => 's',
],
],
];
$fieldset = [];
foreach ($this->c->categories->getList() as $key => $row) {
$fieldset["form[{$key}][cat_name]"] = [
'dl' => 'name',
'type' => 'text',
'maxlength' => 80,
'value' => $row['cat_name'],
'title' => \ForkBB\__('Category name label'),
'required' => true,
];
$fieldset["form[{$key}][disp_position]"] = [
'dl' => 'position',
'type' => 'number',
'min' => 0,
'max' => 9999999999,
'value' => $row['disp_position'],
'title' => \ForkBB\__('Category position label'),
];
}
$fieldset['new'] = [
'dl' => 'new',
'type' => 'text',
'maxlength' => 80,
'title' => \ForkBB\__('Add category label'),
'info' => \ForkBB\__('Add category help', $this->c->Router->link('AdminForums'), \ForkBB\__('Forums')),
];
$form['sets'][] = [
'fields' => $fieldset,
];
$this->formUpdate = $form;
return $this;
}
}

View file

@ -93,7 +93,7 @@ class Groups extends Admin
'btns' => [
'submit' => [
'type' => 'submit',
'value' => \ForkBB\__('Save'),
'value' => \ForkBB\__('Update'),
'accesskey' => 's',
],
],
@ -312,7 +312,7 @@ class Groups extends Admin
'btns' => [
'submit' => [
'type' => 'submit',
'value' => \ForkBB\__('Save'),
'value' => null === $group->g_id ? \ForkBB\__('Add') : \ForkBB\__('Update'),
'accesskey' => 's',
],
],
@ -369,49 +369,48 @@ class Groups extends Admin
];
}
$y = \ForkBB\__('Yes');
$n = \ForkBB\__('No');
$yn = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
if (! $group->groupGuest && $group->g_id != $this->c->config->o_default_user_group) {
$fieldset['g_moderator'] = [
'type' => 'radio',
'value' => $group->g_moderator,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Mod privileges label'),
'info' => \ForkBB\__('Mod privileges help'),
];
$fieldset['g_mod_edit_users'] = [
'type' => 'radio',
'value' => $group->g_mod_edit_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Edit profile label'),
'info' => \ForkBB\__('Edit profile help'),
];
$fieldset['g_mod_rename_users'] = [
'type' => 'radio',
'value' => $group->g_mod_rename_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Rename users label'),
'info' => \ForkBB\__('Rename users help'),
];
$fieldset['g_mod_change_passwords'] = [
'type' => 'radio',
'value' => $group->g_mod_change_passwords,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Change passwords label'),
'info' => \ForkBB\__('Change passwords help'),
];
$fieldset['g_mod_promote_users'] = [
'type' => 'radio',
'value' => $group->g_mod_promote_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Mod promote users label'),
'info' => \ForkBB\__('Mod promote users help'),
];
$fieldset['g_mod_ban_users'] = [
'type' => 'radio',
'value' => $group->g_mod_ban_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Ban users label'),
'info' => \ForkBB\__('Ban users help'),
];
@ -420,28 +419,28 @@ class Groups extends Admin
$fieldset['g_read_board'] = [
'type' => 'radio',
'value' => $group->g_read_board,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Read board label'),
'info' => \ForkBB\__('Read board help'),
];
$fieldset['g_view_users'] = [
'type' => 'radio',
'value' => $group->g_view_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('View user info label'),
'info' => \ForkBB\__('View user info help'),
];
$fieldset['g_post_replies'] = [
'type' => 'radio',
'value' => $group->g_post_replies,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Post replies label'),
'info' => \ForkBB\__('Post replies help'),
];
$fieldset['g_post_topics'] = [
'type' => 'radio',
'value' => $group->g_post_topics,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Post topics label'),
'info' => \ForkBB\__('Post topics help'),
];
@ -450,21 +449,21 @@ class Groups extends Admin
$fieldset['g_edit_posts'] = [
'type' => 'radio',
'value' => $group->g_edit_posts,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Edit posts label'),
'info' => \ForkBB\__('Edit posts help'),
];
$fieldset['g_delete_posts'] = [
'type' => 'radio',
'value' => $group->g_delete_posts,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Delete posts label'),
'info' => \ForkBB\__('Delete posts help'),
];
$fieldset['g_delete_topics'] = [
'type' => 'radio',
'value' => $group->g_delete_topics,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Delete topics label'),
'info' => \ForkBB\__('Delete topics help'),
];
@ -479,7 +478,7 @@ class Groups extends Admin
$fieldset['g_set_title'] = [
'type' => 'radio',
'value' => $group->g_set_title,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Set own title label'),
'info' => \ForkBB\__('Set own title help'),
];
@ -488,21 +487,21 @@ class Groups extends Admin
$fieldset['g_post_links'] = [
'type' => 'radio',
'value' => $group->g_post_links,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Post links label'),
'info' => \ForkBB\__('Post links help'),
];
$fieldset['g_search'] = [
'type' => 'radio',
'value' => $group->g_search,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('User search label'),
'info' => \ForkBB\__('User search help'),
];
$fieldset['g_search_users'] = [
'type' => 'radio',
'value' => $group->g_search_users,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('User list search label'),
'info' => \ForkBB\__('User list search help'),
];
@ -511,7 +510,7 @@ class Groups extends Admin
$fieldset['g_send_email'] = [
'type' => 'radio',
'value' => $group->g_send_email,
'values' => [1 => $y, 0 => $n],
'values' => $yn,
'title' => \ForkBB\__('Send e-mails label'),
'info' => \ForkBB\__('Send e-mails help'),
];

View file

@ -4,6 +4,7 @@ namespace ForkBB\Models\Pages\Admin;
use ForkBB\Core\Validator;
use ForkBB\Models\Pages\Admin;
use ForkBB\Models\Config as Config;
class Options extends Admin
{
@ -141,9 +142,11 @@ class Options extends Admin
/**
* Формирует данные для формы
*
* @param Config $config
*
* @return array
*/
protected function viewForm($config)
protected function viewForm(Config $config)
{
$form = [
'action' => $this->c->Router->link('AdminOptions'),
@ -152,10 +155,10 @@ class Options extends Admin
],
'sets' => [],
'btns' => [
'submit' => [
'update' => [
'type' => 'submit',
'value' => \ForkBB\__('Save'),
'accesskey' => 's',
'value' => \ForkBB\__('Update'),
'accesskey' => 'u',
],
],
];

View file

@ -0,0 +1,183 @@
<?php
namespace ForkBB\Models\Pages\Admin;
use ForkBB\Core\Validator;
use ForkBB\Models\Pages\Admin;
use ForkBB\Models\Config as Config;
class Permissions extends Admin
{
/**
* Редактирование натроек форума
*
* @param array $args
* @param string $method
*
* @return Page
*/
public function edit(array $args, $method)
{
$this->c->Lang->load('admin_permissions');
$config = clone $this->c->config;
if ('POST' === $method) {
$v = $this->c->Validator->addValidators([
])->setRules([
'token' => 'token:AdminPermissions',
'p_message_bbcode' => 'required|integer|in:0,1',
'p_message_img_tag' => 'required|integer|in:0,1',
'p_message_all_caps' => 'required|integer|in:0,1',
'p_subject_all_caps' => 'required|integer|in:0,1',
'p_force_guest_email' => 'required|integer|in:0,1',
'p_sig_bbcode' => 'required|integer|in:0,1',
'p_sig_img_tag' => 'required|integer|in:0,1',
'p_sig_all_caps' => 'required|integer|in:0,1',
'p_sig_length' => 'required|integer|min:0|max:16000',
'p_sig_lines' => 'required|integer|min:0|max:100',
])->setArguments([
])->setMessages([
]);
$valid = $v->validation($_POST);
$data = $v->getData();
unset($data['token']);
foreach ($data as $attr => $value) {
$config->$attr = $value;
}
if ($valid) {
$config->save();
return $this->c->Redirect->page('AdminPermissions')->message(\ForkBB\__('Perms updated redirect'));
}
$this->fIswev = $v->getErrors();
}
$this->aIndex = 'permissions';
$this->nameTpl = 'admin/form';
$this->form = $this->viewForm($config);
$this->titleForm = \ForkBB\__('Permissions head');
$this->classForm = 'editpermissions';
return $this;
}
/**
* Формирует данные для формы
*
* @param Config $config
*
* @return array
*/
protected function viewForm(Config $config)
{
$form = [
'action' => $this->c->Router->link('AdminPermissions'),
'hidden' => [
'token' => $this->c->Csrf->create('AdminPermissions'),
],
'sets' => [],
'btns' => [
'update' => [
'type' => 'submit',
'value' => \ForkBB\__('Update'),
'accesskey' => 'u',
],
],
];
$yn = [1 => \ForkBB\__('Yes'), 0 => \ForkBB\__('No')];
$form['sets'][] = [
'legend' => \ForkBB\__('Posting subhead'),
'fields' => [
'p_message_bbcode' => [
'type' => 'radio',
'value' => $config->p_message_bbcode,
'values' => $yn,
'title' => \ForkBB\__('BBCode label'),
'info' => \ForkBB\__('BBCode help'),
],
'p_message_img_tag' => [
'type' => 'radio',
'value' => $config->p_message_img_tag,
'values' => $yn,
'title' => \ForkBB\__('Image tag label'),
'info' => \ForkBB\__('Image tag help'),
],
'p_message_all_caps' => [
'type' => 'radio',
'value' => $config->p_message_all_caps,
'values' => $yn,
'title' => \ForkBB\__('All caps message label'),
'info' => \ForkBB\__('All caps message help'),
],
'p_subject_all_caps' => [
'type' => 'radio',
'value' => $config->p_subject_all_caps,
'values' => $yn,
'title' => \ForkBB\__('All caps subject label'),
'info' => \ForkBB\__('All caps subject help'),
],
'p_force_guest_email' => [
'type' => 'radio',
'value' => $config->p_force_guest_email,
'values' => $yn,
'title' => \ForkBB\__('Require e-mail label'),
'info' => \ForkBB\__('Require e-mail help'),
],
],
];
$form['sets'][] = [
'legend' => \ForkBB\__('Signatures subhead'),
'fields' => [
'p_sig_bbcode' => [
'type' => 'radio',
'value' => $config->p_sig_bbcode,
'values' => $yn,
'title' => \ForkBB\__('BBCode sigs label'),
'info' => \ForkBB\__('BBCode sigs help'),
],
'p_sig_img_tag' => [
'type' => 'radio',
'value' => $config->p_sig_img_tag,
'values' => $yn,
'title' => \ForkBB\__('Image tag sigs label'),
'info' => \ForkBB\__('Image tag sigs help'),
],
'p_sig_all_caps' => [
'type' => 'radio',
'value' => $config->p_sig_all_caps,
'values' => $yn,
'title' => \ForkBB\__('All caps sigs label'),
'info' => \ForkBB\__('All caps sigs help'),
],
'p_sig_length' => [
'type' => 'number',
'min' => 0,
'max' => 16000,
'value' => $config->p_sig_length,
'title' => \ForkBB\__('Max sig length label'),
'info' => \ForkBB\__('Max sig length help'),
],
'p_sig_lines' => [
'type' => 'number',
'min' => 0,
'max' => 100,
'value' => $config->p_sig_lines,
'title' => \ForkBB\__('Max sig lines label'),
'info' => \ForkBB\__('Max sig lines help'),
],
],
];
return $form;
}
}

View file

@ -0,0 +1,79 @@
#
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Project-Id-Version: ForkBB\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
msgid "Must enter name message"
msgstr "You must enter a name for the category"
msgid "Category added redirect"
msgstr "Category added. Redirecting …"
msgid "Category deleted redirect"
msgstr "Category deleted. Redirecting …"
msgid "Delete category head"
msgstr "Delete category (together with all forums and posts it contains)"
msgid "Confirm delete subhead"
msgstr "Confirm delete category"
msgid "Confirm delete info"
msgstr "Are you sure that you want to delete the category <b>%s</b>?"
msgid "Delete category warn"
msgstr "<b>WARNING!</b> Deleting a category will delete all forums and posts (if any) in this category!"
msgid "Must enter integer message"
msgstr "Position must be a positive integer value."
msgid "Categories updated redirect"
msgstr "Categories updated. Redirecting …"
msgid "Add categories head"
msgstr "Add categories"
msgid "Add categories subhead"
msgstr "Add categories"
msgid "Add category label"
msgstr "Name of the new category"
msgid "Add new submit"
msgstr "Add new"
msgid "Add category help"
msgstr "The name of the new category you want to add. You can edit the name of the category later. Go to <a href="%1$s">%2$s</a> to add forums to your new category."
msgid "Delete categories head"
msgstr "Delete categories"
msgid "Delete categories subhead"
msgstr "Delete categories"
msgid "Delete category label"
msgstr "Delete a category"
msgid "Delete category help"
msgstr "Select the name of the category you want to delete. You will be asked to confirm your choice of category for deletion before it is deleted."
msgid "Edit categories head"
msgstr "Edit categories"
msgid "Edit categories subhead"
msgstr "Edit categories"
msgid "Category position label"
msgstr "Position"
msgid "Category name label"
msgstr "Name"

View file

@ -0,0 +1,85 @@
#
msgid ""
msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Project-Id-Version: ForkBB\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
msgid "Perms updated redirect"
msgstr "Permissions updated. Redirecting …"
msgid "Permissions head"
msgstr "Permissions"
msgid "Posting subhead"
msgstr "Posting"
msgid "BBCode label"
msgstr "BBCode"
msgid "BBCode help"
msgstr "Allow BBCode in posts (recommended)."
msgid "Image tag label"
msgstr "Image tag"
msgid "Image tag help"
msgstr "Allow the BBCode [img][/img] tag in posts."
msgid "All caps message label"
msgstr "All caps message"
msgid "All caps message help"
msgstr "Allow a message to contain only capital letters."
msgid "All caps subject label"
msgstr "All caps subject"
msgid "All caps subject help"
msgstr "Allow a subject to contain only capital letters."
msgid "Require e-mail label"
msgstr "Require guest email"
msgid "Require e-mail help"
msgstr "Require guests to supply an email address when posting."
msgid "Signatures subhead"
msgstr "Signatures"
msgid "BBCode sigs label"
msgstr "BBCodes in signatures"
msgid "BBCode sigs help"
msgstr "Allow BBCodes in user signatures."
msgid "Image tag sigs label"
msgstr "Image tag in signatures"
msgid "Image tag sigs help"
msgstr "Allow the BBCode [img][/img] tag in user signatures (not recommended)."
msgid "All caps sigs label"
msgstr "All caps signature"
msgid "All caps sigs help"
msgstr "Allow a signature to contain only capital letters."
msgid "Max sig length label"
msgstr "Maximum signature length"
msgid "Max sig length help"
msgstr "The maximum number of characters a user signature may contain."
msgid "Max sig lines label"
msgstr "Maximum signature lines"
msgid "Max sig lines help"
msgstr "The maximum number of lines a user signature may contain."

View file

@ -0,0 +1,79 @@
#
msgid ""
msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Project-Id-Version: ForkBB\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
msgid "Must enter name message"
msgstr "Необходимо ввести имя категории"
msgid "Category added redirect"
msgstr "Категория добавлена. Переадресация …"
msgid "Category deleted redirect"
msgstr "Категория удалена. Переадресация …"
msgid "Delete category head"
msgstr "Удаление категории (вместе со всеми разделами и темами в ней)"
msgid "Confirm delete subhead"
msgstr "Подтверждение удаления категории"
msgid "Confirm delete info"
msgstr "Вы уверены, что хотите удалить категорию <b>%s</b>?"
msgid "Delete category warn"
msgstr "<b>ВНИМАНИЕ!</b> Удаляя категорию вы удалите все разделы, темы и сообщения относящиеся к ней (если таковые имеются)!"
msgid "Must enter integer message"
msgstr "Позиция должна быть неотрицательным целым числом."
msgid "Categories updated redirect"
msgstr "Категории изменены. Переадресация …"
msgid "Add categories head"
msgstr "Добавление категорий"
msgid "Add categories subhead"
msgstr "Добавление категорий"
msgid "Add category label"
msgstr "Имя новой категории"
msgid "Add new submit"
msgstr "Добавить"
msgid "Add category help"
msgstr "Имя для новой категории. Вы сможете изменить имя категории позже. Перейдите в <a href="%1$s">%2$s</a>, чтобы добавить разделы в новую категорию."
msgid "Delete categories head"
msgstr "Удаление категорий"
msgid "Delete categories subhead"
msgstr "Удаление категорий"
msgid "Delete category label"
msgstr "Удалить категорию"
msgid "Delete category help"
msgstr "Выберите категорию для удаления. У вас будет запрошено подтверждение, прежде чем категория будет окончательно удалена."
msgid "Edit categories head"
msgstr "Редактирование категорий"
msgid "Edit categories subhead"
msgstr "Редактирование категорий"
msgid "Category position label"
msgstr "Позиция"
msgid "Category name label"
msgstr "Имя"

View file

@ -322,7 +322,7 @@ msgid "Signatures help"
msgstr "Разрешить пользователям использовать подписи под своими сообщениями."
msgid "User has posted label"
msgstr "Метка где писал"
msgstr "Метка участия"
msgid "User has posted help"
msgstr "Показывать точки перед заголовками тем на странице раздела в случае, если пользователь писал в этой теме. Выключите, если хотите снизить загрузку сервера."

View file

@ -0,0 +1,85 @@
#
msgid ""
msgstr ""
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Project-Id-Version: ForkBB\n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: ForkBB <mio.visman@yandex.ru>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ru\n"
msgid "Perms updated redirect"
msgstr "Права изменены. Переадресация …"
msgid "Permissions head"
msgstr "Права"
msgid "Posting subhead"
msgstr "Сообщения"
msgid "BBCode label"
msgstr "BBCode"
msgid "BBCode help"
msgstr "Разрешить BBCode в сообщениях (рекомендуется)."
msgid "Image tag label"
msgstr "Тег IMG"
msgid "Image tag help"
msgstr "Разрешить тег [img][/img] в сообщениях."
msgid "All caps message label"
msgstr "Сообщение заглавными"
msgid "All caps message help"
msgstr "Разрешить сообщения, состоящие из одних заглавных букв."
msgid "All caps subject label"
msgstr "Тема заглавными"
msgid "All caps subject help"
msgstr "Разрешить заголовки тем, состоящие из одних заглавных букв."
msgid "Require e-mail label"
msgstr "Обязательный email гостя"
msgid "Require e-mail help"
msgstr "Если гостям разрешено отправлять комментарии, требовать от них указать email."
msgid "Signatures subhead"
msgstr "Подписи"
msgid "BBCode sigs label"
msgstr "BBCodes в подписи"
msgid "BBCode sigs help"
msgstr "Разрешить BBCodes в подписи пользователя."
msgid "Image tag sigs label"
msgstr "Тег IMG в подписи"
msgid "Image tag sigs help"
msgstr "Разрешить тег [img][/img] в подписи пользователя (не рекомендуется)."
msgid "All caps sigs label"
msgstr "Подпись заглавными"
msgid "All caps sigs help"
msgstr "Разрешить подписи, состоящие из одних заглавных букв."
msgid "Max sig length label"
msgstr "Макс. длина сообщения"
msgid "Max sig length help"
msgstr "Максимальное количество букв в подписи пользователя."
msgid "Max sig lines label"
msgstr "Макс. строк сообщения"
msgid "Max sig lines help"
msgstr "Максимальное количество строк в подписи пользователя."

View file

@ -0,0 +1,12 @@
@section ('updown')
<a href="">UP</a> <a href="">DOWN</a>
@endsection
@extends ('layouts/admin')
<section class="f-admin f-updatecategories-form">
<h2>{!! __('Edit categories head') !!}</h2>
<div class="f-fdiv">
@if ($form = $p->formUpdate)
@include ('layouts/form')
@endif
</div>
</section>

View file

@ -1558,4 +1558,39 @@ li + li .f-btn {
float: left;
padding-left: 0.3125rem;
}
}
}
/*********************/
/* Админка/Категории */
/*********************/
.f-updatecategories-form dt {
display: none;
}
.f-updatecategories-form dd {
padding-left: 0;
}
.f-updatecategories-form .f-field-name {
float: left;
width: 70%;
}
.f-updatecategories-form .f-field-position {
padding-left: 0.625rem;
float: left;
width: 30%;
}
.f-updatecategories-form dl:first-child dt,
.f-updatecategories-form dl:nth-child(2) dt,
.f-updatecategories-form dl:last-child dt {
display: block;
width: 100%;
overflow: hidden;
}
.f-updatecategories-form .f-child1 {
font-weight: normal;
}