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
d4e76db3
Commit
d4e76db3
authored
Nov 19, 2014
by
Robert Lyon
Committed by
Gerrit Code Review
Nov 19, 2014
Browse files
Merge "Changing the image block to show hide comments (Bug #1037531)"
parents
1b10ff90
f95dc9b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/blocktype/image/lib.php
View file @
d4e76db3
...
...
@@ -49,8 +49,15 @@ class PluginBlocktypeImage extends PluginBlocktype {
if
(
!
empty
(
$configdata
[
'width'
]))
{
$src
.
=
'&maxwidth='
.
$configdata
[
'width'
];
}
$artefact
=
new
ArtefactTypeImage
(
$id
);
require_once
(
get_config
(
'docroot'
)
.
'artefact/comment/lib.php'
);
require_once
(
get_config
(
'docroot'
)
.
'lib/view.php'
);
$view
=
new
View
(
$viewid
);
list
(
$commentcount
,
$comments
)
=
ArtefactTypeComment
::
get_artefact_comments_for_view
(
$artefact
,
$view
,
$instance
->
get
(
'id'
));
$smarty
=
smarty_core
();
$smarty
->
assign
(
'commentcount'
,
$commentcount
);
$smarty
->
assign
(
'comments'
,
$comments
);
$smarty
->
assign
(
'url'
,
$wwwroot
.
'artefact/artefact.php?artefact='
.
$id
.
'&view='
.
$viewid
);
$smarty
->
assign
(
'src'
,
$src
);
$smarty
->
assign
(
'description'
,
$description
);
...
...
htdocs/theme/raw/artefact/file/blocktype/image/templates/image.tpl
View file @
d4e76db3
<div
class=
"center imageblock"
itemscope
itemtype=
"http://schema.org/ImageObject"
>
<div
class=
"image"
><a
href=
"
{
$url
}
"
><img
src=
"
{
$src
}
"
alt=
"
{
$description
}
"
itemprop=
"contentURL"
></a></div>
{
if
$showdescription
}
<div
class=
"detail"
itemprop=
"description"
>
{
$description
}
</div>
{/
if
}
{
if
$commentcount
||
$commentcount
===
0
}
{
$comments
|
safe
}
{/
if
}
</div>
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