From c32f43bcac8ff4493ce387b078a57ba4fdd57063 Mon Sep 17 00:00:00 2001 From: brettp Date: Fri, 16 Apr 2010 15:25:18 +0000 Subject: Added activity ecml keyword. git-svn-id: http://code.elgg.org/elgg/trunk@5774 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/riverdashboard/languages/en.php | 16 ++++++---- mod/riverdashboard/start.php | 35 +++++++++++++++++++--- .../views/default/riverdashboard/ecml/activity.php | 29 ++++++++++++++++++ 3 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 mod/riverdashboard/views/default/riverdashboard/ecml/activity.php (limited to 'mod/riverdashboard') diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php index 864a8d7a9..1a3c96f2b 100644 --- a/mod/riverdashboard/languages/en.php +++ b/mod/riverdashboard/languages/en.php @@ -5,10 +5,10 @@ $english = array( 'riverdashboard:useasdashboard' => "Replace the default dashboard with this activity river?", 'activity' => 'Activity', 'riverdashboard:recentmembers' => 'Recent members', - - /** - * Site messages - **/ + + /** + * Site messages + **/ 'sitemessages:announcements' => "Site announcements", 'sitemessages:posted' => "Posted", @@ -16,7 +16,7 @@ $english = array( 'sitemessages:river:create' => "posted a new site wide message", 'sitemessages:add' => "Add a site-wide message to the river page", 'sitemessage:deleted' => "Site message deleted", - + 'river:widget:noactivity' => 'We could not find any activity.', 'river:widget:title' => "Activity", 'river:all' => "All activity", @@ -35,6 +35,10 @@ $english = array( 'riverdashboard:avataricon' => "Would you like to use user avatars or icons on your site activity stream?", 'option:icon' => 'Icons', 'option:avatar' => 'Avatars', + + // ecml + 'riverdashboard:ecml:desc:activity' => 'Recent Activity', + 'riverdashboard:ecml:desc:usage' => '[activity user=username limit=limit type=type subtype=subtype]' ); - + add_translation("en",$english); \ No newline at end of file diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php index 1377afc37..c57d88d80 100644 --- a/mod/riverdashboard/start.php +++ b/mod/riverdashboard/start.php @@ -1,6 +1,8 @@ wwwroot . "mod/riverdashboard/"); - } + } // Page handler register_page_handler('riverdashboard','riverdashboard_page_handler'); elgg_extend_view('css','riverdashboard/css'); + + // add an activity stream ECML keyword + // we'll restrict it to use in sitepages's custom_frontpage + register_plugin_hook('get_keywords', 'ecml', 'riverdashboard_ecml_keywords_hook'); } - + /** * Page handler for riverdash * @@ -27,7 +33,7 @@ function riverdashboard_page_handler($page){ include(dirname(__FILE__) . "/index.php"); return true; } - + function riverdashboard_dashboard() { include(dirname(__FILE__) . '/index.php'); } @@ -48,4 +54,25 @@ function elgg_make_river_comment($entity){ } } -register_elgg_event_handler('init','system','riverdashboard_init'); + +/** + * Register activity keyword. + * + * @param unknown_type $hook + * @param unknown_type $type + * @param unknown_type $value + * @param unknown_type $params + * @return unknown_type + */ +function riverdashboard_ecml_keywords_hook($hook, $type, $value, $params) { + $value['activity'] = array( + 'view' => "riverdashboard/ecml/activity", + 'description' => elgg_echo('riverdashboard:ecml:desc:activity'), + 'usage' => elgg_echo('riverdashboard:ecml:usage:activity'), + 'restricted' => array('sitepages/custom_frontpage') + ); + + return $value; +} + +register_elgg_event_handler('init', 'system', 'riverdashboard_init'); \ No newline at end of file diff --git a/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php b/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php new file mode 100644 index 000000000..87c048ea5 --- /dev/null +++ b/mod/riverdashboard/views/default/riverdashboard/ecml/activity.php @@ -0,0 +1,29 @@ +getGUID(); + } +} + +$river = elgg_view_river_items($user, NULL, NULL, $type, $subtype, '', $limit, 0, 0, true, false) . ""; + +// Replacing callback calls in the nav with something meaningless +$river = str_replace('callback=true','replaced=88,334',$river); + +echo $river; \ No newline at end of file -- cgit v1.2.3