aboutsummaryrefslogtreecommitdiff
path: root/mod/riverdashboard
diff options
context:
space:
mode:
authordave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 10:30:09 +0000
committerdave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-02-19 10:30:09 +0000
commit062bc6a5d2b2f9e43a2dab7a3e55905f35f77c3e (patch)
tree1b5a62e216830a1bad8be27bf3c46d0227eb5b3b /mod/riverdashboard
parent7d1068e16407d7bf877a95d15d13d678f9ccedeb (diff)
downloadelgg-062bc6a5d2b2f9e43a2dab7a3e55905f35f77c3e.tar.gz
elgg-062bc6a5d2b2f9e43a2dab7a3e55905f35f77c3e.tar.bz2
new river widget
git-svn-id: https://code.elgg.org/elgg/trunk@2802 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/riverdashboard')
-rw-r--r--mod/riverdashboard/languages/en.php10
-rw-r--r--mod/riverdashboard/start.php2
-rw-r--r--mod/riverdashboard/views/default/river/sitemessage/create.php15
-rw-r--r--mod/riverdashboard/views/default/widgets/river_widget/edit.php28
-rw-r--r--mod/riverdashboard/views/default/widgets/river_widget/view.php40
5 files changed, 94 insertions, 1 deletions
diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php
index 9bf31018f..21b418719 100644
--- a/mod/riverdashboard/languages/en.php
+++ b/mod/riverdashboard/languages/en.php
@@ -15,6 +15,16 @@
'sitemessages:river:create' => "posted a new site wide message",
'sitemessages:add' => "add message",
'sitemessage:deleted' => "site message deleted",
+
+ 'river:widget:noactivity' => 'We could not find any activity.',
+ 'river:widget:title' => "Activity",
+ 'river:widget:description' => "Show your latest activity.",
+ 'river:widget:title:friends' => "Friends' activity",
+ 'river:widget:description:friends' => "Show what your friends are up to.",
+ 'river:widgets:friends' => "Friends",
+ 'river:widgets:mine' => "Mine",
+ 'river:widget:label:displaynum' => "Number of entries to display:",
+ 'river:widget:type' => "Which river would you like to display? One that shows your activity or one that shows your friends activity?",
);
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php
index 479e06855..bc318552b 100644
--- a/mod/riverdashboard/start.php
+++ b/mod/riverdashboard/start.php
@@ -16,7 +16,7 @@
//register_page_handler('dashboard','riverdashboard_dashboard');
-
+ add_widget_type('river_widget',elgg_echo('river:widget:title'), elgg_echo('river:widget:description'));
}
diff --git a/mod/riverdashboard/views/default/river/sitemessage/create.php b/mod/riverdashboard/views/default/river/sitemessage/create.php
new file mode 100644
index 000000000..1eaccdfb8
--- /dev/null
+++ b/mod/riverdashboard/views/default/river/sitemessage/create.php
@@ -0,0 +1,15 @@
+<?php
+
+ $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
+ $object = get_entity($vars['item']->object_guid);
+ $url = $object->getURL();
+
+ $url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
+ $string = sprintf(elgg_echo("sitemessages:river:created"),$url) . " ";
+ $string .= elgg_echo("sitemessages:river:create") . ": " . $object->description;
+
+?>
+
+<?php
+ echo $string;
+?> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/widgets/river_widget/edit.php b/mod/riverdashboard/views/default/widgets/river_widget/edit.php
new file mode 100644
index 000000000..8a18a1036
--- /dev/null
+++ b/mod/riverdashboard/views/default/widgets/river_widget/edit.php
@@ -0,0 +1,28 @@
+<?php
+ /**
+ * Edit the widget
+ *
+ * @package ElggRiver
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+?>
+<p>
+ <?php echo elgg_echo('river:widget:label:displaynum'); ?>
+
+ <select name="params[num_display]">
+ <option value="5" <?php if ($vars['entity']->num_display == 5) echo " selected=\"yes\" "; ?>>5</option>
+ <option value="8" <?php if (($vars['entity']->num_display == 8)) echo " selected=\"yes\" "; ?>>8</option>
+ <option value="12" <?php if ($vars['entity']->num_display == 12) echo " selected=\"yes\" "; ?>>12</option>
+ <option value="15" <?php if ($vars['entity']->num_display == 15) echo " selected=\"yes\" "; ?>>15</option>
+ </select>
+
+ <?php echo elgg_echo('river:widget:type'); ?>
+
+ <select name="params[content_type]">
+ <option value="mine" <?php if ($vars['entity']->content_type == 'mine') echo " selected=\"yes\" "; ?>><?php echo elgg_echo("river:widgets:mine");?></option>
+ <option value="friends" <?php if (($vars['entity']->content_type != 'mine')) echo " selected=\"yes\" "; ?>><?php echo elgg_echo("river:widgets:friends");?></option>
+ </select>
+</p> \ No newline at end of file
diff --git a/mod/riverdashboard/views/default/widgets/river_widget/view.php b/mod/riverdashboard/views/default/widgets/river_widget/view.php
new file mode 100644
index 000000000..375ba16d2
--- /dev/null
+++ b/mod/riverdashboard/views/default/widgets/river_widget/view.php
@@ -0,0 +1,40 @@
+<?php
+ /**
+ * View the widget
+ *
+ * @package ElggRiver
+ * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2
+ * @author Curverider Ltd
+ * @copyright Curverider Ltd 2008-2009
+ * @link http://elgg.com/
+ */
+
+ $owner = page_owner_entity();
+
+ //get the type - mine or friends
+ $type = $vars['entity']->content_type;
+ if(!$type)
+ $type = "mine";
+
+ //based on type grab the correct content type
+ if($type == "mine")
+ $content_type = '';
+ else
+ $content_type = 'friend';
+
+ //get the number of items to display
+ $limit = $vars['entity']->num_display;
+ if(!$limit)
+ $limit = 4;
+
+ //grab the river
+ $river = elgg_view_river_items($owner->getGuid(), 0, $content_type, $content[0], $content[1], '', $limit);
+
+ //display
+ echo "<div class=\"contentWrapper\">";
+ if($type != 'mine')
+ echo "<h3>" . elgg_echo("Friends") . "</h3>";
+ echo $river;
+ echo "</div>";
+
+?> \ No newline at end of file