/** * Return Theme Template Paths. * * @return string[] Theme Template Paths */ public static function getThemeTemplatePaths() { // get module, submodule, renderer names $module = TargetRoute::getModule(); $controller = TargetRoute::getController(); #$renderer = HttpRequest::getRoute()->getRenderEngine(); $theme_paths = []; /* * BACKEND THEME * when either "controlcenter" or "admin" is requested, it has to be a BACKEND theme. */ if ($module === 'controlcenter' or $controller === 'admin') { $theme = TargetRoute::getBackendTheme(); // (a) USER BACKENDTHEME - check in the active session backendtheme // e.g. /themes/backend/ + admin/template_name.tpl $theme_paths[] = APPLICATION_PATH . '/backend/' . $theme; // e.g. /themes/backend/ + admin/modules/template_name.tpl $theme_paths[] = APPLICATION_PATH . '/backend/' . $theme . '/modules/' . $module . DIRECTORY_SEPARATOR; // (b) BACKEND FALLBACK - check the fallback dir: themes/admin $theme_paths[] = APPLICATION_PATH . '/backend/default/'; } else { // FRONTEND THEME $theme = TargetRoute::getFrontendTheme(); // (a) USER FRONTENDTHEME - check, if template exists in current session user THEME $theme_paths[] = APPLICATION_PATH . '/frontend/' . $theme . DIRECTORY_SEPARATOR; // (b) FRONTEND FALLBACK - check, if template exists in usertheme/modulename/tpl $theme_paths[] = APPLICATION_PATH . '/frontend/' . $theme . '/modules/' . $module . DIRECTORY_SEPARATOR; // (c) FRONTEND FALLBACK - check, if template exists in standard theme $theme_paths[] = APPLICATION_PATH . '/frontend/default/'; } return $theme_paths; }