Fixes for render AJAX HTMLRender objects

This commit is contained in:
Deon George
2013-06-17 18:00:27 +10:00
parent 640e8a53ee
commit 5064f08999
19 changed files with 13 additions and 16884 deletions

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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;