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
ca3c2d92
Commit
ca3c2d92
authored
Nov 19, 2014
by
Robert Lyon
Committed by
Gerrit Code Review
Nov 19, 2014
Browse files
Merge "Adding comment display to HTML artefact (Bug #1037531)"
parents
d4e76db3
66a0a7ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/blocktype/html/lib.php
View file @
ca3c2d92
...
...
@@ -30,17 +30,29 @@ class PluginBlocktypeHtml extends PluginBlocktype {
$configdata
[
'viewid'
]
=
$instance
->
get
(
'view'
);
$result
=
''
;
if
(
isset
(
$configdata
[
'artefactid'
]))
{
$html
=
$instance
->
get_artefact_instance
(
$configdata
[
'artefactid'
]);
$artefactid
=
isset
(
$configdata
[
'artefactid'
])
?
$configdata
[
'artefactid'
]
:
null
;
if
(
$artefactid
)
{
$artefact
=
$instance
->
get_artefact_instance
(
$artefactid
);
if
(
!
file_exists
(
$
html
->
get_path
()))
{
if
(
!
file_exists
(
$
artefact
->
get_path
()))
{
return
;
}
$result
=
clean_html
(
file_get_contents
(
$html
->
get_path
()));
}
$result
=
clean_html
(
file_get_contents
(
$artefact
->
get_path
()));
require_once
(
get_config
(
'docroot'
)
.
'artefact/comment/lib.php'
);
require_once
(
get_config
(
'docroot'
)
.
'lib/view.php'
);
$view
=
new
View
(
$configdata
[
'viewid'
]);
list
(
$commentcount
,
$comments
)
=
ArtefactTypeComment
::
get_artefact_comments_for_view
(
$artefact
,
$view
,
$instance
->
get
(
'id'
));
}
return
$result
;
$smarty
=
smarty_core
();
if
(
$artefactid
)
{
$smarty
->
assign
(
'commentcount'
,
$commentcount
);
$smarty
->
assign
(
'comments'
,
$comments
);
}
$smarty
->
assign
(
'html'
,
$result
);
return
$smarty
->
fetch
(
'blocktype:html:html.tpl'
);
}
public
static
function
has_instance_config
()
{
...
...
htdocs/artefact/file/blocktype/html/theme/raw/html.tpl
0 → 100644
View file @
ca3c2d92
{
$html
|
safe
}
{
if
$commentcount
||
$commentcount
===
0
}
{
$comments
|
safe
}
{/
if
}
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