diff --git a/src/opnsense/mvc/app/config/services.php b/src/opnsense/mvc/app/config/services.php index d71808266..64124e92d 100644 --- a/src/opnsense/mvc/app/config/services.php +++ b/src/opnsense/mvc/app/config/services.php @@ -9,27 +9,6 @@ use Phalcon\Session\Adapter\Files as SessionAdapter; use OPNsense\Core\Config; use OPNsense\Core\Routing; -/** - * search for a themed filename or return distribution standard - * @param string $url relative url - * @param array $theme theme name - * @return string - */ -function view_fetch_themed_filename($url, $theme) -{ - $search_pattern = array( - "/themes/{$theme}/build/", - "/" - ); - foreach ($search_pattern as $pattern) { - $filename = __DIR__ . "/../../../www{$pattern}{$url}"; - if (file_exists($filename)) { - return str_replace("//", "/", "/ui{$pattern}{$url}"); - } - } - return $url; // not found, return source -} - /** * The FactoryDefault Dependency Injector automatically register the right services providing a full stack framework */ diff --git a/src/opnsense/www/index.php b/src/opnsense/www/index.php index f18409ba9..eac29f57e 100644 --- a/src/opnsense/www/index.php +++ b/src/opnsense/www/index.php @@ -2,6 +2,27 @@ error_reporting(E_ALL); +/** + * search for a themed filename or return distribution standard + * @param string $url relative url + * @param array $theme theme name + * @return string + */ +function view_fetch_themed_filename($url, $theme) +{ + $search_pattern = array( + "/themes/{$theme}/build/", + "/" + ); + foreach ($search_pattern as $pattern) { + $filename = __DIR__ . "{$pattern}{$url}"; + if (file_exists($filename)) { + return str_replace("//", "/", "/ui{$pattern}{$url}"); + } + } + return $url; // not found, return source +} + try { /** * Read the configuration