diff options
author | cash <cash.costello@gmail.com> | 2011-10-01 16:54:24 -0400 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2011-10-01 16:54:24 -0400 |
commit | bc292c96ac6b118bd7a99509fce1c11bb232aeb2 (patch) | |
tree | 0afc4522e91621f293df55250b77875ea3aecbb1 /mod/file/views/default/embed | |
parent | 418078a8d4c157c1c88d196d3b24ff0f0893b764 (diff) | |
download | elgg-bc292c96ac6b118bd7a99509fce1c11bb232aeb2.tar.gz elgg-bc292c96ac6b118bd7a99509fce1c11bb232aeb2.tar.bz2 |
fixed the forwarding of an embed upload form
Diffstat (limited to 'mod/file/views/default/embed')
-rw-r--r-- | mod/file/views/default/embed/file/content.php | 61 | ||||
-rw-r--r-- | mod/file/views/default/embed/file_upload/content.php | 9 |
2 files changed, 7 insertions, 63 deletions
diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php deleted file mode 100644 index eadcd1a6d..000000000 --- a/mod/file/views/default/embed/file/content.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -/** - * List files available for upload - */ - -$active_section = elgg_extract('active_section', $vars); - -$options = array( - 'owner_guid' => elgg_get_logged_in_user_guid(), - 'type_subtype_pair' => array('object' => 'file'), - 'count' => true -); - -$count = elgg_get_entities($options); - -if ($count) { - echo "<div class='embed_modal_$active_section'>"; - - unset($options['count']); - $items = elgg_get_entities($options); - - foreach ($items as $item) { - - // different entity types have different title attribute names. - $title = isset($item->name) ? $item->name : $item->title; - // don't let it be too long - $title = elgg_get_excerpt($title); - - $author_text = elgg_echo('byline', array($owner->name)); - $date = elgg_view_friendly_time($item->time_created); - - $subtitle = "$author_text $date"; - - $icon = "<img src=\"{$item->getIconURL($icon_size)}\" />"; - - $embed_code = elgg_view('output/url', array( - 'href' => $item->getURL(), - 'title' => $title, - 'text' => $icon, - 'encode_text' => FALSE - )); - - $item_icon = elgg_view_entity_icon($item, $icon_size); - - $params = array( - 'title' => $title, - 'entity' => $item, - 'subtitle' => $subtitle, - 'tags' => FALSE, - ); - $list_body = elgg_view('object/elements/summary', $params); - - // @todo JS 1.8: is this approach better than inline js? - echo "<div class=\"embed_data\" id=\"embed_{$item->getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '</div>'; - echo "<script type=\"text/javascript\"> - $('#embed_{$item->getGUID()}').data('embed_code', " . json_encode($embed_code) . "); - </script>"; - } - - echo '</div>'; -}
\ No newline at end of file diff --git a/mod/file/views/default/embed/file_upload/content.php b/mod/file/views/default/embed/file_upload/content.php index 13c18f745..a530b3194 100644 --- a/mod/file/views/default/embed/file_upload/content.php +++ b/mod/file/views/default/embed/file_upload/content.php @@ -9,7 +9,12 @@ $form_vars = array( ); $upload_content = elgg_view_form('file/upload', $form_vars); -echo "<div class='mbm'>" . elgg_echo('embed:upload_type') . "$input</div>"; echo "<div class='embed-upload'>"; echo $upload_content; -echo "</div>";
\ No newline at end of file +echo "</div>"; + +// 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 |