default theme is used as fallback

This commit is contained in:
Claude 2013-03-24 17:06:11 +01:00
parent 33cee7eb76
commit 6c8870960f
40 changed files with 7 additions and 3 deletions

View File

@ -27,7 +27,7 @@ $config['db_password'] = 'stikked';
* Folder name in htdocs/application/themes/ * Folder name in htdocs/application/themes/
* *
*/ */
$config['theme'] = 'classic'; $config['theme'] = 'default';
/** /**
* Combine JS & CSS files (recommended) * Combine JS & CSS files (recommended)

View File

@ -28,8 +28,12 @@ class MY_Loader extends CI_Loader
//view path //view path
$view_path = 'themes/' . $theme . '/views/' . $view . '.php'; $view_path = 'themes/' . $theme . '/views/' . $view . '.php';
//inform (todo: fallback, error if not found) //fallback to default view if view in theme not found
log_message('debug', 'Using view "' . $view_path . '"');
if (!file_exists('application/' . $view_path))
{
$view_path = 'themes/default/views/' . $view . '.php';
}
//return //return
return $this->_ci_load(array( return $this->_ci_load(array(

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 282 B