Parcourir la source

Minor changes

Visman il y a 3 ans
Parent
commit
887132d4ed

+ 3 - 2
app/Models/Pages/Admin/Reports.php

@@ -15,6 +15,7 @@ use ForkBB\Models\Pages\Admin;
 use ForkBB\Models\Post\Post;
 use ForkBB\Models\Post\Post;
 use ForkBB\Models\Report\Report;
 use ForkBB\Models\Report\Report;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
 
 
 class Reports extends Admin
 class Reports extends Admin
 {
 {
@@ -77,11 +78,11 @@ class Reports extends Admin
         foreach ($reports as $report) {
         foreach ($reports as $report) {
             if ($noZapped) {
             if ($noZapped) {
                 $cur = [
                 $cur = [
-                    'legend' => ['Reported %s', \ForkBB\dt($report->created)],
+                    'legend' => ['Reported %s', dt($report->created)],
                 ];
                 ];
             } else {
             } else {
                 $cur = [
                 $cur = [
-                    'legend' => ['Marked as read %1$s by %2$s', \ForkBB\dt($report->zapped), $report->marker->username],
+                    'legend' => ['Marked as read %1$s by %2$s', dt($report->zapped), $report->marker->username],
                 ];
                 ];
             }
             }
             $cur['fields'] = [];
             $cur['fields'] = [];

+ 2 - 1
app/Models/Pages/Admin/Users/Result.php

@@ -15,6 +15,7 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Models\User\User;
 use ForkBB\Models\User\User;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\num;
 
 
 class Result extends Users
 class Result extends Users
 {
 {
@@ -301,7 +302,7 @@ class Result extends Users
                 'class'   => $user->isGuest ? ['result', 'posts', 'no-data'] : ['result', 'posts'],
                 'class'   => $user->isGuest ? ['result', 'posts', 'no-data'] : ['result', 'posts'],
                 'type'    => $user->isGuest || ! $user->last_post ? 'str' : 'link',
                 'type'    => $user->isGuest || ! $user->last_post ? 'str' : 'link',
                 'caption' => 'Results posts head',
                 'caption' => 'Results posts head',
-                'value'   => $user->last_post > 0 ? \ForkBB\num($user->num_posts) : null,
+                'value'   => $user->last_post > 0 ? num($user->num_posts) : null,
                 'href'    => $this->c->Router->link(
                 'href'    => $this->c->Router->link(
                     'SearchAction',
                     'SearchAction',
                     [
                     [

+ 4 - 2
app/Models/Pages/Admin/Users/Stat.php

@@ -14,6 +14,8 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Admin\Users;
 use ForkBB\Models\Pages\Admin\Users;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
+use function \ForkBB\num;
 
 
 class Stat extends Users
 class Stat extends Users
 {
 {
@@ -101,13 +103,13 @@ class Stat extends Users
                 'class'   => ['result', 'last-used'],
                 'class'   => ['result', 'last-used'],
                 'type'    => 'str',
                 'type'    => 'str',
                 'caption' => 'Results last used head',
                 'caption' => 'Results last used head',
-                'value'   => $flag ? \ForkBB\dt($data['last_used']) : null,
+                'value'   => $flag ? dt($data['last_used']) : null,
             ];
             ];
             $fields["l{$number}-used-times"] = [
             $fields["l{$number}-used-times"] = [
                 'class'   => ['result', 'used-times'],
                 'class'   => ['result', 'used-times'],
                 'type'    => 'str',
                 'type'    => 'str',
                 'caption' => 'Results times found head',
                 'caption' => 'Results times found head',
-                'value'   => $flag ? \ForkBB\num($data['used_times']) : null,
+                'value'   => $flag ? num($data['used_times']) : null,
             ];
             ];
             $fields["l{$number}-action"] = [
             $fields["l{$number}-action"] = [
                 'class'   => ['result', 'action'],
                 'class'   => ['result', 'action'],

+ 2 - 1
app/Models/Pages/Delete.php

@@ -13,6 +13,7 @@ namespace ForkBB\Models\Pages;
 use ForkBB\Models\Page;
 use ForkBB\Models\Page;
 use ForkBB\Models\Post\Post;
 use ForkBB\Models\Post\Post;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
 
 
 class Delete extends Page
 class Delete extends Page
 {
 {
@@ -109,7 +110,7 @@ class Delete extends Page
                             'value'   => __(['Topic %s', $post->parent->name]),
                             'value'   => __(['Topic %s', $post->parent->name]),
                         ],
                         ],
                         [
                         [
-                            'value'   => __([$deleteTopic ? 'Topic by' : 'Reply by', $post->poster, \ForkBB\dt($post->posted)]),
+                            'value'   => __([$deleteTopic ? 'Topic by' : 'Reply by', $post->poster, dt($post->posted)]),
                             'html'    => true,
                             'html'    => true,
                         ],
                         ],
                     ],
                     ],

+ 2 - 1
app/Models/Pages/Moderate.php

@@ -17,6 +17,7 @@ use ForkBB\Models\Forum\Forum;
 use ForkBB\Models\Topic\Topic;
 use ForkBB\Models\Topic\Topic;
 use ForkBB\Models\Post\Post;
 use ForkBB\Models\Post\Post;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
 
 
 class Moderate extends Page
 class Moderate extends Page
 {
 {
@@ -577,7 +578,7 @@ class Moderate extends Page
             if ($object instanceof Topic) {
             if ($object instanceof Topic) {
                 $headers[] = __(['Topic «%s»', $object->name]);
                 $headers[] = __(['Topic «%s»', $object->name]);
             } else {
             } else {
-                $headers[] = __(['Post «%1$s by %2$s»', \ForkBB\dt($object->posted), $object->poster]);
+                $headers[] = __(['Post «%1$s by %2$s»', dt($object->posted), $object->poster]);
             }
             }
         }
         }
 
 

+ 2 - 1
app/Models/Pages/PM/PMDelete.php

@@ -20,6 +20,7 @@ use ForkBB\Models\PM\PPost;
 use ForkBB\Models\PM\PTopic;
 use ForkBB\Models\PM\PTopic;
 use InvalidArgumentException;
 use InvalidArgumentException;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
 
 
 class PMDelete extends AbstractPM
 class PMDelete extends AbstractPM
 {
 {
@@ -141,7 +142,7 @@ class PMDelete extends AbstractPM
                             'value'   => __([
                             'value'   => __([
                                 $deleteTopic ? 'Dialogue by %1$s (%2$s)' : 'Message by %1$s (%2$s)',
                                 $deleteTopic ? 'Dialogue by %1$s (%2$s)' : 'Message by %1$s (%2$s)',
                                 $post->poster,
                                 $post->poster,
-                                \ForkBB\dt($post->posted)
+                                dt($post->posted)
                             ]),
                             ]),
                             'html'    => true,
                             'html'    => true,
                         ],
                         ],

+ 3 - 2
app/Models/Pages/Profile/Config.php

@@ -14,6 +14,7 @@ use ForkBB\Core\Validator;
 use ForkBB\Models\Page;
 use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\Pages\Profile;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
 
 
 class Config extends Profile
 class Config extends Profile
 {
 {
@@ -150,7 +151,7 @@ class Config extends Profile
         $styles = $this->c->Func->getStyles();
         $styles = $this->c->Func->getStyles();
         $timeFormat = [];
         $timeFormat = [];
         foreach ($this->c->TIME_FORMATS as $key => $value) {
         foreach ($this->c->TIME_FORMATS as $key => $value) {
-            $timeFormat[$key] = \ForkBB\dt(\time(), false, null, $value, true, true)
+            $timeFormat[$key] = dt(\time(), false, null, $value, true, true)
                 . (
                 . (
                     $key > 1
                     $key > 1
                     ? ''
                     ? ''
@@ -159,7 +160,7 @@ class Config extends Profile
         }
         }
         $dateFormat = [];
         $dateFormat = [];
         foreach ($this->c->DATE_FORMATS as $key => $value) {
         foreach ($this->c->DATE_FORMATS as $key => $value) {
-            $dateFormat[$key] = \ForkBB\dt(\time(), true, $value, null, false, true)
+            $dateFormat[$key] = dt(\time(), true, $value, null, false, true)
                 . (
                 . (
                     $key > 1
                     $key > 1
                     ? ''
                     ? ''

+ 7 - 5
app/Models/Pages/Profile/Edit.php

@@ -17,6 +17,8 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\User\User;
 use ForkBB\Models\User\User;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\num;
+use function \ForkBB\size;
 
 
 class Edit extends Profile
 class Edit extends Profile
 {
 {
@@ -326,10 +328,10 @@ class Edit extends Profile
                 'type'    => 'file',
                 'type'    => 'file',
                 'caption' => 'New avatar',
                 'caption' => 'New avatar',
                 'help'    => ['New avatar info',
                 'help'    => ['New avatar info',
-                    \ForkBB\num($this->c->config->i_avatars_width),
-                    \ForkBB\num($this->c->config->i_avatars_height),
-                    \ForkBB\num($this->c->config->i_avatars_size),
-                    \ForkBB\size($this->c->config->i_avatars_size)
+                    num($this->c->config->i_avatars_width),
+                    num($this->c->config->i_avatars_height),
+                    num($this->c->config->i_avatars_size),
+                    size($this->c->config->i_avatars_size)
                 ],
                 ],
                 'accept' => $this->accept,
                 'accept' => $this->accept,
             ];
             ];
@@ -451,7 +453,7 @@ class Edit extends Profile
                 'type'    => 'textarea',
                 'type'    => 'textarea',
                 'value'   => $this->curUser->signature,
                 'value'   => $this->curUser->signature,
                 'caption' => 'Signature',
                 'caption' => 'Signature',
-                'help'    => ['Sig max size', \ForkBB\num($this->curUser->g_sig_length), \ForkBB\num($this->curUser->g_sig_lines)],
+                'help'    => ['Sig max size', num($this->curUser->g_sig_length), num($this->curUser->g_sig_lines)],
             ];
             ];
             $form['sets']['signature'] = [
             $form['sets']['signature'] = [
                 'class'  => ['data-edit'],
                 'class'  => ['data-edit'],

+ 12 - 10
app/Models/Pages/Profile/View.php

@@ -14,6 +14,8 @@ use ForkBB\Models\Page;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\Pages\Profile;
 use ForkBB\Models\PM\Cnst;
 use ForkBB\Models\PM\Cnst;
 use function \ForkBB\__;
 use function \ForkBB\__;
+use function \ForkBB\dt;
+use function \ForkBB\num;
 use function \ForkBB\url;
 use function \ForkBB\url;
 
 
 class View extends Profile
 class View extends Profile
@@ -233,13 +235,13 @@ class View extends Profile
         $fields['registered'] = [
         $fields['registered'] = [
             'class'   => ['pline'],
             'class'   => ['pline'],
             'type'    => 'str',
             'type'    => 'str',
-            'value'   => \ForkBB\dt($this->curUser->registered, true),
+            'value'   => dt($this->curUser->registered, true),
             'caption' => 'Registered info',
             'caption' => 'Registered info',
         ];
         ];
         $fields['lastpost'] = [
         $fields['lastpost'] = [
             'class'   => ['pline'],
             'class'   => ['pline'],
             'type'    => 'str',
             'type'    => 'str',
-            'value'   => \ForkBB\dt($this->curUser->last_post, true),
+            'value'   => dt($this->curUser->last_post, true),
             'caption' => 'Last post info',
             'caption' => 'Last post info',
         ];
         ];
         if ($this->curUser->last_post > 0) {
         if ($this->curUser->last_post > 0) {
@@ -248,7 +250,7 @@ class View extends Profile
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => 'link',
                     'type'    => 'link',
                     'caption' => 'Posts info',
                     'caption' => 'Posts info',
-                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_posts) : __('Show posts'),
+                    'value'   => $this->user->showPostCount ? num($this->curUser->num_posts) : __('Show posts'),
                     'href'    => $this->c->Router->link(
                     'href'    => $this->c->Router->link(
                         'SearchAction',
                         'SearchAction',
                         [
                         [
@@ -262,7 +264,7 @@ class View extends Profile
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => 'link',
                     'type'    => 'link',
                     'caption' => 'Topics info',
                     'caption' => 'Topics info',
-                    'value'   => $this->user->showPostCount ? \ForkBB\num($this->curUser->num_topics) : __('Show topics'),
+                    'value'   => $this->user->showPostCount ? num($this->curUser->num_topics) : __('Show topics'),
                     'href'    => $this->c->Router->link(
                     'href'    => $this->c->Router->link(
                         'SearchAction',
                         'SearchAction',
                         [
                         [
@@ -277,13 +279,13 @@ class View extends Profile
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => 'str',
                     'type'    => 'str',
                     'caption' => 'Posts info',
                     'caption' => 'Posts info',
-                    'value'   => \ForkBB\num($this->curUser->num_posts),
+                    'value'   => num($this->curUser->num_posts),
                 ];
                 ];
                 $fields['topics'] = [
                 $fields['topics'] = [
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => 'str',
                     'type'    => 'str',
                     'caption' => 'Topics info',
                     'caption' => 'Topics info',
-                    'value'   => \ForkBB\num($this->curUser->num_topics),
+                    'value'   => num($this->curUser->num_topics),
                 ];
                 ];
             }
             }
         }
         }
@@ -296,7 +298,7 @@ class View extends Profile
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => $isLink ? 'link' : 'str',
                     'type'    => $isLink ? 'link' : 'str',
                     'caption' => 'Total forums subscriptions',
                     'caption' => 'Total forums subscriptions',
-                    'value'   => \ForkBB\num(\count($subscrInfo[$subscr::FORUMS_DATA])),
+                    'value'   => num(\count($subscrInfo[$subscr::FORUMS_DATA])),
                     'href'    => $this->c->Router->link(
                     'href'    => $this->c->Router->link(
                         'SearchAction',
                         'SearchAction',
                         [
                         [
@@ -312,7 +314,7 @@ class View extends Profile
                     'class'   => ['pline'],
                     'class'   => ['pline'],
                     'type'    => $isLink ? 'link' : 'str',
                     'type'    => $isLink ? 'link' : 'str',
                     'caption' => 'Total topics subscriptions',
                     'caption' => 'Total topics subscriptions',
-                    'value'   => \ForkBB\num(\count($subscrInfo[$subscr::TOPICS_DATA])),
+                    'value'   => num(\count($subscrInfo[$subscr::TOPICS_DATA])),
                     'href'    => $this->c->Router->link(
                     'href'    => $this->c->Router->link(
                         'SearchAction',
                         'SearchAction',
                         [
                         [
@@ -337,8 +339,8 @@ class View extends Profile
                 'class'   => ['pline'],
                 'class'   => ['pline'],
                 'type'    => 'str',
                 'type'    => 'str',
                 'value'   => $this->rules->my
                 'value'   => $this->rules->my
-                    ? \ForkBB\dt($this->curUser->last_visit)
-                    : \ForkBB\dt($this->curUser->currentVisit, true),
+                    ? dt($this->curUser->last_visit)
+                    : dt($this->curUser->currentVisit, true),
                 'caption' => 'Last visit info',
                 'caption' => 'Last visit info',
             ];
             ];
         }
         }