forked from projects/fipamo
#56 moves global assets from theme if not present in public dir
This commit is contained in:
parent
1bb13ce771
commit
9fe8ce1e4c
2 changed files with 24 additions and 0 deletions
|
@ -26,6 +26,30 @@ class Render
|
||||||
$settings["global"]["base_url"] . $settings["global"]["background"],
|
$settings["global"]["base_url"] . $settings["global"]["background"],
|
||||||
"baseURL" => $settings["global"]["base_url"],
|
"baseURL" => $settings["global"]["base_url"],
|
||||||
];
|
];
|
||||||
|
//move global theme image assets to public folder
|
||||||
|
foreach (
|
||||||
|
new DirectoryIterator(
|
||||||
|
"../content/themes/" . $this->theme . "/assets/images/global/"
|
||||||
|
)
|
||||||
|
as $file
|
||||||
|
) {
|
||||||
|
if ($file->isDot()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!is_file("../public/assets/images/global/" . $file->getFileName())) {
|
||||||
|
copy(
|
||||||
|
"../content/themes/" .
|
||||||
|
$this->theme .
|
||||||
|
"/assets/images/global/" .
|
||||||
|
$file->getFileName(),
|
||||||
|
"../public/assets/images/global/" . $file->getFileName()
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
//image is already there, so chill
|
||||||
|
}
|
||||||
|
//print $file->getFilename() . "\n";
|
||||||
|
}
|
||||||
|
|
||||||
//copy current theme assets to public
|
//copy current theme assets to public
|
||||||
if (is_file("../public/assets/css/base.css")) {
|
if (is_file("../public/assets/css/base.css")) {
|
||||||
unlink("../public/assets/css/base.css");
|
unlink("../public/assets/css/base.css");
|
||||||
|
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Loading…
Reference in a new issue