Commit f257176e authored by Evan Goldenberg's avatar Evan Goldenberg Committed by Francois Marier
Browse files

usability: always show list of blogs, even if there is only one

Also, remove the "Add Blog" button from the view blog page, where it is
out of context. This simplifies the navigation of the blogging features
for user. Even when they only have one blog, being presented with a list
makes the ability to have more than one blog immediately apparent.
Signed-off-by: default avatarEvan Goldenberg <>
Signed-off-by: default avatarFrancois Marier <>
parent c352a1b8
......@@ -49,31 +49,6 @@ $blogs = (object) array(
list($blogs->count, $blogs->data) = ArtefactTypeBlog::get_blog_list($blogs->limit, $blogs->offset);
// If the user has exactly one blog, skip the blog listing and display it
if (!$delete && $blogs->offset == 0 && !empty($blogs->data) && count($blogs->data) == 1) {
define('TITLE', get_string('viewblog',''));
define('SECTION_PAGE', 'view');
$record = end($blogs->data);
$id = $record->id;
$blog = new ArtefactTypeBlog($id, $record);
// This javascript is used to generate a list of blog posts.
$js = '';
if ($blog->count_children()) {
$js = require(get_config('docroot') . 'artefact/blog/view/index.js.php');
$smarty = smarty(array('tablerenderer'));
$smarty->assign_by_ref('blog', $blog);
$smarty->assign_by_ref('INLINEJAVASCRIPT', $js);
$smarty->assign('PAGEHEADING', hsc($blog->get('title')));
get_string('nopostsaddone', '',
'<a href="' . get_config('wwwroot') . 'artefact/blog/post.php?blog=' . $blog->get('id') . '">', '</a>'));
define('TITLE', get_string('myblogs',''));
define('SECTION_PAGE', 'index');
......@@ -3,7 +3,6 @@
<div class="rbuttons">
<a class="btn btn-settings" href="{$WWWROOT}artefact/blog/settings/?id={$blog->get('id')}">{str section="" tag="settings"}</a>
<a class="btn btn-new" href="{$WWWROOT}artefact/blog/new">{str tag=addblog}</a>
<a class="btn btn-add" href="{$WWWROOT}artefact/blog/post.php?blog={$blog->get('id')}">{str section="" tag="addpost"}</a>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment