This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/application/classes/Controller/TemplateDefault.php

49 lines
1.5 KiB
PHP
Raw Normal View History

2010-11-29 22:41:08 +00:00
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides the default template controller for rendering pages.
*
* @package OSB
2010-11-29 22:41:08 +00:00
* @category Controllers
* @author Deon George
2013-03-19 22:35:19 +00:00
* @copyright (c) 2009-2013 Open Source Billing
* @license http://dev.osbill.net/license.html
2010-11-29 22:41:08 +00:00
*/
2012-01-29 10:08:54 +00:00
class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault {
2012-01-29 06:23:24 +00:00
public function __construct(Request $request, Response $response) {
if (Config::theme())
$this->template = Config::theme().'/page';
return parent::__construct($request,$response);
}
2011-09-29 07:13:32 +00:00
protected function _headimages() {
// This is where we should be able to change our country
// @todo To implement
$co = Config::country();
2011-09-29 07:13:32 +00:00
HeadImages::add(array(
'img'=>sprintf('img/country/%s.png',strtolower($co->two_code)),
'attrs'=>array('onclick'=>"target='_blank';",'title'=>$co->display('name'))
));
return HeadImages::factory();
}
2010-11-29 22:41:08 +00:00
protected function _left() {
if ($this->template->left)
return $this->template->left;
elseif (Auth::instance()->logged_in(NULL,get_class($this).'|'.__METHOD__))
return Controller_Tree::js();
}
protected function _right() {
return ($this->template->right) ? $this->template->right : $this->_cart();
2010-11-29 22:41:08 +00:00
}
private function _cart() {
return (! Config::module_exist('cart') OR ! class_exists('Cart') OR ! count(Cart::instance()->contents()) OR strtolower(Request::current()->controller()) == 'cart') ? '' : Cart::instance()->cart_block();
2010-11-29 22:41:08 +00:00
}
}
?>