aboutsummaryrefslogtreecommitdiff
path: root/mod/logbrowser/views
diff options
context:
space:
mode:
authormarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-29 16:42:04 +0000
committermarcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-07-29 16:42:04 +0000
commitf93ce10e56f335cfe1678ea93ca971f77eb839e1 (patch)
treeff3c81a8643cfa093cf1f902b243282b31e03324 /mod/logbrowser/views
parentf4df8ab602cd8d9d2ead55999f312b2da6eea1e0 (diff)
downloadelgg-f93ce10e56f335cfe1678ea93ca971f77eb839e1.tar.gz
elgg-f93ce10e56f335cfe1678ea93ca971f77eb839e1.tar.bz2
Added basic log browser.
updateclient & logbrowser are switched on by default in new installs. git-svn-id: https://code.elgg.org/elgg/trunk@1579 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/logbrowser/views')
-rw-r--r--mod/logbrowser/views/default/logbrowser/gallery.php37
-rw-r--r--mod/logbrowser/views/default/logbrowser/icon.php29
-rw-r--r--mod/logbrowser/views/default/logbrowser/listing.php37
-rw-r--r--mod/logbrowser/views/default/object/logwrapper.php18
4 files changed, 121 insertions, 0 deletions
diff --git a/mod/logbrowser/views/default/logbrowser/gallery.php b/mod/logbrowser/views/default/logbrowser/gallery.php
new file mode 100644
index 000000000..1c8de10e6
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/gallery.php
@@ -0,0 +1,37 @@
+<?php
+ /**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $entry = $vars['entity']->entry;
+
+
+ $by = get_entity($entry->performed_by_guid);
+ $object = get_object_from_log_entry($entry->id);
+
+ if (is_callable(array($object, 'getURL')))
+ $obj_url = $object->getURL();
+
+ $icon = elgg_view(
+ "logbrowser/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+ )
+ );
+
+ $info .= "<p><b>";
+ if ($obj_url) $info .= "<a href=\"$obj_url\">";
+ $info .= "{$entry->object_class}";
+ if ($obj_url) $info .= "</a>";
+ $info .= " " . elgg_echo($entry->event) . "</b></p>";
+
+ $info .= "<div>" . elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> ".date('r', $entry->time_created )."</div>";
+
+ echo elgg_view_listing($icon, $info);
+?> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/icon.php b/mod/logbrowser/views/default/logbrowser/icon.php
new file mode 100644
index 000000000..233442f50
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/icon.php
@@ -0,0 +1,29 @@
+<?php
+ /**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+ $group = $vars['entity'];
+
+ // Get size
+ if (!in_array($vars['size'],array('small','medium','large','tiny','master','topbar')))
+ $vars['size'] = "medium";
+
+ // Get any align and js
+ if (!empty($vars['align'])) {
+ $align = " align=\"{$vars['align']}\" ";
+ } else {
+ $align = "";
+ }
+
+
+?>
+
+<div class="logbrowsericon">
+<img src="<?php echo $vars['url']; ?>mod/logbrowser/graphics/default<?php echo $vars['size']; ?>.jpg" border="0" <?php echo $align; ?> <?php echo $vars['js']; ?> />
+</div> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/logbrowser/listing.php b/mod/logbrowser/views/default/logbrowser/listing.php
new file mode 100644
index 000000000..1c8de10e6
--- /dev/null
+++ b/mod/logbrowser/views/default/logbrowser/listing.php
@@ -0,0 +1,37 @@
+<?php
+ /**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ $entry = $vars['entity']->entry;
+
+
+ $by = get_entity($entry->performed_by_guid);
+ $object = get_object_from_log_entry($entry->id);
+
+ if (is_callable(array($object, 'getURL')))
+ $obj_url = $object->getURL();
+
+ $icon = elgg_view(
+ "logbrowser/icon", array(
+ 'entity' => $vars['entity'],
+ 'size' => 'small',
+ )
+ );
+
+ $info .= "<p><b>";
+ if ($obj_url) $info .= "<a href=\"$obj_url\">";
+ $info .= "{$entry->object_class}";
+ if ($obj_url) $info .= "</a>";
+ $info .= " " . elgg_echo($entry->event) . "</b></p>";
+
+ $info .= "<div>" . elgg_echo('by') . " <a href=\"".$by->getURL()."\">{$by->name}</a> ".date('r', $entry->time_created )."</div>";
+
+ echo elgg_view_listing($icon, $info);
+?> \ No newline at end of file
diff --git a/mod/logbrowser/views/default/object/logwrapper.php b/mod/logbrowser/views/default/object/logwrapper.php
new file mode 100644
index 000000000..673d732e8
--- /dev/null
+++ b/mod/logbrowser/views/default/object/logwrapper.php
@@ -0,0 +1,18 @@
+<?php
+ /**
+ * Elgg log browser.
+ *
+ * @package ElggLogBrowser
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Marcus Povey
+ * @copyright Curverider Ltd 2008
+ * @link http://elgg.com/
+ */
+
+ if (get_input('search_viewtype') == "gallery") {
+ echo elgg_view('logbrowser/gallery',$vars);
+ } else {
+ echo elgg_view("logbrowser/listing",$vars);
+ }
+
+?> \ No newline at end of file