From c5eb1955637818a082d4231c95f0b574a39204ef Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Sun, 11 Sep 2011 11:21:36 -0400 Subject: Fixes #3771. Added missing files for embed support. Added requirement for file in embed's manifest. --- mod/file/views/default/embed/file/content.php | 61 ++++++++++++++++++++++ .../views/default/embed/file_upload/content.php | 15 ++++++ 2 files changed, 76 insertions(+) create mode 100644 mod/file/views/default/embed/file/content.php create mode 100644 mod/file/views/default/embed/file_upload/content.php (limited to 'mod/file/views/default/embed') diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php new file mode 100644 index 000000000..865a158a7 --- /dev/null +++ b/mod/file/views/default/embed/file/content.php @@ -0,0 +1,61 @@ + elgg_get_logged_in_user_guid(), + 'type_subtype_pair' => array('object' => 'file'), + 'count' => true +); + +$count = elgg_get_entities($options); + +if ($count) { + echo "
"; + + 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 = "getIconURL($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); + + $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 "
getGUID()}\">" . elgg_view_image_block($item_icon, $list_body) . '
'; + echo ""; + } + + echo '
'; +} \ 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 new file mode 100644 index 000000000..13c18f745 --- /dev/null +++ b/mod/file/views/default/embed/file_upload/content.php @@ -0,0 +1,15 @@ + 'multipart/form-data', + 'class' => 'elgg-form', +); +$upload_content = elgg_view_form('file/upload', $form_vars); + +echo "
" . elgg_echo('embed:upload_type') . "$input
"; +echo "
"; +echo $upload_content; +echo "
"; \ No newline at end of file -- cgit v1.2.3 From cc23bbddb8f2367f33e6291b13354c4cd98cd97b Mon Sep 17 00:00:00 2001 From: cash Date: Thu, 22 Sep 2011 21:55:25 -0400 Subject: Fixes #3795 not inserting the file title when embeding a file and tweaked css - thanks to slyhne --- mod/embed/views/default/embed/css.php | 2 +- mod/file/views/default/embed/file/content.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/file/views/default/embed') diff --git a/mod/embed/views/default/embed/css.php b/mod/embed/views/default/embed/css.php index 150dc8733..5750c05c0 100644 --- a/mod/embed/views/default/embed/css.php +++ b/mod/embed/views/default/embed/css.php @@ -8,7 +8,7 @@ .embed-wrapper { width: 730px; min-height: 400px; - margin: 5px; + margin: 10px; } .embed-wrapper h2 { color: #333333; diff --git a/mod/file/views/default/embed/file/content.php b/mod/file/views/default/embed/file/content.php index 865a158a7..eadcd1a6d 100644 --- a/mod/file/views/default/embed/file/content.php +++ b/mod/file/views/default/embed/file/content.php @@ -31,7 +31,7 @@ if ($count) { $subtitle = "$author_text $date"; - $icon = "getIconURL($icon_size)}\" />" . htmlentities($title, ENT_QUOTES, 'UTF-8'); + $icon = "getIconURL($icon_size)}\" />"; $embed_code = elgg_view('output/url', array( 'href' => $item->getURL(), -- cgit v1.2.3