Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
0924669a
Commit
0924669a
authored
Jul 30, 2020
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update multiple counts in admin
parent
cbd6fbda
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
admin.php
qa-include/app/admin.php
+17
-5
No files found.
qa-include/app/admin.php
View file @
0924669a
...
...
@@ -706,6 +706,7 @@ function qa_admin_single_click_array($entityid, $action)
case
'approve'
:
case
'reject'
:
$entityCount
=
(
int
)
qa_opt
(
'cache_queuedcount'
);
$hiddenCount
=
(
int
)
qa_opt
(
'cache_hiddencount'
);
if
(
!
$queued
)
{
$response
[
'result'
]
=
'error'
;
$response
[
'error'
][
'type'
]
=
'post-not-queued'
;
...
...
@@ -726,10 +727,12 @@ function qa_admin_single_click_array($entityid, $action)
$response
[
'error'
][
'message'
]
=
qa_lang_html
(
'users/no_permission'
);
$response
[
'error'
][
'severity'
]
=
'fatal'
;
}
else
{
$postStatus
=
$action
===
'approve'
?
QA_POST_STATUS_NORMAL
:
QA_POST_STATUS_HIDDEN
;
// 'reject'
qa_post_set_status
(
$entityid
,
$postStatus
,
$userid
);
if
(
$action
===
'approve'
)
{
qa_post_set_status
(
$entityid
,
QA_POST_STATUS_NORMAL
,
$userid
);
}
else
{
// 'reject'
qa_post_set_status
(
$entityid
,
QA_POST_STATUS_HIDDEN
,
$userid
);
$hiddenCount
++
;
}
$response
[
'result'
]
=
'success'
;
$response
[
'domUpdates'
]
=
array
(
...
...
@@ -738,6 +741,10 @@ function qa_admin_single_click_array($entityid, $action)
'html'
=>
max
(
$entityCount
-
1
,
0
),
),
array
(
'selector'
=>
'.qa-nav-sub-counter-hidden'
,
'html'
=>
$hiddenCount
,
),
array
(
'selector'
=>
'#p'
.
$entityid
,
'action'
=>
'conceal'
,
),
...
...
@@ -791,6 +798,7 @@ function qa_admin_single_click_array($entityid, $action)
case
'hide'
:
case
'clearflags'
:
$entityCount
=
(
int
)
qa_opt
(
'cache_flaggedcount'
);
$hiddenCount
=
(
int
)
qa_opt
(
'cache_hiddencount'
);
if
(
$action
===
'hide'
&&
$queued
)
{
$response
[
'result'
]
=
'error'
;
$response
[
'error'
][
'type'
]
=
'post-queued'
;
...
...
@@ -813,9 +821,9 @@ function qa_admin_single_click_array($entityid, $action)
}
else
{
if
(
$action
===
'hide'
)
{
qa_post_set_status
(
$entityid
,
QA_POST_STATUS_HIDDEN
,
$userid
);
$hiddenCount
++
;
}
else
{
// 'clearflags'
require_once
QA_INCLUDE_DIR
.
'app/votes.php'
;
qa_flags_clear_all
(
$post
,
$userid
,
qa_get_logged_in_handle
(),
null
);
}
...
...
@@ -826,6 +834,10 @@ function qa_admin_single_click_array($entityid, $action)
'html'
=>
max
(
$entityCount
-
1
,
0
),
),
array
(
'selector'
=>
'.qa-nav-sub-counter-hidden'
,
'html'
=>
$hiddenCount
,
),
array
(
'selector'
=>
'#p'
.
$entityid
,
'action'
=>
'conceal'
,
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment