private function getTemplateContent($template, $variables = null) { // with the strpos we check if it is a frontend template, in that case we use the frontend template to prevent // errors that the template could not be found. This way we don't have a backwards compatibility break. if (APPLICATION !== 'Backend' || strpos($template, FRONTEND_CORE_PATH) !== false) { return Model::get('templating')->render($template, $variables); } $tpl = new BackendTemplate(false); // variables were set if (!empty($variables)) { $tpl->assign($variables); } // grab the content return $tpl->getContent($template); }