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
f1e0e94e
Commit
f1e0e94e
authored
Sep 20, 2014
by
Scott Vivian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Coding style (comment button processing)
parent
c37638d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
qa-page-question-post.php
qa-include/qa-page-question-post.php
+15
-20
No files found.
qa-include/qa-page-question-post.php
View file @
f1e0e94e
...
...
@@ -204,37 +204,32 @@
// Process hide, show, delete, flag, unflag, edit or save button for comments
foreach
(
$commentsfollows
as
$commentid
=>
$comment
)
if
(
$comment
[
'basetype'
]
==
'C'
)
{
$commentparent
=@
$answers
[
$comment
[
'parentid'
]];
if
(
!
isset
(
$commentparent
))
$commentparent
=
$question
;
$commentparenttype
=
$commentparent
[
'basetype'
];
$prefix
=
'c'
.
$commentid
.
'_'
;
foreach
(
$commentsfollows
as
$commentid
=>
$comment
)
{
if
(
$comment
[
'basetype'
]
==
'C'
)
{
$cparentid
=
$comment
[
'parentid'
];
$commentparent
=
isset
(
$answers
[
$cparentid
])
?
$answers
[
$cparentid
]
:
$question
;
$prefix
=
'c'
.
$commentid
.
'_'
;
if
(
qa_page_q_single_click_c
(
$comment
,
$question
,
$commentparent
,
$pageerror
))
qa_page_q_refresh
(
$pagestart
,
'showcomments-'
.
$c
omment
[
'parentid'
],
$commentparenttype
,
$comment
[
'parentid'
]
);
qa_page_q_refresh
(
$pagestart
,
'showcomments-'
.
$c
parentid
,
$commentparent
[
'basetype'
],
$cparentid
);
if
(
$comment
[
'editbutton'
])
{
if
(
qa_clicked
(
$prefix
.
'doedit'
))
{
if
(
qa_page_q_permit_edit
(
$comment
,
'permit_edit_c'
,
$pageerror
))
// extra check here ensures error message is visible
qa_page_q_refresh
(
$pagestart
,
'edit-'
.
$commentid
,
'C'
,
$commentid
);
}
elseif
(
qa_clicked
(
$prefix
.
'dosave'
)
&&
qa_page_q_permit_edit
(
$comment
,
'permit_edit_c'
,
$pageerror
))
{
}
elseif
(
qa_clicked
(
$prefix
.
'dosave'
)
&&
qa_page_q_permit_edit
(
$comment
,
'permit_edit_c'
,
$pageerror
))
{
if
(
qa_page_q_edit_c_submit
(
$comment
,
$question
,
$commentparent
,
$ceditin
[
$commentid
],
$cediterrors
[
$commentid
]))
qa_page_q_refresh
(
$pagestart
,
null
,
'C'
,
$commentid
);
else
{
$formtype
=
'c_edit'
;
$formpostid
=
$commentid
;
// keep editing if an error
$formtype
=
'c_edit'
;
$formpostid
=
$commentid
;
// keep editing if an error
}
}
elseif
((
$pagestate
==
(
'edit-'
.
$commentid
))
&&
qa_page_q_permit_edit
(
$comment
,
'permit_edit_c'
,
$pageerror
))
{
$formtype
=
'c_edit'
;
$formpostid
=
$commentid
;
}
}
elseif
((
$pagestate
==
(
'edit-'
.
$commentid
))
&&
qa_page_q_permit_edit
(
$comment
,
'permit_edit_c'
,
$pageerror
))
{
$formtype
=
'c_edit'
;
$formpostid
=
$commentid
;
}
}
}
...
...
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