diff options
-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> |