Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mahara
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
mahara
mahara
Commits
a1719bbd
Commit
a1719bbd
authored
Jun 05, 2015
by
Son Nguyen
Committed by
Gerrit Code Review
Jun 05, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug 1460368: stopping anonymous comments on artefacts"
parents
1aef6b75
3046c5c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
htdocs/artefact/artefact.php
htdocs/artefact/artefact.php
+1
-1
htdocs/artefact/comment/lib.php
htdocs/artefact/comment/lib.php
+3
-0
htdocs/theme/raw/templates/artefact/artefactcommentsview.tpl
htdocs/theme/raw/templates/artefact/artefactcommentsview.tpl
+1
-1
No files found.
htdocs/artefact/artefact.php
View file @
a1719bbd
...
...
@@ -146,7 +146,7 @@ EOF;
$javascript
=
array
(
'paginator'
,
'viewmenu'
,
'expandable'
);
$extrastylesheets
=
array
(
'style/views.css'
);
if
(
$artefact
->
get
(
'allowcomments'
))
{
if
(
$artefact
->
get
(
'allowcomments'
)
&&
(
$USER
->
is_logged_in
()
||
(
!
$USER
->
is_logged_in
()
&&
get_config
(
'anonymouscomments'
)))
)
{
$addfeedbackform
=
pieform
(
ArtefactTypeComment
::
add_comment_form
(
false
,
$artefact
->
get
(
'approvecomments'
)));
$extrastylesheets
[]
=
'style/jquery.rating.css'
;
$javascript
[]
=
'jquery.rating'
;
...
...
htdocs/artefact/comment/lib.php
View file @
a1719bbd
...
...
@@ -523,6 +523,8 @@ class ArtefactTypeComment extends ArtefactType {
* or the html to render them.
*/
public
function
get_artefact_comments_for_view
(
ArtefactType
$artefact
,
$view
,
$blockid
,
$html
=
true
,
$editing
=
false
)
{
global
$USER
;
if
(
!
is_object
(
$artefact
)
||
!
is_object
(
$view
))
{
throw
new
MaharaException
(
'we do not have the right information to display the comments'
);
}
...
...
@@ -549,6 +551,7 @@ class ArtefactTypeComment extends ArtefactType {
$smarty
->
assign
(
'comments'
,
$comments
);
$smarty
->
assign
(
'editing'
,
$editing
);
$smarty
->
assign
(
'allowcomments'
,
$artefact
->
get
(
'allowcomments'
));
$smarty
->
assign
(
'allowcommentsadd'
,
(
$artefact
->
get
(
'allowcomments'
)
&&
(
$USER
->
is_logged_in
()
||
(
!
$USER
->
is_logged_in
()
&&
get_config
(
'anonymouscomments'
)))));
$render
=
$smarty
->
fetch
(
'artefact/artefactcommentsview.tpl'
);
return
array
(
$commentcount
,
$render
);
}
...
...
htdocs/theme/raw/templates/artefact/artefactcommentsview.tpl
View file @
a1719bbd
...
...
@@ -8,7 +8,7 @@
<span
id=
'block_
{
$blockid
}
'
class=
"nocomments"
>
{
str
tag
=
Comments
section
=
artefact
.
comment
}
(
{
$commentcount
}
)
</span>
{/
if
}
{/
if
}
{
if
$allowcomments
}
{
if
$allowcomments
add
}
{
if
!
$editing
}
<a
class=
"addcomment bar-before"
href=
"
{
$artefacturl
}
"
>
{
str
tag
=
addcomment
section
=
artefact
.
comment
}
</a>
{/
if
}
...
...
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