diff options
-rw-r--r-- | mod/blog/start.php | 30 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 56 | ||||
-rw-r--r-- | mod/file/start.php | 4 | ||||
-rw-r--r-- | mod/groups/start.php | 6 | ||||
-rw-r--r-- | mod/riverdashboard/start.php | 5 | ||||
-rw-r--r-- | mod/thewire/languages/en.php | 4 | ||||
-rw-r--r-- | mod/thewire/start.php | 6 |
7 files changed, 56 insertions, 55 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php index bf0d3fb56..0015efcf1 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -9,16 +9,12 @@ * @link http://elgg.org/ * * @todo - * - * Show all your drafts - * Show revision history - * * Show your blog posts * Show friends blog posts + * Widget * * Group blogs * Forward to container instead of owner - * GROUPS SUCK. * * Pingbacks * Notifications @@ -33,13 +29,12 @@ function blog_init() { global $CONFIG; require_once dirname(__FILE__) . '/blog_lib.php'; - // Set up menus add_menu(elgg_echo('blog'), "{$CONFIG->wwwroot}pg/blog/", array()); elgg_extend_view('css', 'blog/css'); + register_elgg_event_handler('pagesetup', 'system', 'blog_page_setup'); register_page_handler('blog', 'blog_page_handler'); - register_entity_url_handler('blog_url_handler', 'object', 'blog'); // notifications @@ -51,10 +46,11 @@ function blog_init() { //register_plugin_hook('pingback:object:subtypes', 'object', 'blog_pingback_subtypes'); // Register for search. - register_entity_type('object','blog'); + register_entity_type('object', 'blog'); - //add_group_tool_option('blog', elgg_echo('blog:enableblog'), true); - add_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), 'profile, dashboard'); + add_group_tool_option('blog', elgg_echo('blog:enableblog'), true); + + //add_widget_type('blog', elgg_echo('blog'), elgg_echo('blog:widget:description'), 'profile, dashboard'); $action_path = dirname(__FILE__) . '/actions/blog'; @@ -170,5 +166,19 @@ function blog_url_handler($entity) { return $url; } +/** + * Add menu items for groups + */ +function blog_page_setup() { + global $CONFIG; + $page_owner = page_owner_entity(); + + if ($page_owner instanceof ElggGroup && get_context() == 'groups') { + if($page_owner->blog_enable != "no") { + $url = "{$CONFIG->wwwroot}pg/blog/{$page_owner->username}/items"; + add_submenu_item(elgg_echo("blog:groups:group_blogs"), $url); + } + } +} register_elgg_event_handler('init', 'system', 'blog_init'); diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 128838f0d..3df44f724 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -15,9 +15,7 @@ function bookmarks_init() { global $CONFIG; //add a tools menu option - if (isloggedin()) { - add_menu(elgg_echo('bookmarks:yours'), $CONFIG->wwwroot . "pg/bookmarks/" . $_SESSION['user']->username . '/items'); - } + add_menu(elgg_echo('bookmarks'), $CONFIG->wwwroot . 'mod/bookmarks/all.php'); // Register a page handler, so we can have nice URLs register_page_handler('bookmarks', 'bookmarks_page_handler'); @@ -53,24 +51,24 @@ function bookmarks_init() { */ function bookmarks_pagesetup() { global $CONFIG; - + // Set up menu for logged in users // add submenu options - @todo partially removed - now provided by drop-down menu filter in content area if (get_context() == "bookmarks") { /* if (isloggedin()) { if (page_owner()) { - $page_owner = page_owner_entity(); + $page_owner = page_owner_entity(); add_submenu_item(elgg_echo('bookmarks:read'),$CONFIG->wwwroot."pg/bookmarks/" . $page_owner->username . "/items"); } if(!$page_owner instanceof ElggGroup) - add_submenu_item(elgg_echo('bookmarks:friends'),$CONFIG->wwwroot."pg/bookmarks/" . $_SESSION['user']->username . "/friends"); + add_submenu_item(elgg_echo('bookmarks:friends'),$CONFIG->wwwroot."pg/bookmarks/" . $_SESSION['user']->username . "/friends"); } if(!$page_owner instanceof ElggGroup) add_submenu_item(elgg_echo('bookmarks:everyone'),$CONFIG->wwwroot."mod/bookmarks/everyone.php"); */ - + // Bookmarklet if ((isloggedin()) && (page_owner()) && (can_write_to_container(0, page_owner()))) { $page_owner = page_owner_entity(); @@ -80,14 +78,14 @@ function bookmarks_pagesetup() { // add_submenu_item($bmtext, $CONFIG->wwwroot . "pg/bookmarks/{$page_owner->username}/bookmarklet"); } } - + $page_owner = page_owner_entity(); - + if ($page_owner instanceof ElggGroup && get_context() == 'groups') { if($page_owner->bookmarks_enable != "no"){ - add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items'); - } - } + add_submenu_item(sprintf(elgg_echo("bookmarks:group"),$page_owner->name), $CONFIG->wwwroot . "pg/bookmarks/" . $page_owner->username . '/items'); + } + } } /** @@ -107,7 +105,7 @@ function bookmarks_page_handler($page) { if (isset($page[1])) { switch($page[1]) { case "friends": - include(dirname(__FILE__) . "/friends.php"); + include(dirname(__FILE__) . "/friends.php"); return true; break; case "items": @@ -120,11 +118,11 @@ function bookmarks_page_handler($page) { break; case "edit": set_input('bookmark',$page[2]); - include(dirname(__FILE__) . "/add.php"); + include(dirname(__FILE__) . "/add.php"); return true; break; - case "bookmarklet": - include(dirname(__FILE__) . "/bookmarklet.php"); + case "bookmarklet": + include(dirname(__FILE__) . "/bookmarklet.php"); return true; break; } @@ -191,21 +189,21 @@ function bookmarks_notify_message($hook, $entity_type, $returnvalue, $params) { * A function to generate an internal code to put on the wire in place of the full url * to save space. **/ - + function create_wire_url_code(){ $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); - $i = 0; - $code = ''; - - while ($i <= 4) { - $num = rand() % 33; - $tmp = substr($chars, $num, 1); - $code = $code . $tmp; - $i++; - } - $code = "{{L:" . $code . "}}"; - return $code; + $i = 0; + $code = ''; + + while ($i <= 4) { + $num = rand() % 33; + $tmp = substr($chars, $num, 1); + $code = $code . $tmp; + $i++; + } + $code = "{{L:" . $code . "}}"; + return $code; } // Make sure the initialisation function is called on initialisation @@ -218,4 +216,4 @@ register_action('bookmarks/add',false,$CONFIG->pluginspath . "bookmarks/actions/ register_action('bookmarks/edit',false,$CONFIG->pluginspath . "bookmarks/actions/edit.php"); register_action('bookmarks/delete',false,$CONFIG->pluginspath . "bookmarks/actions/delete.php"); register_action('bookmarks/reference',false,$CONFIG->pluginspath . "bookmarks/actions/reference.php"); -register_action('bookmarks/remove',false,$CONFIG->pluginspath . "bookmarks/actions/remove.php");
\ No newline at end of file +register_action('bookmarks/remove',false,$CONFIG->pluginspath . "bookmarks/actions/remove.php"); diff --git a/mod/file/start.php b/mod/file/start.php index bd0389106..745f087f4 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -31,9 +31,7 @@ global $CONFIG; // Set up menu (tools dropdown) - if (isloggedin()) { - add_menu(elgg_echo('files'), $CONFIG->wwwroot . "pg/file/" . get_loggedin_user()->username); - } + add_menu(elgg_echo('files'), $CONFIG->wwwroot . "pg/file/"); // Extend CSS elgg_extend_view('css', 'file/css'); diff --git a/mod/groups/start.php b/mod/groups/start.php index 54c4189b2..e77edef41 100644 --- a/mod/groups/start.php +++ b/mod/groups/start.php @@ -17,10 +17,8 @@ global $CONFIG; - // Set up the menu for logged in users - if (isloggedin()) { - add_menu(elgg_echo('groups:yours'), $CONFIG->wwwroot . "pg/groups/member/"); - } + // Set up the menu + add_menu(elgg_echo('groups'), $CONFIG->wwwroot . "pg/groups/member/"); // Register a page handler, so we can have nice URLs register_page_handler('groups','groups_page_handler'); diff --git a/mod/riverdashboard/start.php b/mod/riverdashboard/start.php index 39233fba6..c093f5ecb 100644 --- a/mod/riverdashboard/start.php +++ b/mod/riverdashboard/start.php @@ -10,8 +10,7 @@ function riverdashboard_init() { register_page_handler('dashboard','riverdashboard_page_handler');
} else {
// Activity main menu
- if (isloggedin())
- add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
+ add_menu(elgg_echo('activity'), $CONFIG->wwwroot . "mod/riverdashboard/");
}
// Page handler
register_page_handler('riverdashboard','riverdashboard_page_handler');
@@ -33,4 +32,4 @@ function riverdashboard_dashboard() { include(dirname(__FILE__) . '/index.php');
}
-register_elgg_event_handler('init','system','riverdashboard_init');
\ No newline at end of file +register_elgg_event_handler('init','system','riverdashboard_init');
diff --git a/mod/thewire/languages/en.php b/mod/thewire/languages/en.php index 23e243716..3540cef78 100644 --- a/mod/thewire/languages/en.php +++ b/mod/thewire/languages/en.php @@ -7,7 +7,7 @@ */ 'thewire:title' => "The Wire", - 'thewire' => "My wire posts", + 'thewire:my_posts' => "My wire posts", 'thewire:user' => "%s's wire posts", 'thewire:posttitle' => "%s's notes on the wire: %s", 'thewire:everyone' => "All wire posts", @@ -77,4 +77,4 @@ add_translation("en",$english); -?>
\ No newline at end of file +?> diff --git a/mod/thewire/start.php b/mod/thewire/start.php index 97630336a..f4a29c47e 100644 --- a/mod/thewire/start.php +++ b/mod/thewire/start.php @@ -27,9 +27,7 @@ global $CONFIG; // Set up menu for logged in users - if (isloggedin()) { - add_menu(elgg_echo('thewire'), $CONFIG->wwwroot . "pg/thewire/". $_SESSION['user']->username); - } + add_menu(elgg_echo('thewire:title'), $CONFIG->wwwroot . "pg/thewire"); // Extend system CSS with our own styles, which are defined in the thewire/css view elgg_extend_view('css','thewire/css'); @@ -216,4 +214,4 @@ register_action("thewire/add",false,$CONFIG->pluginspath . "thewire/actions/add.php"); register_action("thewire/delete",false,$CONFIG->pluginspath . "thewire/actions/delete.php"); -?>
\ No newline at end of file +?> |