Index: src/GXEngine/Services/System/Http/HttpViewController.inc.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- src/GXEngine/Services/System/Http/HttpViewController.inc.php (revision 04553b16185e06a06b7f6e0cf6611716d569b243) +++ src/GXEngine/Services/System/Http/HttpViewController.inc.php (revision ) @@ -286,4 +286,30 @@ throw new Exception($customExceptionMessage ? : 'Provided $_POST["pageToken"] variable is not valid.'); } } + + + /** + * Searches the GXModules directory for a template file, + * wich can be useed inside the AdminLayoutHttpControllerResponse object for the template parameter. + * + * @param string $templateFile The relative path or filename to search for + * + * @throws Exception if the path or file is not found inside the GXModules directory + */ + protected function getTemplateFile($templateFile) + { + $gxModuleFiles = GXModulesCache::getFiles(); + + foreach($gxModuleFiles as $file) + { + $strpos = strpos($file, $templateFile); + + if($strpos !== false) + { + return new ExistingFile(new NonEmptyStringType($file)); + } + } + + throw new Exception('Provided template file not found in GXModules directory: ' . $templateFile); + } } \ No newline at end of file