Updates from lnApp

This commit is contained in:
Deon George
2011-05-02 22:20:56 +10:00
parent ca37cea6cf
commit 2f7a10804e
32 changed files with 301 additions and 278 deletions

View File

@@ -12,39 +12,6 @@
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Config extends Kohana {
/**
* Find a list of all database enabled modules
*
* @uses cache
*/
public static function appmodules() {
$cacheable = TRUE;
if (array_key_exists('cache',Kohana::modules())) {
$cache = Cache::instance(static::cachetype());
if ($cacheable AND $cache->get('modules'))
return $cache->get('modules');
} else
$cache = '';
$modules = array();
$module_table = 'module';
if (class_exists('Model_'.ucfirst($module_table))) {
$mo = ORM::factory($module_table)->where('status','=',1)->find_all()->as_array();
foreach ($mo as $o)
$modules[$o->name] = MODPATH.$o->name;
}
if ($cache)
$cache->set('modules',$modules);
return $modules;
}
/**
* Return our site name
*/
@@ -90,7 +57,13 @@ abstract class lnApp_Config extends Kohana {
return Kohana::config('config.site_name');
}
public static function logo_file() {
// @todo Move the logo filename to a config file
return Kohana::find_file(sprintf('media/%s',Config::siteid()),'img/logo-small','png');
}
public static function logo() {
// @todo Move the logo filename to a config file
$mediapath = Route::get('default/media');
$logo = $mediapath->uri(array('file'=>'img/logo-small.png'),array('alt'=>static::sitename()));