Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
284a7db6
Commit
284a7db6
authored
Nov 19, 2014
by
Robert Lyon
Committed by
Gerrit Code Review
Nov 19, 2014
Browse files
Merge "Adding ability to hide the edit/delete buttons (Bug #1037531)"
parents
9e5fce6d
b7a06a40
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/comment/lib.php
View file @
284a7db6
...
...
@@ -331,6 +331,7 @@ class ArtefactTypeComment extends ArtefactType {
$options
->
view
=
null
;
$options
->
artefact
=
null
;
$options
->
export
=
false
;
$options
->
onview
=
false
;
return
$options
;
}
...
...
@@ -453,7 +454,7 @@ class ArtefactTypeComment extends ArtefactType {
}
}
self
::
build_html
(
$result
);
self
::
build_html
(
$result
,
$onview
);
return
$result
;
}
...
...
@@ -504,7 +505,7 @@ class ArtefactTypeComment extends ArtefactType {
);
}
public
static
function
build_html
(
&
$data
)
{
public
static
function
build_html
(
&
$data
,
$onview
)
{
global
$USER
,
$THEME
;
$candelete
=
$data
->
canedit
||
$USER
->
get
(
'admin'
);
$deletedmessage
=
array
();
...
...
@@ -640,6 +641,7 @@ class ArtefactTypeComment extends ArtefactType {
$smarty
->
assign
(
'viewid'
,
$data
->
view
);
$smarty
->
assign
(
'position'
,
$data
->
position
);
$smarty
->
assign
(
'baseurl'
,
$data
->
baseurl
);
$smarty
->
assign
(
'onview'
,
$onview
);
$data
->
tablerows
=
$smarty
->
fetch
(
'artefact:comment:commentlist.tpl'
);
$pagination
=
build_pagination
(
array
(
'id'
=>
'feedback_pagination'
,
...
...
htdocs/theme/raw/artefact/comment/templates/commentlist.tpl
View file @
284a7db6
{
if
$position
==
'blockinstance'
}
{
if
$position
==
'blockinstance'
&&
!
$onview
}
<tr>
<td>
{/
if
}
...
...
@@ -14,17 +14,19 @@
{/
if
}
</div>
<div
class=
"commentrightwrap"
>
<div
class=
"fr"
>
{
if
$item
->
makepublicform
}
<div
class=
"makepublicbtn"
>
{
$item
->
makepublicform
|
safe
}
</div>
{/
if
}
{
if
$item
->
canedit
}
<form
name=
"edit_
{
$post
->
id
}
"
action=
"
{
$WWWROOT
}
artefact/comment/edit.php"
>
<input
type=
"hidden"
name=
"id"
value=
"
{
$item
->
id
}
"
>
<input
type=
"hidden"
name=
"view"
value=
"
{
$viewid
}
"
>
<input
type=
"image"
src=
"
{
theme_url
filename
=
"images/btn_edit.png"
}
"
title=
"
{
str
tag
=
edit
}
"
>
</form>
{
if
!
$onview
}
<div
class=
"fr"
>
{
if
$item
->
makepublicform
}
<div
class=
"makepublicbtn"
>
{
$item
->
makepublicform
|
safe
}
</div>
{/
if
}
{
if
$item
->
canedit
}
<form
name=
"edit_
{
$post
->
id
}
"
action=
"
{
$WWWROOT
}
artefact/comment/edit.php"
>
<input
type=
"hidden"
name=
"id"
value=
"
{
$item
->
id
}
"
>
<input
type=
"hidden"
name=
"view"
value=
"
{
$viewid
}
"
>
<input
type=
"image"
src=
"
{
theme_url
filename
=
"images/btn_edit.png"
}
"
title=
"
{
str
tag
=
edit
}
"
>
</form>
{/
if
}
{
if
$item
->
deleteform
}{
$item
->
deleteform
|
safe
}{/
if
}
</div>
{/
if
}
{
if
$item
->
deleteform
}{
$item
->
deleteform
|
safe
}{/
if
}
</div>
{
if
$item
->
author
}
<div
class=
"author"
><a
href=
"
{
$item
->
author
->
profileurl
}
"
class=
"username"
>
{
$item
->
author
|
display_name
}
</a><span
class=
"postedon"
>
-
{
$item
->
date
}
{
if
$item
->
updated
}
[
{
str
tag
=
Updated
}
:
{
$item
->
updated
}
]
{/
if
}
</span></div>
{
else
}
...
...
@@ -63,7 +65,7 @@
<div
class=
"cb"
></div>
</div>
{/
foreach
}
{
if
$position
==
'blockinstance'
}
{
if
$position
==
'blockinstance'
&&
!
$onview
}
</td>
</tr>
{/
if
}
\ No newline at end of file
Write
Preview
Supports
Markdown
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