aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/start.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/blog/start.php')
-rw-r--r--mod/blog/start.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 0015efcf1..d0c4c5157 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -29,7 +29,10 @@ function blog_init() {
global $CONFIG;
require_once dirname(__FILE__) . '/blog_lib.php';
- add_menu(elgg_echo('blog'), "{$CONFIG->wwwroot}pg/blog/", array());
+ add_menu(elgg_echo('blog:blogs'), "{$CONFIG->wwwroot}pg/blog/", array());
+
+ // run the setup upon activations or to upgrade old installations.
+ run_function_once('blog_runonce', '1269370108');
elgg_extend_view('css', 'blog/css');
@@ -60,6 +63,15 @@ function blog_init() {
}
/**
+ * Register entity class for object:blog -> ElggBlog
+ */
+function blog_runonce() {
+ if (!update_subtype('object', 'blog', 'ElggBlog')) {
+ add_subtype('object', 'blog', 'ElggBlog');
+ }
+}
+
+/**
* Dispatches blog pages.
* To maintain URL backward compatibility, expects old-style URLs like:
* pg/blog/[username/[read|edit|archive|new/[time_start|guid/[time_end|title]]]]
@@ -176,7 +188,7 @@ function blog_page_setup() {
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);
+ add_submenu_item(elgg_echo('blog:groups:group_blogs'), $url);
}
}
}