aboutsummaryrefslogtreecommitdiff
path: root/mod/embed/views/default/object
diff options
context:
space:
mode:
Diffstat (limited to 'mod/embed/views/default/object')
-rw-r--r--mod/embed/views/default/object/default/embed.php9
-rw-r--r--mod/embed/views/default/object/file/embed.php17
-rw-r--r--mod/embed/views/default/object/file/embedlist.php20
3 files changed, 46 insertions, 0 deletions
diff --git a/mod/embed/views/default/object/default/embed.php b/mod/embed/views/default/object/default/embed.php
new file mode 100644
index 000000000..c97dbd48a
--- /dev/null
+++ b/mod/embed/views/default/object/default/embed.php
@@ -0,0 +1,9 @@
+<?php
+
+ if ($vars['entity'] instanceof ElggObject) {
+
+ echo '<a href="'. $vars['entity']->getURL() .'">' . $vars['entity']->title . '</a>';
+
+ }
+
+?> \ No newline at end of file
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
diff --git a/mod/embed/views/default/object/file/embedlist.php b/mod/embed/views/default/object/file/embedlist.php
new file mode 100644
index 000000000..71e84f265
--- /dev/null
+++ b/mod/embed/views/default/object/file/embedlist.php
@@ -0,0 +1,20 @@
+<?php
+
+ $file = $vars['entity'];
+ $friendlytime = friendly_time($vars['entity']->time_created);
+
+ $info = "<p> <a href=\"{$file->getURL()}\">{$file->title}</a></p>";
+ $info .= "<p class=\"owner_timestamp\">{$friendlytime}";
+ $icon = "<a href=\"{$file->getURL()}\">" . elgg_view("file/icon", array("mimetype" => $file->mimetype, 'thumbnail' => $file->thumbnail, 'file_guid' => $file->guid, 'size' => 'small')) . "</a>";
+
+?>
+<div id="embedFile<?php echo $file->guid; ?>">
+ <div class="search_listing">
+ <div class="search_listing_icon">
+ <?php echo $icon; ?>
+ </div>
+ <div class="search_listing_info">
+ <?php echo $info; ?>
+ </div>
+ </div>
+</div>