'Production', Kohana::STAGING=>'Staging', Kohana::TESTING=>'Testing', Kohana::DEVELOPMENT=>'Development', ); return (! isset($modes[static::sitemode()])) ? 'Unknown' : $modes[static::sitemode()]; } public static function sitename() { 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())); return HTML::image($logo,array('class'=>'headlogo','alt'=>_('Logo'))); } /** * Return our caching mechanism */ public static function cachetype() { return is_null(Kohana::config('config.cache_type')) ? 'file' : Kohana::config('config.cache_type'); } /** * Show a date using a site configured format */ public static function date($date) { return date(Kohana::config('config.date_format'),$date); } /** * Show a date using a site configured format */ public static function time($date) { return date(Kohana::config('config.time_format'),$date); } /** * Show a date using a site configured format */ public static function datetime($date) { return date(Kohana::config('config.date_format').' '.Kohana::config('config.time_format'),$date); } /** * See if our emails for the template should be sent to configured admin(s) * * @param string template - Template to test for * @return mixed|array - Email to send test emails to */ public static function testmail($template) { $config = Kohana::config('config.email_admin_only'); if (is_null($config) OR ! is_array($config) OR empty($config[$template])) return FALSE; else return $config[$template]; } } ?>