Skip to content

Commit aa87408

Browse files
authored
Merge pull request #6 from richard67/4.1-dev-dgrammatiko-child-templates-mod-3
[CMS PR 35874] Add stuff from system templates to deleted files and folders and files for preview images to the move to media folder
2 parents 00e431b + 1562dff commit aa87408

File tree

1 file changed

+64
-9
lines changed

1 file changed

+64
-9
lines changed

administrator/components/com_admin/script.php

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6200,8 +6200,15 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
62006200
'/administrator/templates/atum/scss/vendor/joomla-custom-elements/joomla-alert.scss',
62016201
'/administrator/templates/atum/scss/vendor/joomla-custom-elements/joomla-tab.scss',
62026202
'/administrator/templates/atum/scss/vendor/minicolors/minicolors.scss',
6203-
'/administrator/templates/atum/template_preview.png',
6204-
'/administrator/templates/atum/template_thumbnail.png',
6203+
'/administrator/templates/system/css/error.css',
6204+
'/administrator/templates/system/css/error.min.css',
6205+
'/administrator/templates/system/css/error.min.css.gz',
6206+
'/administrator/templates/system/css/system.css',
6207+
'/administrator/templates/system/css/system.min.css',
6208+
'/administrator/templates/system/css/system.min.css.gz',
6209+
'/administrator/templates/system/images/calendar.png',
6210+
'/administrator/templates/system/scss/error.scss',
6211+
'/administrator/templates/system/scss/system.scss',
62056212
'/templates/cassiopeia/css/editor.css',
62066213
'/templates/cassiopeia/css/editor.min.css',
62076214
'/templates/cassiopeia/css/editor.min.css.gz',
@@ -6289,8 +6296,30 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
62896296
'/templates/cassiopeia/scss/vendor/choicesjs/choices.scss',
62906297
'/templates/cassiopeia/scss/vendor/joomla-custom-elements/joomla-alert.scss',
62916298
'/templates/cassiopeia/scss/vendor/metismenu/_metismenu.scss',
6292-
'/templates/cassiopeia/template_preview.png',
6293-
'/templates/cassiopeia/template_thumbnail.png',
6299+
'/templates/system/css/editor.css',
6300+
'/templates/system/css/editor.min.css',
6301+
'/templates/system/css/editor.min.css.gz',
6302+
'/templates/system/css/error.css',
6303+
'/templates/system/css/error.min.css',
6304+
'/templates/system/css/error.min.css.gz',
6305+
'/templates/system/css/error_rtl.css',
6306+
'/templates/system/css/error_rtl.min.css',
6307+
'/templates/system/css/error_rtl.min.css.gz',
6308+
'/templates/system/css/general.css',
6309+
'/templates/system/css/general.min.css',
6310+
'/templates/system/css/general.min.css.gz',
6311+
'/templates/system/css/offline.css',
6312+
'/templates/system/css/offline.min.css',
6313+
'/templates/system/css/offline.min.css.gz',
6314+
'/templates/system/css/offline_rtl.css',
6315+
'/templates/system/css/offline_rtl.min.css',
6316+
'/templates/system/css/offline_rtl.min.css.gz',
6317+
'/templates/system/scss/editor.scss',
6318+
'/templates/system/scss/error.scss',
6319+
'/templates/system/scss/error_rtl.scss',
6320+
'/templates/system/scss/general.scss',
6321+
'/templates/system/scss/offline.scss',
6322+
'/templates/system/scss/offline_rtl.scss',
62946323
);
62956324

62966325
$folders = array(
@@ -7551,6 +7580,8 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
75517580
// From 4.0.3 to 4.0.4
75527581
'/templates/cassiopeia/images/system',
75537582
// From 4.0.4 to 4.1.0
7583+
'/templates/system/scss',
7584+
'/templates/system/css',
75547585
'/templates/cassiopeia/scss/vendor/metismenu',
75557586
'/templates/cassiopeia/scss/vendor/joomla-custom-elements',
75567587
'/templates/cassiopeia/scss/vendor/choicesjs',
@@ -7573,6 +7604,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
75737604
'/templates/cassiopeia/css/system',
75747605
'/templates/cassiopeia/css/global',
75757606
'/templates/cassiopeia/css',
7607+
'/administrator/templates/system/scss',
7608+
'/administrator/templates/system/images',
7609+
'/administrator/templates/system/css',
75767610
'/administrator/templates/atum/scss/vendor/minicolors',
75777611
'/administrator/templates/atum/scss/vendor/joomla-custom-elements',
75787612
'/administrator/templates/atum/scss/vendor/fontawesome-free',
@@ -8452,7 +8486,7 @@ protected function fixFilenameCasing()
84528486
*/
84538487
protected function moveRemainingTemplateFiles()
84548488
{
8455-
$folders = array(
8489+
$folders = [
84568490
'/administrator/templates/atum/css' => '/media/templates/administrator/atum/css',
84578491
'/administrator/templates/atum/images' => '/media/templates/administrator/atum/images',
84588492
'/administrator/templates/atum/js' => '/media/templates/administrator/atum/js',
@@ -8461,21 +8495,42 @@ protected function moveRemainingTemplateFiles()
84618495
'/templates/cassiopeia/images' => '/media/templates/site/cassiopeia/images',
84628496
'/templates/cassiopeia/js' => '/media/templates/site/cassiopeia/js',
84638497
'/templates/cassiopeia/scss' => '/media/templates/site/cassiopeia/scss',
8464-
);
8498+
];
8499+
8500+
$files = [
8501+
'/administrator/templates/atum/template_preview.png' => '/media/templates/administrator/atum/images/template_preview.png',
8502+
'/administrator/templates/atum/template_thumbnail.png' => '/media/templates/administrator/atum/images/template_thumbnail.png',
8503+
'/templates/cassiopeia/template_preview.png' => '/media/templates/site/cassiopeia/images/template_preview.png',
8504+
'/templates/cassiopeia/template_thumbnail.png' => '/media/templates/site/cassiopeia/images/template_thumbnail.png',
8505+
];
84658506

84668507
foreach ($folders as $oldFolder => $newFolder)
84678508
{
8468-
if ($folderExists = Folder::exists(JPATH_ROOT . $oldFolder))
8509+
if (Folder::exists(JPATH_ROOT . $oldFolder))
84698510
{
84708511
$oldPath = Path::clean(JPATH_ROOT . $oldFolder);
84718512
$newPath = Path::clean(JPATH_ROOT . $newFolder);
84728513

84738514
// Handle all files in this folder and all sub-folders
8474-
foreach (Folder::files($oldPath, '.*', true, true) as $file)
8515+
foreach (Folder::files($oldPath, '.*', true, true) as $oldFile)
84758516
{
8476-
File::move($file, $newPath . substr($file, strlen($oldPath)));
8517+
$newFile = $newPath . substr($oldFile, strlen($oldPath));
8518+
8519+
// Create target folder and parent folders if they doen't exist yet
8520+
if (Folder::create(\dirname($newFile)))
8521+
{
8522+
File::move($oldFile, $newFile);
8523+
}
84778524
}
84788525
}
84798526
}
8527+
8528+
foreach ($files as $oldFile => $newFile)
8529+
{
8530+
if (File::exists(JPATH_ROOT . $oldFile))
8531+
{
8532+
File::move(JPATH_ROOT . $oldFile, JPATH_ROOT . $newFile);
8533+
}
8534+
}
84808535
}
84818536
}

0 commit comments

Comments
 (0)