diff options
Diffstat (limited to 'mod/blog')
-rw-r--r-- | mod/blog/activate.php | 10 | ||||
-rw-r--r-- | mod/blog/deactivate.php | 6 | ||||
-rw-r--r-- | mod/blog/lib/blog.php | 1 | ||||
-rw-r--r-- | mod/blog/manifest.xml | 2 | ||||
-rw-r--r-- | mod/blog/start.php | 15 | ||||
-rw-r--r-- | mod/blog/views/default/js/blog/save_draft.php | 4 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 1 |
7 files changed, 29 insertions, 10 deletions
diff --git a/mod/blog/activate.php b/mod/blog/activate.php new file mode 100644 index 000000000..a90525291 --- /dev/null +++ b/mod/blog/activate.php @@ -0,0 +1,10 @@ +<?php +/** + * Register the ElggBlog class for the object/blog subtype + */ + +if (get_subtype_id('object', 'blog')) { + update_subtype('object', 'blog', 'ElggBlog'); +} else { + add_subtype('object', 'blog', 'ElggBlog'); +} diff --git a/mod/blog/deactivate.php b/mod/blog/deactivate.php new file mode 100644 index 000000000..4a275fa94 --- /dev/null +++ b/mod/blog/deactivate.php @@ -0,0 +1,6 @@ +<?php +/** + * Deregister the ElggBlog class + */ + +update_subtype('object', 'blog'); diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php index 792f32c42..590547a8c 100644 --- a/mod/blog/lib/blog.php +++ b/mod/blog/lib/blog.php @@ -20,7 +20,6 @@ function blog_get_page_content_read($guid = NULL) { // no header or tabs for viewing an individual blog $return['filter'] = ''; - $return['header'] = ''; if (!elgg_instanceof($blog, 'object', 'blog')) { $return['content'] = elgg_echo('blog:error:post_not_found'); diff --git a/mod/blog/manifest.xml b/mod/blog/manifest.xml index bd5f9c396..29ee1bfc8 100644 --- a/mod/blog/manifest.xml +++ b/mod/blog/manifest.xml @@ -10,7 +10,7 @@ <description>Adds simple blogging capabilities to your Elgg installation.</description> <website>http://elgg.org/</website> <copyright>See COPYRIGHT.txt</copyright> - <license>GNU Public License version 2</license> + <license>GNU General Public License version 2</license> <requires> <type>elgg_release</type> <version>1.8</version> diff --git a/mod/blog/start.php b/mod/blog/start.php index 9e77b0a93..fa57e7b96 100644 --- a/mod/blog/start.php +++ b/mod/blog/start.php @@ -93,14 +93,14 @@ function blog_init() { * @todo no archives for all blogs or friends * * @param array $page - * @return NULL + * @return bool */ function blog_page_handler($page) { elgg_load_library('elgg:blog'); // @todo remove the forwarder in 1.9 - // forward to correct URL for bookmarks pre-1.7.5 + // forward to correct URL for blog pages pre-1.7.5 blog_url_forwarder($page); // push all blogs breadcrumb @@ -139,17 +139,22 @@ function blog_page_handler($page) { $params = blog_get_page_content_list($page[1]); break; case 'all': - default: - $title = elgg_echo('blog:title:all_blogs'); $params = blog_get_page_content_list(); break; + default: + return false; } - $params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type)); + if (isset($params['sidebar'])) { + $params['sidebar'] .= elgg_view('blog/sidebar', array('page' => $page_type)); + } else { + $params['sidebar'] = elgg_view('blog/sidebar', array('page' => $page_type)); + } $body = elgg_view_layout('content', $params); echo elgg_view_page($params['title'], $body); + return true; } /** diff --git a/mod/blog/views/default/js/blog/save_draft.php b/mod/blog/views/default/js/blog/save_draft.php index fd76c870c..8a994ffb0 100644 --- a/mod/blog/views/default/js/blog/save_draft.php +++ b/mod/blog/views/default/js/blog/save_draft.php @@ -28,7 +28,7 @@ elgg.blog.saveDraftCallback = function(data, textStatus, XHR) { } else { $(".blog-save-status-time").html(elgg.echo('error')); } -} +}; elgg.blog.saveDraft = function() { if (typeof(tinyMCE) != 'undefined') { @@ -55,7 +55,7 @@ elgg.blog.saveDraft = function() { }); $.post(draftURL, postData, elgg.blog.saveDraftCallback, 'json'); -} +}; elgg.blog.init = function() { // get a copy of the body to compare for auto save diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 05ddf62c7..3525b3d48 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -77,7 +77,6 @@ if ($full) { $summary = elgg_view('object/elements/summary', $params); echo elgg_view('object/elements/full', array( - 'title' => $blog->title, 'summary' => $summary, 'icon' => $owner_icon, 'body' => $body, |