aboutsummaryrefslogtreecommitdiff
path: root/mod/blog/lib/blog.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 12:47:14 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-26 12:47:14 +0000
commit08070561a69db8dc17f9207079937135228603ec (patch)
tree2a8b2060ca29b7bd18ed4c9b9384f983ee6f6e1e /mod/blog/lib/blog.php
parent600f40002b2b3e59135146df493bf89401434ff4 (diff)
downloadelgg-08070561a69db8dc17f9207079937135228603ec.tar.gz
elgg-08070561a69db8dc17f9207079937135228603ec.tar.bz2
Refs #3239 added a new sticky forms function to grab all variables and integrated into blog plugin
git-svn-id: http://code.elgg.org/elgg/trunk@8836 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/blog/lib/blog.php')
-rw-r--r--mod/blog/lib/blog.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index e5a44a200..512f8f6d5 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -248,6 +248,8 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
*/
function blog_get_page_content_edit($page, $guid = 0, $revision = NULL) {
+ elgg_load_js('elgg.blog');
+
$return = array(
'buttons' => '',
'filter' => '',
@@ -338,24 +340,27 @@ function blog_prepare_form_vars($post = NULL, $revision = NULL) {
'draft_warning' => '',
);
- if (elgg_is_sticky_form('blog')) {
+ if ($post) {
foreach (array_keys($values) as $field) {
- $values[$field] = elgg_get_sticky_value('blog', $field);
+ if (isset($post->$field)) {
+ $values[$field] = $post->$field;
+ }
}
}
+ if (elgg_is_sticky_form('blog')) {
+ $sticky_values = elgg_get_sticky_values('blog');
+ foreach ($sticky_values as $key => $value) {
+ $values[$key] = $value;
+ }
+ }
+
elgg_clear_sticky_form('blog');
if (!$post) {
return $values;
}
- foreach (array_keys($values) as $field) {
- $values[$field] = $post->$field;
- }
-
- $values['entity'] = $post;
-
// load the revision annotation if requested
if ($revision instanceof ElggAnnotation && $revision->entity_guid == $post->getGUID()) {
$values['revision'] = $revision;