diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 22:12:56 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-06 22:12:56 +0000 |
commit | ae6e0093ba62cc6e69f6aa41d4f163de52747418 (patch) | |
tree | 5552c8037d85ec8a0ede1c6a490097a26ee9be24 /mod/file/views/default | |
parent | 125dcdd329b3159808c097f02597e908be3ad8d0 (diff) | |
download | elgg-ae6e0093ba62cc6e69f6aa41d4f163de52747418.tar.gz elgg-ae6e0093ba62cc6e69f6aa41d4f163de52747418.tar.bz2 |
updated the file plugin to use the new icon structure
git-svn-id: http://code.elgg.org/elgg/trunk@8051 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/file/views/default')
24 files changed, 2 insertions, 208 deletions
diff --git a/mod/file/views/default/file/icon.php b/mod/file/views/default/file/icon.php deleted file mode 100644 index 391afd0c8..000000000 --- a/mod/file/views/default/file/icon.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -/** - * Elgg file icons. - * Displays an icon, depending on its mime type, for a file. - * Optionally you can specify a size. - * - * @package ElggFile - * - * @uses $vars['size'] - * @uses $vars['mimetype'] - * @uses $vars['thumbnail'] - * @uses $vars['file_guid'] - */ - -$mime = $vars['mimetype']; -$simple_type = file_get_simple_type($mime); - -// is this request for an image thumbnail -$thumbnail = elgg_get_array_value('thumbnail', $vars, false); - -// default size is small for thumbnails -$size = elgg_get_array_value('size', $vars, 'small'); - -if ($simple_type == 'image' && $thumbnail) { - $icon = "<img src=\"" . elgg_get_site_url() . "mod/file/thumbnail.php?file_guid={$vars['file_guid']}&size={$size}\" />"; -} else { - $base_type = substr($mime, 0, strpos($mime, '/')); - if ($mime && elgg_view_exists("file/icon/$mime")) { - $icon = elgg_view("file/icon/{$mime}", $vars); - } else if ($mime && elgg_view_exists("file/icon/$base_type/default")) { - $icon = elgg_view("file/icon/$base_type/default", $vars); - } else { - $icon = elgg_view('file/icon/default', $vars); - } -} - -echo $icon; diff --git a/mod/file/views/default/file/icon/application/default.php b/mod/file/views/default/file/icon/application/default.php deleted file mode 100644 index 6a7c7e13c..000000000 --- a/mod/file/views/default/file/icon/application/default.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Default application icon - */ - -$vars['type'] = 'application'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/excel.php b/mod/file/views/default/file/icon/application/excel.php deleted file mode 100644 index f5cfffb54..000000000 --- a/mod/file/views/default/file/icon/application/excel.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Excel icon - */ - -$vars['type'] = 'excel'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/msword.php b/mod/file/views/default/file/icon/application/msword.php deleted file mode 100644 index edb7b3694..000000000 --- a/mod/file/views/default/file/icon/application/msword.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Word icon - */ - -$vars['type'] = 'word'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/pdf.php b/mod/file/views/default/file/icon/application/pdf.php deleted file mode 100644 index 2b32c5825..000000000 --- a/mod/file/views/default/file/icon/application/pdf.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * PDF icon - */ - -$vars['type'] = 'pdf'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/powerpoint.php b/mod/file/views/default/file/icon/application/powerpoint.php deleted file mode 100644 index fba3af016..000000000 --- a/mod/file/views/default/file/icon/application/powerpoint.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Powerpoint icon - */ - -$vars['type'] = 'ppt'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.ms-excel.php b/mod/file/views/default/file/icon/application/vnd.ms-excel.php deleted file mode 100644 index fe5b22ff0..000000000 --- a/mod/file/views/default/file/icon/application/vnd.ms-excel.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Excel icon - */ - -echo elgg_view('file/icon/application/excel', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php b/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php deleted file mode 100644 index d6425be90..000000000 --- a/mod/file/views/default/file/icon/application/vnd.ms-powerpoint.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Powerpoint icon - */ - -echo elgg_view('file/icon/application/powerpoint', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php b/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php deleted file mode 100644 index 82199922d..000000000 --- a/mod/file/views/default/file/icon/application/vnd.oasis.opendocument.text.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Open Office icon - */ - -$vars['type'] = 'openoffice'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/application/x-gzip.php b/mod/file/views/default/file/icon/application/x-gzip.php deleted file mode 100644 index f90d28376..000000000 --- a/mod/file/views/default/file/icon/application/x-gzip.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * GZip icon - */ - -echo elgg_view('file/icon/archive', $vars); diff --git a/mod/file/views/default/file/icon/application/x-rar-compressed.php b/mod/file/views/default/file/icon/application/x-rar-compressed.php deleted file mode 100644 index 3cc09b6d9..000000000 --- a/mod/file/views/default/file/icon/application/x-rar-compressed.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Rar icon - */ - -echo elgg_view('file/icon/archive', $vars); diff --git a/mod/file/views/default/file/icon/application/x-stuffit.php b/mod/file/views/default/file/icon/application/x-stuffit.php deleted file mode 100644 index 7491e77a9..000000000 --- a/mod/file/views/default/file/icon/application/x-stuffit.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Stuffit icon - */ - -echo elgg_view('file/icon/archive', $vars); diff --git a/mod/file/views/default/file/icon/application/zip.php b/mod/file/views/default/file/icon/application/zip.php deleted file mode 100644 index c0bb01a47..000000000 --- a/mod/file/views/default/file/icon/application/zip.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Zip icon - */ - -echo elgg_view('file/icon/archive', $vars); diff --git a/mod/file/views/default/file/icon/archive.php b/mod/file/views/default/file/icon/archive.php deleted file mode 100644 index 552f7f218..000000000 --- a/mod/file/views/default/file/icon/archive.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Archive icon - */ - -$vars['type'] = 'archive'; - -echo elgg_view('file/icon/default', $vars); diff --git a/mod/file/views/default/file/icon/audio.php b/mod/file/views/default/file/icon/audio.php deleted file mode 100644 index 9a42be9ac..000000000 --- a/mod/file/views/default/file/icon/audio.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Audio icon - */ - -$vars['type'] = 'music'; - -echo elgg_view('file/icon/default', $vars); diff --git a/mod/file/views/default/file/icon/audio/default.php b/mod/file/views/default/file/icon/audio/default.php deleted file mode 100644 index 60e03b6c4..000000000 --- a/mod/file/views/default/file/icon/audio/default.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Audio default icon - */ - -echo elgg_view('file/icon/audio', $vars); diff --git a/mod/file/views/default/file/icon/default.php b/mod/file/views/default/file/icon/default.php deleted file mode 100644 index c4fc8e2a7..000000000 --- a/mod/file/views/default/file/icon/default.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php -/** - * Default file icon - */ - -$type = elgg_get_array_value('type', $vars, 'general'); - -$size = elgg_get_array_value('size', $vars, ''); -if ($size == 'large') { - $ext = '_lrg'; -} else { - $ext = ''; -} - -$src = elgg_get_site_url() . "mod/file/graphics/icons/{$type}{$ext}.gif"; -echo "<img src=\"$src\" />"; diff --git a/mod/file/views/default/file/icon/document.php b/mod/file/views/default/file/icon/document.php deleted file mode 100644 index 55a71394e..000000000 --- a/mod/file/views/default/file/icon/document.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Document icon - */ - -$vars['type'] = 'text'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/text/default.php b/mod/file/views/default/file/icon/text/default.php deleted file mode 100644 index f6b42b587..000000000 --- a/mod/file/views/default/file/icon/text/default.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Document default icon - */ - -echo elgg_view('file/icon/document', $vars); diff --git a/mod/file/views/default/file/icon/text/directory.php b/mod/file/views/default/file/icon/text/directory.php deleted file mode 100644 index f221100cd..000000000 --- a/mod/file/views/default/file/icon/text/directory.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Directory default icon - */ - -$vars['type'] = 'vcard'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/text/v-card.php b/mod/file/views/default/file/icon/text/v-card.php deleted file mode 100644 index 3554f37c1..000000000 --- a/mod/file/views/default/file/icon/text/v-card.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * V-card icon - */ - -echo elgg_view('file/icon/text/directory', $vars); diff --git a/mod/file/views/default/file/icon/video.php b/mod/file/views/default/file/icon/video.php deleted file mode 100644 index ff6b7e68f..000000000 --- a/mod/file/views/default/file/icon/video.php +++ /dev/null @@ -1,8 +0,0 @@ -<?php -/** - * Video icon - */ - -$vars['type'] = 'video'; - -echo elgg_view('file/icon/default', $vars);
\ No newline at end of file diff --git a/mod/file/views/default/file/icon/video/default.php b/mod/file/views/default/file/icon/video/default.php deleted file mode 100644 index a33940ebf..000000000 --- a/mod/file/views/default/file/icon/video/default.php +++ /dev/null @@ -1,6 +0,0 @@ -<?php -/** - * Video default icon - */ - -echo elgg_view('file/icon/video', $vars); diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php index 5fcd2a023..cbe19f3c6 100644 --- a/mod/file/views/default/object/file.php +++ b/mod/file/views/default/object/file.php @@ -27,12 +27,7 @@ $owner_link = elgg_view('output/url', array( )); $author_text = elgg_echo('blog:author_by_line', array($owner_link)); -$file_icon = elgg_view('file/icon', array( - 'mimetype' => $mime, - 'thumbnail' => $file->thumbnail, - 'file_guid' => $file->guid, - 'size' => 'small' -)); +$file_icon = elgg_view_entity_icon($file, 'small'); $tags = elgg_view('output/tags', array('tags' => $file->tags)); $date = elgg_view_friendly_time($file->time_created); @@ -102,7 +97,7 @@ HTML; } elseif (elgg_in_context('gallery')) { echo '<div class="file-gallery-item">'; echo "<h3>" . $file->title . "</h3>"; - echo "<a href=\"{$file->getURL()}\"><img src=\"".elgg_get_site_url()."mod/file/thumbnail.php?size=medium&file_guid={$vars['entity']->getGUID()}\" /></a>"; + echo elgg_view_entity_icon($file, 'medium'); echo "<p class='subtitle'>$owner_link $date</p>"; echo '</div>'; } else { |