diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 14:22:01 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-24 14:22:01 +0000 |
commit | e744bf84bf766c720c92ff64ce5381de531db722 (patch) | |
tree | 0179c1a385c5f97250297be99e75507399915279 /mod | |
parent | f23e0746255a5f3845f8e8c8082b8c660c2ba934 (diff) | |
download | elgg-e744bf84bf766c720c92ff64ce5381de531db722.tar.gz elgg-e744bf84bf766c720c92ff64ce5381de531db722.tar.bz2 |
you can now replace the default dashboard with the new activity river, if required.
git-svn-id: https://code.elgg.org/elgg/trunk@2921 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod')
-rw-r--r-- | mod/riverdashboard/languages/en.php | 1 | ||||
-rw-r--r-- | mod/riverdashboard/start.php | 28 | ||||
-rw-r--r-- | mod/riverdashboard/views/default/settings/riverdashboard/edit.php | 11 |
3 files changed, 39 insertions, 1 deletions
diff --git a/mod/riverdashboard/languages/en.php b/mod/riverdashboard/languages/en.php index 21b418719..a5226d6b9 100644 --- a/mod/riverdashboard/languages/en.php +++ b/mod/riverdashboard/languages/en.php @@ -4,6 +4,7 @@ 'mine' => 'Mine',
'filter' => 'Filter',
+ 'riverdashboard:useasdashboard' => "Replace the default dashboard with this activity river?",
/**
* Site messages
diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php index bc318552b..5da7f3122 100644 --- a/mod/riverdashboard/start.php +++ b/mod/riverdashboard/start.php @@ -12,14 +12,40 @@ function riverdashboard_init() {
+ global $CONFIG;
+
+ // Register and optionally replace the dashboard
+ if (get_plugin_setting('useasdashboard', 'riverdashboard') == 'yes')
+ register_page_handler('dashboard','riverdashboard_page_handler');
+
+ // Page handler
+ register_page_handler('riverdashboard','riverdashboard_page_handler');
+
extend_view('css','riverdashboard/css');
- //register_page_handler('dashboard','riverdashboard_dashboard');
+ // Activity main menu
+ if (isloggedin())
+ {
+ add_menu(elgg_echo('Activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
+ }
add_widget_type('river_widget',elgg_echo('river:widget:title'), elgg_echo('river:widget:description'));
}
+ /**
+ * Page handler for riverdash
+ *
+ * @param unknown_type $page
+ */
+ function riverdashboard_page_handler($page)
+ {
+ global $CONFIG;
+
+ @include(dirname(__FILE__) . "/index.php");
+ return true;
+ }
+
function riverdashboard_dashboard() {
include(dirname(__FILE__) . '/index.php');
diff --git a/mod/riverdashboard/views/default/settings/riverdashboard/edit.php b/mod/riverdashboard/views/default/settings/riverdashboard/edit.php new file mode 100644 index 000000000..0cf677fb1 --- /dev/null +++ b/mod/riverdashboard/views/default/settings/riverdashboard/edit.php @@ -0,0 +1,11 @@ +<?php +?> +<p> + <?php echo elgg_echo('riverdashboard:useasdashboard'); ?> + + <select name="params[useasdashboard]"> + <option value="yes" <?php if ($vars['entity']->useasdashboard == 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:yes'); ?></option> + <option value="no" <?php if ($vars['entity']->useasdashboard != 'yes') echo " selected=\"yes\" "; ?>><?php echo elgg_echo('option:no'); ?></option> + </select> + +</p> |