public static function getPath($file)
{
// redefine
$file = (string) $file;
// theme name
$theme = self::getTheme();
// theme in use
if (Model::get('fork.settings')->get('Core', 'theme', 'core') != 'core') {
// theme not yet specified
if (mb_strpos($file, 'src/Frontend/Themes/' . $theme) === false) {
// add theme location
$themeTemplate = str_replace(array('src/Frontend/'), array('src/Frontend/Themes/' . $theme . '/'), $file);
// check if this template exists
if (is_file(PATH_WWW . str_replace(PATH_WWW, '', $themeTemplate))) {
$file = $themeTemplate;
}
}
}
// check if the file exists
if (!is_file(PATH_WWW . str_replace(PATH_WWW, '', $file))) {
throw new Exception('The template (' . $file . ') does not exist.');
}
// return template path
return $file;
}