diff options
Diffstat (limited to 'mod/file/views')
-rw-r--r-- | mod/file/views/default/embed/file_upload/content.php | 16 | ||||
-rw-r--r-- | mod/file/views/default/icon/object/file.php | 15 |
2 files changed, 26 insertions, 5 deletions
diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php new file mode 100644 index 000000000..4d3db0d97 --- /dev/null +++ b/mod/file/views/default/embed/file_upload/content.php @@ -0,0 +1,16 @@ +<?php +/** + * Upload a file through the embed interface + */ + +$form_vars = array( + 'enctype' => 'multipart/form-data', + 'class' => 'elgg-form-embed', +); +echo elgg_view_form('file/upload', $form_vars); + +// the tab we want to be forwarded to after upload is complete +echo elgg_view('input/hidden', array( + 'name' => 'embed_forward', + 'value' => 'file', +));
\ No newline at end of file diff --git a/mod/file/views/default/icon/object/file.php b/mod/file/views/default/icon/object/file.php index 6357d418f..7feba7af3 100644 --- a/mod/file/views/default/icon/object/file.php +++ b/mod/file/views/default/icon/object/file.php @@ -2,9 +2,10 @@ /** * File icon view * - * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method - * @uses $vars['size'] topbar, tiny, small, medium (default), large, master - * @uses $vars['href'] Optional override for link + * @uses $vars['entity'] The entity the icon represents - uses getIconURL() method + * @uses $vars['size'] topbar, tiny, small, medium (default), large, master + * @uses $vars['href'] Optional override for link + * @uses $vars['link_class'] Optional CSS class added to img */ $entity = $vars['entity']; @@ -32,10 +33,14 @@ $img_src = elgg_format_url($img_src); $img = "<img $class src=\"$img_src\" alt=\"$title\" />"; if ($url) { - echo elgg_view('output/url', array( + $params = array( 'href' => $url, 'text' => $img, - )); + ); + if (isset($vars['link_class'])) { + $params['class'] = $vars['link_class']; + } + echo elgg_view('output/url', $params); } else { echo $img; } |