diff options
Diffstat (limited to 'mod/blog/views')
-rw-r--r-- | mod/blog/views/default/blog/sidebar/revisions.php | 2 | ||||
-rw-r--r-- | mod/blog/views/default/forms/blog/save.php | 13 | ||||
-rw-r--r-- | mod/blog/views/default/input/datetime.php | 48 | ||||
-rw-r--r-- | mod/blog/views/default/js/blog/save_draft.php | 2 | ||||
-rw-r--r-- | mod/blog/views/default/object/blog.php | 2 |
5 files changed, 6 insertions, 61 deletions
diff --git a/mod/blog/views/default/blog/sidebar/revisions.php b/mod/blog/views/default/blog/sidebar/revisions.php index b8f07b336..5e4f45bd9 100644 --- a/mod/blog/views/default/blog/sidebar/revisions.php +++ b/mod/blog/views/default/blog/sidebar/revisions.php @@ -43,7 +43,7 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) { )); $time = "<span class='elgg-subtext'>" - . elgg_view_friendly_time($blog->publish_date) . "</span>"; + . elgg_view_friendly_time($blog->time_created) . "</span>"; $body .= "<li>$load : $time</li>"; } diff --git a/mod/blog/views/default/forms/blog/save.php b/mod/blog/views/default/forms/blog/save.php index c8c0fde55..b2d20579f 100644 --- a/mod/blog/views/default/forms/blog/save.php +++ b/mod/blog/views/default/forms/blog/save.php @@ -48,8 +48,9 @@ $body_input = elgg_view('input/longtext', array( )); $save_status = elgg_echo('blog:save_status'); -if ($vars['publish_date']) { - $saved = date('F j, Y @ H:i', $vars['publish_date']); +if ($vars['guid']) { + $entity = get_entity($vars['guid']); + $saved = date('F j, Y @ H:i', $entity->time_created); } else { $saved = elgg_echo('blog:never'); } @@ -87,14 +88,6 @@ $access_input = elgg_view('input/access', array( 'value' => $vars['access_id'] )); -// not being used -$publish_date_label = elgg_echo('blog:publish_date'); -$publish_date_input = elgg_view('input/datetime', array( - 'name' => 'publish_date', - 'id' => 'blog_publish_date', - 'value' => $vars['publish_date'] -)); - $categories_input = elgg_view('categories', $vars); // hidden inputs diff --git a/mod/blog/views/default/input/datetime.php b/mod/blog/views/default/input/datetime.php deleted file mode 100644 index 1f4a33ecd..000000000 --- a/mod/blog/views/default/input/datetime.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -/** - * A date-time view for the blog publication date. - * - * not being used - */ - -// default date to current time -$publish_date = ($vars['value']) ? $vars['value'] : time(); - -$months = array(); -for ($i=1; $i <= 12; $i++) { - $value = str_pad($i, 2, '0', STR_PAD_LEFT); - $months[$value] = date('M', strtotime("$value/01/2010")); -} - -$month = elgg_view('input/dropdown', array( - 'name' => 'publish_month', - 'value' => date('m', $publish_date), - 'options_values' => $months, - 'class' => 'elgg-input-datetime-month', -)); - -$day = elgg_view('input/text', array( - 'name' => 'publish_day', - 'value' => date('d', $publish_date), - 'class' => 'elgg-input-datetime-day', -)); - -$year = elgg_view('input/text', array( - 'name' => 'publish_year', - 'value' => date('Y', $publish_date), - 'class' => 'elgg-input-datetime-year', -)); - -$hour = elgg_view('input/text', array( - 'name' => 'publish_hour', - 'value' => date('H', $publish_date), - 'class' => 'elgg-input-datetime-hour', -)); - -$minute = elgg_view('input/text', array( - 'name' => 'publish_minute', - 'value' => date('i', $publish_date), - 'class' => 'elgg-input-datetime-minute', -)); - -echo "$month $day, $year @ $hour:$minute"; diff --git a/mod/blog/views/default/js/blog/save_draft.php b/mod/blog/views/default/js/blog/save_draft.php index 990ab357d..44b54acb0 100644 --- a/mod/blog/views/default/js/blog/save_draft.php +++ b/mod/blog/views/default/js/blog/save_draft.php @@ -55,7 +55,7 @@ elgg.blog.saveDraft = function() { } }); - $.post(draftURL, postData, blogSaveDraftCallback, 'json'); + $.post(draftURL, postData, elgg.blog.blogSaveDraftCallback, 'json'); } elgg.blog.init = function() { diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php index 8c339236c..9687e8f34 100644 --- a/mod/blog/views/default/object/blog.php +++ b/mod/blog/views/default/object/blog.php @@ -24,7 +24,7 @@ $owner_link = elgg_view('output/url', array( )); $author_text = elgg_echo('byline', array($owner_link)); $tags = elgg_view('output/tags', array('tags' => $blog->tags)); -$date = elgg_view_friendly_time($blog->publish_date); +$date = elgg_view_friendly_time($blog->time_created); // The "on" status changes for comments, so best to check for !Off if ($blog->comments_on != 'Off') { |