Modalise Login

This commit is contained in:
Deon George
2013-05-16 21:50:44 +10:00
parent 41e777bd9d
commit c06068fc90
4 changed files with 22 additions and 17 deletions

View File

@@ -145,25 +145,18 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
$this->meta->description = sprintf('%s::%s',$this->request->controller(),$this->request->action());
// In case we have some scripting/styling, we need to get that out too
// @todo Do we come here for ajax?
} elseif ($this->request->is_ajax() AND $this->response->body()) {
$this->response->bodyadd(Script::factory()->render_all());
$this->response->bodyadd(Style::factory()->render_all());
// For any ajax rendered actions, we'll need to capture the content and put it in the response
// @todo Do we come here for ajax?
} elseif ($this->request->is_ajax() && isset($this->template->content) && ! $this->response->body()) {
// In case there any style sheets for this render.
$this->response->bodyadd(Style::factory());
$output = Style::factory()->render_all();
$output .= Script::factory()->render_all();
$output .= $this->template->content;
// Since we are ajax, we should re-render the breadcrumb
Session::instance()->set('breadcrumb',(string)BreadCrumb::factory());
$this->response->bodyadd(Script::add(array('type'=>'stdin','data'=>'$().ready($("#ajCONTROL").load("'.URL::site('welcome/breadcrumb').'",null,function(x,s,r) {}));')));
// In case there any javascript for this render.
$this->response->bodyadd(Script::factory());
// Get the response body
$this->response->bodyadd(sprintf('<table class="content"><tr><td>%s</td></tr></table>',$this->template->content));
$this->response->body($output);
}
// Used by our javascript to know what the SITE URL is.

View File

@@ -33,7 +33,7 @@ abstract class lnApp_Meta {
public function secure() {
static $secure = NULL;
if (! $secure)
if (! $secure AND Request::current())
$secure = Request::current()->secure() ? 'https://' : 'http://';
return $secure;