diff --git a/include/main.js b/include/main.js index abd097e54a..df7de2e769 100644 --- a/include/main.js +++ b/include/main.js @@ -225,6 +225,10 @@ if(timer) clearTimeout(timer); timer = setTimeout(NavUpdate,10); } + if(data.reload) { + window.location.href=data.reload; + } + }, "json" ); diff --git a/mod/display.php b/mod/display.php index 03003f3c0c..bdf6a6f974 100644 --- a/mod/display.php +++ b/mod/display.php @@ -153,7 +153,8 @@ function display_content(&$a) { } if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', // $_SESSION['return_url'], + '$return_path' => '', + '$jsreload' => $_SESSION['return_url'], '$type' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/mod/item.php b/mod/item.php index cbdd11eb97..8c6b181c0d 100644 --- a/mod/item.php +++ b/mod/item.php @@ -496,10 +496,17 @@ function item_post(&$a) { } } - if((x($_POST,'return')) && strlen($_POST['return'])) + logger('post_complete'); + if((x($_POST,'return')) && strlen($_POST['return'])) { + logger('return: ' . $_POST['return']); goaway($a->get_baseurl() . "/" . $_POST['return'] ); - + } $json = array('success' => 1); + if(x($_POST,'jsreload') && strlen($_POST['jsreload'])) + $json['reload'] = $a->get_baseurl() . '/' . $_POST['jsreload']; + + logger('post_json: ' . print_r($json,true), LOGGER_DEBUG); + echo json_encode($json); killme(); // NOTREACHED diff --git a/mod/network.php b/mod/network.php index 3658c601e3..bb0850d681 100644 --- a/mod/network.php +++ b/mod/network.php @@ -340,7 +340,8 @@ function network_content(&$a, $update = 0) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', // $_SESSION['return_url'], + '$return_path' => '', + '$jsreload => '', // $_SESSION['return_url'], '$type' => 'net-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/mod/photos.php b/mod/photos.php index a44eb5a5f5..27cb1beb1f 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -1048,7 +1048,8 @@ function photos_content(&$a) { if($can_post || can_write_wall($a,$owner_uid)) { if($link_item['last-child']) { $o .= replace_macros($cmnt_tpl,array( - '$return_path' => '', // $return_url, + '$return_path' => '', + '$jsreload' => $return_url, '$type' => 'wall-comment', '$id' => $link_item['id'], '$parent' => $link_item['id'], @@ -1087,7 +1088,8 @@ function photos_content(&$a) { if($can_post || can_write_wall($a,$owner_uid)) { if($link_item['last-child']) { $o .= replace_macros($cmnt_tpl,array( - '$return_path' => $return_url, + '$return_path' => '', + '$jsreload' => $return_url, '$type' => 'wall-comment', '$id' => $link_item['id'], '$parent' => $link_item['id'], @@ -1115,7 +1117,8 @@ function photos_content(&$a) { if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => $return_url, + '$return_path' => '', + '$jsreload' => $return_url, '$type' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/mod/profile.php b/mod/profile.php index 0723d64fb8..3a393eea0a 100644 --- a/mod/profile.php +++ b/mod/profile.php @@ -293,7 +293,8 @@ function profile_content(&$a, $update = 0) { } if($item['last-child']) { $comment = replace_macros($cmnt_tpl,array( - '$return_path' => '', // $_SESSION['return_url'], + '$return_path' => '', + '$jsreload' => '', // $_SESSION['return_url'], '$type' => 'wall-comment', '$id' => $item['item_id'], '$parent' => $item['parent'], diff --git a/view/comment_item.tpl b/view/comment_item.tpl index 885d735eda..dabbd6e87b 100644 --- a/view/comment_item.tpl +++ b/view/comment_item.tpl @@ -4,6 +4,7 @@ +
$mytitle