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
4615ff7f
Commit
4615ff7f
authored
Jun 10, 2009
by
Richard Mansfield
Browse files
Display the correct image icons for attachments on the view blog page
parent
a1b44d82
Changes
3
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/blog/lib.php
View file @
4615ff7f
...
@@ -556,7 +556,9 @@ class ArtefactTypeBlogPost extends ArtefactType {
...
@@ -556,7 +556,9 @@ class ArtefactTypeBlogPost extends ArtefactType {
// Get the attached files.
// Get the attached files.
$files
=
ArtefactType
::
attachments_from_id_list
(
array_map
(
create_function
(
'$a'
,
'return $a->id;'
),
$result
));
$files
=
ArtefactType
::
attachments_from_id_list
(
array_map
(
create_function
(
'$a'
,
'return $a->id;'
),
$result
));
if
(
$files
)
{
if
(
$files
)
{
foreach
(
$files
as
$file
)
{
safe_require
(
'artefact'
,
'file'
);
foreach
(
$files
as
&
$file
)
{
$file
->
icon
=
call_static_method
(
generate_artefact_class_name
(
$file
->
artefacttype
),
'get_icon'
,
array
(
'id'
=>
$file
->
attachment
));
$result
[
$file
->
artefact
]
->
files
[]
=
$file
;
$result
[
$file
->
artefact
]
->
files
[]
=
$file
;
}
}
}
}
...
...
htdocs/artefact/blog/post.php
View file @
4615ff7f
...
@@ -328,10 +328,6 @@ $smarty = smarty(array(), array(), array(), array(
...
@@ -328,10 +328,6 @@ $smarty = smarty(array(), array(), array(), array(
'data'
=>
array
(),
'data'
=>
array
(),
),
),
),
),
'themepaths'
=>
array
(
'images/file.gif'
,
'images/image.gif'
),
));
));
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$javascript
);
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$javascript
);
$smarty
->
assign_by_ref
(
'form'
,
$form
);
$smarty
->
assign_by_ref
(
'form'
,
$form
);
...
...
htdocs/artefact/blog/view/index.js.php
View file @
4615ff7f
...
@@ -129,7 +129,7 @@ postlist.rowfunction = function(d, n, gd) {
...
@@ -129,7 +129,7 @@ postlist.rowfunction = function(d, n, gd) {
var filerows = [TR(null, TH({'colSpan':3}, {$enc_files}))];
var filerows = [TR(null, TH({'colSpan':3}, {$enc_files}))];
for (var i = 0; i < d.files.length; i++) {
for (var i = 0; i < d.files.length; i++) {
filerows.push(TR({'class':'r'+((i+1)%2)},
filerows.push(TR({'class':'r'+((i+1)%2)},
TD(null, IMG({'src':
get_themeurl('images/' + d.files[i].artefacttype + '.gif')
})),
TD(null, IMG({'src':
d.files[i].icon
})),
TD(null, A({'href':config.wwwroot+'artefact/file/download.php?file='+d.files[i].attachment},
TD(null, A({'href':config.wwwroot+'artefact/file/download.php?file='+d.files[i].attachment},
d.files[i].title)),
d.files[i].title)),
TD(null, d.files[i].description)));
TD(null, d.files[i].description)));
...
...
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