Minor template updates

This commit is contained in:
Deon George 2013-10-09 16:41:24 +11:00
parent 696ee7a9e2
commit 45cadf0945
3 changed files with 26 additions and 3 deletions

View File

@ -85,7 +85,10 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
if ($this->request->is_ajax()) if ($this->request->is_ajax())
throw HTTP_Exception::factory(403,_('You dont have enough permissions.')); throw HTTP_Exception::factory(403,_('You dont have enough permissions.'));
else else
HTTP::redirect('login/noaccess'); if (! Kohana::$config->load('debug')->disabled_noaccess_redirect)
HTTP::redirect('login/noaccess');
else
throw HTTP_Exception::factory(501,'I would redirect you here - no ACCESS');
} else { } else {
Session::instance()->set('afterlogin',Request::detect_uri()); Session::instance()->set('afterlogin',Request::detect_uri());
@ -150,8 +153,8 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
$output = Style::factory()->render_all(); $output = Style::factory()->render_all();
$output .= Script::factory()->render_all(); $output .= Script::factory()->render_all();
if (! isset($this->template->content) AND $this->response->body()) if (! isset($this->template->content))
$output .= $this->response->body(); $output .= $this->response->body() ? $this->response->body() : '';
else else
$output .= $this->template->content; $output .= $this->template->content;

View File

@ -71,6 +71,11 @@
<li class=""> <li class="">
<a href="<?php echo URL::link('user','welcome',TRUE); ?>"><i class="icon-home"></i> <span>Home</span></a> <a href="<?php echo URL::link('user','welcome',TRUE); ?>"><i class="icon-home"></i> <span>Home</span></a>
</li> </li>
<?php if (($ao = Auth::instance()->get_user()) AND $ao->isAdmin()) : ?>
<li class="">
<a href="<?php echo URL::link('admin','welcome',TRUE); ?>"><i class="icon-tasks"></i> <span>Admin</span></a>
</li>
<?php endif ?>
</ul> </ul>
</div> <!-- /.subnav-collapse --> </div> <!-- /.subnav-collapse -->
</div> <!-- /container --> </div> <!-- /container -->

View File

@ -0,0 +1,15 @@
<ul id="main-nav">
<li class="active"><a href="<?php echo URL::site(''); ?>">Home</a></li>
<?php if ($x = Company::instance()->faq()) : ?>
<li><a href="<?php echo $x; ?>">Faq</a></li>
<?php endif ?>
<?php if (Auth::instance()->logged_in()) : ?>
<li><a href="<?php echo URL::site('login'); ?>">Customer Login</a></li>
<?php else : ?>
<li><a href="<?php echo URL::site('login'); ?>" data-toggle="modal" data-target="#modal-login">Customer Login</a></li>
<?php endif ?>
</ul>
<div class="modal hide fade" id="modal-login" role="dialog" aria-hidden="true">
<div class="modal-body"></div>
</div>