Updated for new lnApp

This commit is contained in:
Deon George
2014-08-25 14:41:07 +10:00
parent 52e94c6e7d
commit c1b1485c10
44 changed files with 208 additions and 481 deletions

View File

@@ -49,62 +49,10 @@ class Config extends Kohana_Config {
return Config::$_instance;
}
/**
* Return our caching mechanism
*/
public static function cachetype() {
return is_null(Kohana::$config->load('config')->cache_type) ? 'file' : Kohana::$config->load('config')->cache_type;
}
public static function copywrite() {
return '(c) Open Source Billing Development Team';
}
public static function country() {
return Company::instance()->country();
}
/**
* Show a date using a site configured format
*/
public static function date($date) {
return (is_null($date) OR ! $date) ? '' : date(Company::instance()->date_format(),$date);
}
/**
* Show a date using a site configured format
* @note We need this function here, since we call self:: methods, which need to resolve to the child class.
*/
public static function datetime($date) {
return sprintf('%s %s',self::date($date),self::time($date));
}
public static function language() {
return Company::instance()->language();
}
/**
* The URI to show for the login prompt.
* Normally if the user is logged in, we can replace it with something else
*/
public static function login_uri() {
return ($ao = Auth::instance()->get_user() AND is_object($ao)) ? HTML::anchor(URL::link('user','account/edit'),$ao->name()) : HTML::anchor('login',_('Login'));
}
public static function logout_uri() {
return ($ao = Auth::instance()->get_user() AND is_object($ao)) ? HTML::anchor('logout','Logout',array('class'=>'lnk_logout')) : '';
}
public static function logo() {
return HTML::image(self::logo_uri(),array('class'=>'headlogo','alt'=>_('Logo')));
}
public static function logo_uri($protocol=NULL) {
list ($path,$suffix) = explode('.',self::$logo);
return URL::site(Route::get('default/media')->uri(array('file'=>$path.'.'.$suffix),array('alt'=>self::sitename())),$protocol);
}
/**
* Find a list of all database enabled modules
*
@@ -141,24 +89,6 @@ class Config extends Kohana_Config {
return array_key_exists(strtolower($module),self::modules()) ? TRUE : FALSE;
}
/**
* Work out our site ID for multiehosting
*/
public static function siteid($format=FALSE) {
return Company::instance()->site($format);
}
/**
* Work out our site mode (dev,test,prod)
*/
public static function sitemode() {
return Company::instance()->sitemode();
}
public static function sitename() {
return Company::instance()->name();
}
/**
* See if our emails for the template should be sent to configured admin(s)
*
@@ -173,17 +103,5 @@ class Config extends Kohana_Config {
else
return $config[$template];
}
public static function theme() {
// If we are using user admin pages (and login), we'll choose the admin theme.
return 'theme/'.(URL::admin_url() ? Kohana::$config->load('config')->theme_admin : Kohana::$config->load('config')->theme);
}
/**
* Show a date using a site configured format
*/
public static function time($date) {
return date(Company::instance()->time_format(),($date ? $date : time()));
}
}
?>