diff options
Diffstat (limited to 'mod')
-rw-r--r-- | mod/blog/views/default/blog/sidebar_revisions.php | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/mod/blog/views/default/blog/sidebar_revisions.php b/mod/blog/views/default/blog/sidebar_revisions.php index f777316ec..7207d9c95 100644 --- a/mod/blog/views/default/blog/sidebar_revisions.php +++ b/mod/blog/views/default/blog/sidebar_revisions.php @@ -12,7 +12,6 @@ //If editing a post, show the previous revisions and drafts. $blog = isset($vars['entity']) ? $vars['entity'] : FALSE; - if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { $owner = $blog->getOwnerEntity(); $revisions = array(); @@ -34,10 +33,24 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { echo '<h3>' . elgg_echo('blog:revisions') . '</h3>'; $n = count($revisions); - echo '<ul class="blog_revisions">'; + $load_base_url = "{$vars['url']}pg/blog/{$owner->username}/edit/{$blog->getGUID()}/"; + // show the "published revision" + if ($blog->status == 'published') { + $load = elgg_view('output/url', array( + 'href' => $load_base_url, + 'text' => elgg_echo('load') + )); + + $time = friendly_time($blog->publish_date); + + echo '<li> + ' . elgg_echo('blog:status:published') . ": $time $load + </li>"; + } + foreach ($revisions as $revision) { $time = friendly_time($revision->time_created); $load = elgg_view('output/url', array( @@ -47,14 +60,13 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { if ($revision->name == 'blog_auto_save') { $name = elgg_echo('blog:auto_saved_revision'); - $text = "$name: $time $load"; - $class = 'class="auto_saved"'; } else { $name = elgg_echo('blog:revision') . " $n"; - $text = "$name: $time $load"; - $class = 'class="auto_saved"'; } + $text = "$name: $time $load"; + $class = 'class="auto_saved"'; + $n--; echo <<<___END |