// Turn on/off cache:
c::set('cache', false);
// Exclude pages from caching:
c::set('cache.ignore', array('sitemap'));
// Date handlers:
c::set('date.handler', 'strftime');
// Use index as name for the start page:
c::set('home', 'index');
// Panel CSS:
// c::set('panel.stylesheet', 'assets/css/panel.css');
// ---------------------------------------------------------
// Image configuration
// ---------------------------------------------------------
// Use ImageMagick as thumbnail driver:
c::set('thumbs.driver', 'im');
// Define thumbs filename:
c::set('thumbs.filename', '{safeName}-{hash}-{width}x{height}.{extension}');
// Set thumbs quality to 90:
c::set('thumbs.quality', 90);
// Progressive JPEG:
c::set('thumbs.interlace', true);
// ---------------------------------------------------------
// Routes setup
// ---------------------------------------------------------
c::set('routes', array(
array(
'pattern' => 'sitemap.xml',
'action' => function() {
return page('sitemap');
}
),
array(
'pattern' => 'en/sitemap.xml',
'action' => function() {
return site()->visit('sitemap', 'en');
}
),
array(
'pattern' => 'logga-ut',
'action' => function() {
if($user = site()->user()) $user->logout();
return page('databas');
}
),
array(
'pattern' => 'en/logout',
'action' => function() {
if($user = site()->user()) $user->logout();
return site()->visit('database', 'en');
}
)
));
// ---------------------------------------------------------
// Language configuration
// ---------------------------------------------------------
// Setup multisite:
c::set('languages', array(
array(
'code' => 'sv',
'name' => 'Svenska',
'default' => true,
'locale' => 'sv_SE',
'url' => '/',
),
array(
'code' => 'en',
'name' => 'English',
'locale' => 'en_US',
'url' => '/en',
)
));
// Automatic language detection for the visitor:
c::set('language.detect', true);
// Proper translation of åäö:
str::$ascii = a::merge(str::$ascii, array(
'/Ä/' => 'A',
'/æ|ǽ|ä/' => 'a',
'/œ|ö/' => 'o',
'/Ö/' => 'O',
'/ö/' => 'o',
));
// ---------------------------------------------------------
// Authentication configuration
// ---------------------------------------------------------
c::set('roles', array(
array(
'id' => 'admin',
'name' => 'Admin',
'default' => true,
'panel' => true
),
array(
'id' => 'editor',
'name' => 'Editor',
'panel' => true
),
array(
'id' => 'client',
'name' => 'Client',
'panel' => false
)
));