mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-13 16:14:40 +00:00
mvc, move view_fetch_themed_filename() to index, so a stub can overwrite it's behaviour (when developing locally)
This commit is contained in:
parent
67e95c4f52
commit
ec819ca59c
@ -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
|
||||
*/
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user