Created
July 29, 2018 23:03
-
-
Save ibennetch/4788cd15d56c911b25be28d596f2d48c to your computer and use it in GitHub Desktop.
Suggestions for the theme generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/libraries/classes/ThemeGenerator.php b/libraries/classes/ThemeGenerator.php | |
index 33c3d6d52b..15f219d9e1 100644 | |
--- a/libraries/classes/ThemeGenerator.php | |
+++ b/libraries/classes/ThemeGenerator.php | |
@@ -98,12 +98,19 @@ class ThemeGenerator | |
$common->createCommonFile($name); | |
$out['layout'] = $layout->createLayoutFile($post); | |
$nav->createNavigationFile($name); | |
- } else { | |
- trigger_error("The 'themes' directory is not writable by the webserver process. You must change permissions for the theme generator to be able to write the generated theme.", E_USER_ERROR); | |
} | |
return $out; | |
} | |
+ public function testWritableThemeDirectory() | |
+ { | |
+ clearstatcache(); | |
+ if (! is_writable('themes')) | |
+ { | |
+ trigger_error(__("The 'themes' directory is not writable by the webserver process. You must change permissions for the theme generator to be able to write the generated theme."), E_USER_WARNING); | |
+ } | |
+ } | |
+ | |
/** | |
* Creates theme.json | |
* | |
diff --git a/theme_generator.php b/theme_generator.php | |
index b0584cdc4d..7f96423c99 100644 | |
--- a/theme_generator.php | |
+++ b/theme_generator.php | |
@@ -18,6 +18,7 @@ $scripts->addFile('theme_generator/preview.js'); | |
$theme = new ThemeGenerator(); | |
+$response->addHTML($theme->testWritableThemeDirectory()); | |
$response->addHTML($theme->colorPicker()); | |
$response->addHTML($theme->form()); | |
$response->addHTML($theme->tablePreview()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment