aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/object/file/embed.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/embed/views/default/object/file/embed.php')
-rw-r--r--mod/embed/views/default/object/file/embed.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/mod/embed/views/default/object/file/embed.php b/mod/embed/views/default/object/file/embed.php
new file mode 100644
index 000000000..01f3904ac
--- /dev/null
+++ b/mod/embed/views/default/object/file/embed.php
@@ -0,0 +1,17 @@
+<?php
+
+ $mime = $vars['entity']->mimetype;
+
+ if (elgg_view_exists('file/specialcontent/' . $mime)) {
+ $content = elgg_view('file/specialcontent/' . $mime, $vars);
+ } else if (elgg_view_exists("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default")) {
+ $content = elgg_view("file/specialcontent/" . substr($mime,0,strpos($mime,'/')) . "/default", $vars);
+ }
+
+ if (empty($content) || substr_count(strtolower($content),'<embed') || substr_count(strtolower($content),'<object') || substr_count(strtolower($content),'<script')) {
+ echo elgg_view('object/default/embed',$vars);
+ } else {
+ echo $content;
+ }
+
+?> \ No newline at end of file