Fixes for render AJAX HTMLRender objects
This commit is contained in:
@@ -145,10 +145,14 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
|
||||
$this->meta->description = sprintf('%s::%s',$this->request->controller(),$this->request->action());
|
||||
|
||||
// For any ajax rendered actions, we'll need to capture the content and put it in the response
|
||||
} elseif ($this->request->is_ajax() && isset($this->template->content) && ! $this->response->body()) {
|
||||
} elseif ($this->request->is_ajax()) {
|
||||
$output = Style::factory()->render_all();
|
||||
$output .= Script::factory()->render_all();
|
||||
$output .= $this->template->content;
|
||||
|
||||
if (! isset($this->template->content) AND $this->response->body())
|
||||
$output .= $this->response->body();
|
||||
else
|
||||
$output .= $this->template->content;
|
||||
|
||||
$this->response->body($output);
|
||||
}
|
||||
|
@@ -77,14 +77,14 @@ abstract class lnApp_HTMLRender {
|
||||
/**
|
||||
* Render all of these items
|
||||
*/
|
||||
public static function render_all() {
|
||||
public function render_all() {
|
||||
$output = '';
|
||||
|
||||
$o = static::factory();
|
||||
|
||||
for ($x=0; $x<static::$_c; $x++)
|
||||
if (isset(static::$_data[$x]))
|
||||
$output .= (string)$o->record($x);
|
||||
if (isset(static::$_data[$x])) {
|
||||
$output .= (string)$this->record($x);
|
||||
unset(static::$_data[$x]);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
@@ -77,7 +77,7 @@ abstract class lnApp_SystemMessage extends HTMLRender {
|
||||
/**
|
||||
* Render all of these items
|
||||
*/
|
||||
public static function render_all() {
|
||||
public function render_all() {
|
||||
// Reload our message from the session
|
||||
if ($msgs = Session::instance()->get_once('sessionmsgs'))
|
||||
static::$_data = $msgs;
|
||||
|
Reference in New Issue
Block a user