From 2b68a4d217c35a5587c462620789493cf2804ba2 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 18 Jun 2011 16:24:52 -0400 Subject: Fixes #3580 adding blog preview button that uses save action --- mod/blog/views/default/forms/blog/save.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'mod/blog/views') diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php index 5b3a758ba..d99f45f01 100644 --- a/mod/blog/views/default/forms/blog/save.php +++ b/mod/blog/views/default/forms/blog/save.php @@ -5,6 +5,8 @@ * @package Blog */ +$blog = get_entity($vars['guid']); + $draft_warning = $vars['draft_warning']; if ($draft_warning) { $draft_warning = '' . $draft_warning . ''; @@ -12,6 +14,7 @@ if ($draft_warning) { $action_buttons = ''; $delete_link = ''; +$preview_button = ''; if ($vars['guid']) { // add a delete button if editing @@ -23,8 +26,20 @@ if ($vars['guid']) { )); } -$save_button = elgg_view('input/submit', array('value' => elgg_echo('save'))); -$action_buttons = $save_button . $delete_link; +// published blogs do not get the preview button +if (!$vars['guid'] || ($blog && $blog->status != 'published')) { + $preview_button = elgg_view('input/submit', array( + 'value' => elgg_echo('preview'), + 'name' => 'preview', + 'class' => 'mls', + )); +} + +$save_button = elgg_view('input/submit', array( + 'value' => elgg_echo('save'), + 'name' => 'save', +)); +$action_buttons = $save_button . $preview_button . $delete_link; $title_label = elgg_echo('title'); $title_input = elgg_view('input/text', array( -- cgit v1.2.3