Browse Source

Change Profile\Config page

For subscription options
Visman 4 năm trước cách đây
mục cha
commit
55569713fd
3 tập tin đã thay đổi với 55 bổ sung9 xóa
  1. 34 0
      app/Models/Pages/Profile/Config.php
  2. 11 5
      app/lang/en/profile.po
  3. 10 4
      app/lang/ru/profile.po

+ 34 - 0
app/Models/Pages/Profile/Config.php

@@ -73,6 +73,17 @@ class Config extends Profile
                 ])->addMessages([
                 ]);
 
+            if ($this->rules->viewSubscription) { // ???? модераторы?
+                $v = $this->c->Validator
+                    ->addRules([
+                        'notify_with_post' => 'required|integer|in:0,1',
+                        'auto_notify'      => 'required|integer|in:0,1',
+                    ])->addAliases([
+                        'notify_with_post' => 'Notify label',
+                        'auto_notify'      => 'Auto notify label',
+                    ]);
+            }
+
             if ($v->validation($_POST)) {
                 $data  = $v->getData();
                 unset($data['token']);
@@ -342,6 +353,29 @@ class Config extends Profile
             ],
         ];
 
+        if ($this->rules->viewSubscription) { // ???? модераторы?
+            $form['sets']['subscriptions'] = [
+                'legend' => __('Subscription options'),
+                'class'  => 'data-edit',
+                'fields' => [
+                    'notify_with_post' => [
+                        'type'    => 'radio',
+                        'value'   => $this->curUser->notify_with_post,
+                        'values'  => $yn,
+                        'caption' => __('Notify label'),
+                        'info'    => __('Notify info'),
+                    ],
+                    'auto_notify' => [
+                        'type'    => 'radio',
+                        'value'   => $this->curUser->auto_notify,
+                        'values'  => $yn,
+                        'caption' => __('Auto notify label'),
+                        'info'    => __('Auto notify info'),
+                    ],
+                ],
+            ];
+            }
+
         return $form;
     }
 }

+ 11 - 5
app/lang/en/profile.po

@@ -267,13 +267,19 @@ msgstr "Posts"
 msgid "Leave blank"
 msgstr "Leave blank to use forum default."
 
-msgid "Subscription legend"
-msgstr "Set your subscription options"
+msgid "Subscription options"
+msgstr "Subscription options"
 
-msgid "Notify full"
-msgstr "Include a plain text version of new posts in subscription notification emails."
+msgid "Notify label"
+msgstr "Notification with post text"
 
-msgid "Auto notify full"
+msgid "Notify info"
+msgstr "Include a text of new posts in subscription notification emails."
+
+msgid "Auto notify label"
+msgstr "Automatically subscribe to topics"
+
+msgid "Auto notify info"
 msgstr "Automatically subscribe to every topic you post in."
 
 msgid "Smilies label"

+ 10 - 4
app/lang/ru/profile.po

@@ -267,13 +267,19 @@ msgstr "Сообщений"
 msgid "Leave blank"
 msgstr "Оставьте поле пустым, для использования настроек по умолчанию."
 
-msgid "Subscription legend"
-msgstr "Настройка опций вашей подписки"
+msgid "Subscription options"
+msgstr "Опции подписки"
 
-msgid "Notify full"
+msgid "Notify label"
+msgstr "Уведомление с текстом сообщения"
+
+msgid "Notify info"
 msgstr "Включать в письмо-уведомление текстовую часть новых сообщений."
 
-msgid "Auto notify full"
+msgid "Auto notify label"
+msgstr "Авто. подписка на темы"
+
+msgid "Auto notify info"
 msgstr "Автоматически подписываться на темы, в которых публикуете сообщения."
 
 msgid "Smilies label"