Permalink
Browse files

Navigation K3.1 work

  • Loading branch information...
1 parent 2c212a1 commit 7746a1dce6b5d6f3003a6a27b2762efeed2e688a Deepwinter committed Apr 28, 2011
@@ -34,7 +34,7 @@ public function action_data($uri)
'response' => $message
);
- $this->response->body(json_encode($subRequest->execute()->data()));
+ $this->response->body(json_encode($ajaxResponse));
// throw $e;
return;
}
@@ -78,10 +78,33 @@ public function action_html($subRequestUri)
$this->response->body(json_encode($ajaxResponse));
}
- public function action_compound()
+ public function action_compound($uri)
{
- //request to child, just data
- $this->response->body('This should return a compound data object - html and data');
+ try {
+ $subRequest = Request::Factory($uri);
+ $requestResponse = $subRequest->execute();
+ } catch (Exception $e) {
+ //return HTML from exception
+ $message = $e->getMessage() . $e->getTrace();
+ $ajaxResponse = array(
+ 'returnValue' => FALSE,
+ 'response' => $message
+
+ );
+ $this->response->body(json_encode($ajaxResponse));
+ return;
+ }
+ $compoundResponse = array(
+ 'data' => $requestResponse->data(),
+ 'html' => $requestResponse->body()
+ );
+ $ajaxResponse = array(
+ 'returnValue' => TRUE,
+ 'response'=>$compoundResponse
+ );
+ echo 'yo';
+ print_r($ajaxResponse);
+ $this->response->body(json_encode($ajaxResponse));
}
} // End Welcome
@@ -1,12 +0,0 @@
-<div class="tierMethodsDrawer">
-
-<h3>Add an Item to this tier.</h3>
-
-<ul class="methods">
-
-<li class="nodeType contentType">Add a Section</li>
-
-<li class="nodeType contentType">Add any object</li>
-
-</ul>
-</div>
Oops, something went wrong.

0 comments on commit 7746a1d

Please sign in to comment.