From b67fc78a348785510cd99520644e65273f4cbfb1 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 19 Aug 2020 12:55:47 +0200 Subject: [PATCH 01/14] Update ModuleInfo.tmpl.php --- src/Templates/ModuleInfo.tmpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 39674e63..69f78528 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -47,7 +47,7 @@ From d429787b193a85c15d893d260b7359aba15fc5ed Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 11:54:49 +0200 Subject: [PATCH 02/14] Heading and other fixes - fix: headings not looking good with module icon - fix: module images being too long - fix: remove unnecessary html containers - fix: remove inline css - fix: change loading text to german equivelant - style: change the text cursor of badges to default cursor - style: cleaned up some unnecessary code --- src/Templates/ModuleInfo.tmpl.php | 562 +++++++++++++++--------------- src/Templates/Styles/style.css | 99 ++---- 2 files changed, 318 insertions(+), 343 deletions(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index 70c7e95c..fbe58350 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -18,319 +18,317 @@
-
-
- - -
-
-
- -
+ + +
+
+
+ -

getName() ?>

+

getName() ?>

+
+
+
getImageUris()) { ?> -
- getImageUris() as $image) { ?> -
- - - -
- -
+ getImageUris() as $image) { ?> +
+ + + +
+ +
+
- - - + + + -
- - - +
+ + + - isCompatible()) { ?> - + isCompatible()) { ?> + + + + + Update installieren + + + + + + Änderungen verwerfen + + Änderungen übernehmen (Link-Mode) + + + - - Update installieren - + + Download & Install - - - - Änderungen verwerfen - - Änderungen übernehmen (Link-Mode) - - - - + + Download (inkompatible Version) - - Download & Install + + Deinstallieren - - Download (inkompatible Version) + + Installieren - - Deinstallieren + + Installieren (inkompatible Version) - - Installieren + getInstalledVersion()) { ?> + getVersion() != $module->getVersion()) { ?> + Zur installierten Version + + - - Installieren (inkompatible Version) + isRemote() && $module->isLoaded() && !$module->isInstalled()) { ?> + Modul löschen + +
+
+
- getInstalledVersion()) { ?> - getVersion() != $module->getVersion()) { ?> - Zur installierten Version - - +
+ - isRemote() && $module->isLoaded() && !$module->isInstalled()) { ?> - Modul löschen - +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
VersiongetVersion(); ?>
PreisgetPriceFormated(); ?>
Kompatibel mit Modified + getModifiedCompatibility()) { ?> + getModifiedCompatibility() as $version) { ?> + + + + + + unbekannt + +
Entwickler + getDeveloper() && $module->getDeveloperWebsite()) { ?> + getDeveloper() ?> + getDeveloper()) { ?> + getDeveloper() ?> + + unbekannter Entwickler + +
-
-
-
-
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - -
VersiongetVersion(); ?>
PreisgetPriceFormated(); ?>
Kompatibel mit Modified - getModifiedCompatibility()) { ?> - getModifiedCompatibility() as $version) { ?> - - - - - - unbekannt - -
Entwickler - getDeveloper() && $module->getDeveloperWebsite()) { ?> - getDeveloper() ?> - getDeveloper()) { ?> - getDeveloper() ?> - - unbekannter Entwickler - -
-
- -
-

Beschreibung

-

- getDescription()) { ?> - getDescription() ?> - - keine Beschreibung vorhanden - -

-
-
- -
-
- loading ... -
-
- +
+
+ Wird geladen. Bitte warten... +
+
+ -
-
- loading ... -
-
- +
+
+ Wird geladen. Bitte warten... +
+
+ -
-
- loading ... -
-
- - -
-
- - - - - - - - - - - - - - - - - - getTags()) { ?> - - - - +
+
+ Wird geladen. Bitte warten... +
+
+ + +
+
+
ArchivnamegetArchiveName(); ?>
VersiongetVersion(); ?>
Kompatibel mit Modified - getModifiedCompatibility()) { ?> - getModifiedCompatibility() as $version) { ?> - - - - unbekannt - -
Tags - getTags()) as $tag) { ?> - - -
+ + + + + + + + + + + + + + + + + getTags()) { ?> + + + + + - - - - - - - - - - - - - - - - - - - - -
ArchivnamegetArchiveName(); ?>
VersiongetVersion(); ?>
Kompatibel mit Modified + getModifiedCompatibility()) { ?> + getModifiedCompatibility() as $version) { ?> + + + + unbekannt +
Tags + getTags()) as $tag) { ?> + + +
Entwickler - getDeveloper() && $module->getDeveloperWebsite()) { ?> - getDeveloper() ?> - getDeveloper()) { ?> - getDeveloper() ?> - - unbekannter Entwickler - -
Alle Versionen - getVersions() as $moduleVersion) {?> - getVersion(); ?> - isInstalled()) { ?> - installiert - isLoaded()) { ?> - geladen - - nicht geladen - -
- -
Benötigt - getRequire()) { ?> - getRequire() as $archiveName => $version) { ?> - :
- - - keine Abhängigkeit vorhanden - -
Benutzt von - getUsedBy()) { ?> - getUsedBy() as $usedBy) { ?> - getArchiveName()?>: getVersion() ?>
- - - wird von keinem Modul verwendet - -
-
-
+ + Entwickler + + getDeveloper() && $module->getDeveloperWebsite()) { ?> + getDeveloper() ?> + getDeveloper()) { ?> + getDeveloper() ?> + + unbekannter Entwickler + + + + + + Alle Versionen + + getVersions() as $moduleVersion) {?> + getVersion(); ?> + isInstalled()) { ?> + installiert + isLoaded()) { ?> + geladen + + nicht geladen + +
+ + + + + + Benötigt + + getRequire()) { ?> + getRequire() as $archiveName => $version) { ?> + :
+ + + keine Abhängigkeit vorhanden + + + + + + Benutzt von + + getUsedBy()) { ?> + getUsedBy() as $usedBy) { ?> + getArchiveName()?>: getVersion() ?>
+ + + wird von keinem Modul verwendet + + + + + +
+
-
-

Geänderte Dateien

+
+

Geänderte Dateien

- isInstalled() && $module->isChanged()) { ?> + isInstalled() && $module->isChanged()) { ?> - getChancedFiles() as $file => $mode) { ?> - + getChancedFiles() as $file => $mode) { ?> + -
:
-
- - - keine Änderungen vorhanden +
:
+
-
-
+ + keine Änderungen vorhanden +
diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 1c1d7427..bfecdc40 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -9,6 +9,14 @@ --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; --colourLight: #777; + --colourBorder: #d9d9d9; + --colourBorderLight: #f4f4f4; + + /** + * Apply bootstrap colour + */ + --colourGreen: var(--green); + --colourOrange: var(--orange); --radiusDefault: 4px; @@ -71,6 +79,10 @@ section { margin: 4em 0; } +.badge { + cursor: default; +} + /** * Tooltip @@ -327,24 +339,6 @@ section { text-decoration: underline; } -.moduleinfo h1 { - font-weight: normal; - margin-bottom: var(--gutterDefault); -} - -.module-listing h1 { - font-weight: normal; - border-bottom: 1px solid #cccccc; - font-size: 2em; -} - -.module-listing h2 { - font-weight: normal; - font-size: 1.5em; - margin-bottom: var(--gutterDefault); - margin-top: var(--gutterDefault); -} - .module-listing .search { margin-bottom: 25px; } @@ -356,46 +350,50 @@ section { border: 1px solid #cccccc; } -.content .moduleinfo .moduleinfo-row { +.content .module-title { + display: flex; + flex-flow: row nowrap; + align-items: flex-start; +} + +.content .module-title img { + margin: 0.4rem 0.8rem 0.4rem 0.4rem; + height: 4rem; +} + +.content .moduleinfo-row { padding-bottom: var(--paddingDefault); border-bottom: 1px solid #cccccc; margin-bottom: var(--gutterDefault); } -.content .moduleinfo .moduleinfo-row .info-heading { +.content .moduleinfo-row .info-heading { display: inline-block; font-weight: bold; width: 300px; float: left; } -.content .moduleinfo .moduleinfo-row .info-body { +.content .moduleinfo-row .info-body { padding-left: 300px; } -.content .moduleinfo .moduleinfo-images { +.content .moduleinfo-images { padding-bottom: var(--paddingDefault); } -.content .moduleinfo .moduleinfo-images img { - -width: 300px; +.content .moduleinfo-images img { width: 100%; + max-height: 128px; border: 1px solid #cccccc; } -.content .moduleinfo .module-icon img { - float: left; - margin-right: 10px; - height: 32px; - margin-top: 8px -} - -.moduleinfo .button { +.content .button { margin: 0px; margin-right: 10px; } -.content .moduleinfo .moduleinfo-buttons { +.content .moduleinfo-buttons { margin-bottom: var(--gutterDefault); padding-bottom: var(--paddingDefault); border-bottom: 1px solid #cccccc; @@ -413,37 +411,16 @@ section { font-weight: bold; } +/** + * Markdown + */ .markdown h1 { - border: none; -} + margin: initial; -.markdown h2 { - font-weight: normal; - margin-top: 60px; -} - -.markdown h3 { - font-weight: normal; - margin-top: 40px; -} + font-size: 3rem; + text-transform: none; -.markdown.changelog h3 { - font-weight: bold; - margin-top: 16px; - font-size: 18px; -} - -.markdown h4 { - font-weight: normal; - margin-top: var(--gutterDefault); -} - -.markdown hr { - margin: 40px 0px 40px; - border: none; - border-top: 1px dashed #cccccc; - height: 0px; - background-color: none; + opacity: 1; } .markdown table { From 3cea0c12b6b3e1674e69343acd3aff391042fa01 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 13:07:24 +0200 Subject: [PATCH 03/14] Fix headings not looking good --- src/Templates/ModuleInfo.tmpl.php | 2 +- src/Templates/Styles/style.css | 48 ++++++++++++++++++++++--------- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/Templates/ModuleInfo.tmpl.php b/src/Templates/ModuleInfo.tmpl.php index fbe58350..9f843061 100644 --- a/src/Templates/ModuleInfo.tmpl.php +++ b/src/Templates/ModuleInfo.tmpl.php @@ -190,7 +190,7 @@ getDescription()) { ?> getDescription() ?> - keine Beschreibung vorhanden + Keine Beschreibung vorhanden.

diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index bfecdc40..36c9c3ea 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -6,6 +6,8 @@ --paddingDefaultHalf: 10px; --paddingNavigation: 10px; + --sizeH1: 2.8rem; + --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; --colourLight: #777; @@ -67,18 +69,30 @@ input + p, .input-group + p { color: var(--colourLight); } -h1 { +h1, +h2, +h3, +h4, +h5, +h6 { margin-bottom: 1em; - - text-transform: uppercase; - font-size: 4rem; - opacity: 0.2; } +h1 { font-size: var(--sizeH1); } +h2 { font-size: 2.4rem; } +h3 { font-size: 2.0rem; } +h4 { font-size: 1.6rem; } +h5 { font-size: 1.2rem; } +h6 { font-size: 0.8rem; } + section { margin: 4em 0; } + +/** + * Badge + */ .badge { cursor: default; } @@ -339,6 +353,14 @@ section { text-decoration: underline; } + +/** + * Module list + */ +.module-listing h2 { + margin-bottom: 0.2em; +} + .module-listing .search { margin-bottom: 25px; } @@ -358,7 +380,7 @@ section { .content .module-title img { margin: 0.4rem 0.8rem 0.4rem 0.4rem; - height: 4rem; + height: var(--sizeH1); } .content .moduleinfo-row { @@ -414,13 +436,13 @@ section { /** * Markdown */ -.markdown h1 { - margin: initial; - - font-size: 3rem; - text-transform: none; - - opacity: 1; +.markdown h1, +.markdown h2, +.markdown h3, +.markdown h4, +.markdown h5, +.markdown h6 { + margin-bottom: 0.2em; } .markdown table { From 7e1f4f2bd263fe3147ec533331069c42eaa3c671 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:07:20 +0200 Subject: [PATCH 04/14] Fine tune headings --- src/Templates/Styles/style.css | 50 +++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index 36c9c3ea..bdf8d411 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -6,7 +6,7 @@ --paddingDefaultHalf: 10px; --paddingNavigation: 10px; - --sizeH1: 2.8rem; + --sizeH1: 2.0rem; --colourPrimary: #007bff; --colourPrimaryLight: #66b0f7; @@ -79,11 +79,11 @@ h6 { } h1 { font-size: var(--sizeH1); } -h2 { font-size: 2.4rem; } -h3 { font-size: 2.0rem; } -h4 { font-size: 1.6rem; } +h2 { font-size: 1.8rem; } +h3 { font-size: 1.6rem; } +h4 { font-size: 1.4rem; } h5 { font-size: 1.2rem; } -h6 { font-size: 0.8rem; } +h6 { font-size: 1.0rem; } section { margin: 4em 0; @@ -379,7 +379,7 @@ section { } .content .module-title img { - margin: 0.4rem 0.8rem 0.4rem 0.4rem; + margin: 0.2em 0.4em 0.2em 0.2em; height: var(--sizeH1); } @@ -402,11 +402,12 @@ section { .content .moduleinfo-images { padding-bottom: var(--paddingDefault); + margin: 0 -30px 0 -30px; } .content .moduleinfo-images img { width: 100%; - max-height: 128px; + max-height: 256px; border: 1px solid #cccccc; } @@ -415,12 +416,6 @@ section { margin-right: 10px; } -.content .moduleinfo-buttons { - margin-bottom: var(--gutterDefault); - padding-bottom: var(--paddingDefault); - border-bottom: 1px solid #cccccc; -} - .moduleinfo-row { line-height: 22px; } @@ -445,6 +440,35 @@ section { margin-bottom: 0.2em; } +.markdown h1 { font-size: 1.6rem; } +.markdown h2 { font-size: 1.4rem; } +.markdown h3 { font-size: 1.2rem; } +.markdown h4 { font-size: 1.0rem; } +.markdown h5 { font-size: 1.0rem; } +.markdown h6 { font-size: 1.0rem; } + +.markdown h1, +.markdown h2 { + border-bottom: 1px solid var(--colourBorder); +} + +.markdown h1 { + margin-bottom: 0.6em; + padding-bottom: 0.1em; +} + +.markdown h2 { + margin: 4rem 0 0.4em 0; + padding: 0 0 0.1em 0; +} + +.markdown hr { + margin: 2rem 1rem; + + border: unset; + border-top: 1px dashed var(--colourBorder); +} + .markdown table { border-collapse: collapse; } From b00c614e8f2c24e9c0baf41226854607f7750779 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:16:37 +0200 Subject: [PATCH 05/14] Add extra space to h2 --- src/Templates/Styles/style.css | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index bdf8d411..b4bfafd7 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -449,17 +449,14 @@ section { .markdown h1, .markdown h2 { - border-bottom: 1px solid var(--colourBorder); -} - -.markdown h1 { margin-bottom: 0.6em; padding-bottom: 0.1em; + + border-bottom: 1px solid var(--colourBorder); } .markdown h2 { - margin: 4rem 0 0.4em 0; - padding: 0 0 0.1em 0; + margin-top: 4rem; } .markdown hr { From bc369cfab4811ef4e19491b2b568895c6bb8f3bc Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 3 Sep 2020 14:20:21 +0200 Subject: [PATCH 06/14] Update style.css --- src/Templates/Styles/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Templates/Styles/style.css b/src/Templates/Styles/style.css index b4bfafd7..0997e8de 100644 --- a/src/Templates/Styles/style.css +++ b/src/Templates/Styles/style.css @@ -401,7 +401,7 @@ section { } .content .moduleinfo-images { - padding-bottom: var(--paddingDefault); + padding-bottom: 1rem; margin: 0 -30px 0 -30px; } From 75d2fb0abbc27a285528aa58aa187693e5b02e1c Mon Sep 17 00:00:00 2001 From: grandeljay Date: Thu, 12 Jan 2023 11:16:10 +0100 Subject: [PATCH 07/14] Allow defining the shop root --- config/_config.php | 12 +++++++++++- src/Classes/App.php | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/config/_config.php b/config/_config.php index 9583e0c2..e9a35aa9 100644 --- a/config/_config.php +++ b/config/_config.php @@ -24,5 +24,15 @@ * @param string selfUpdate stable, latest */ 'installMode' => 'copy', - 'selfUpdate' => 'stable' + 'selfUpdate' => 'stable', + + /** + * Settings revolving around your modified-shop + * + * Overwrite the default shop path. If your MMLC installation is not inside + * of your modified-shop root and exists as a symbolic link, you may need to + * define your shop root here. + * + * 'shopRoot' => '/path/to/modified-shop', + */ ]; diff --git a/src/Classes/App.php b/src/Classes/App.php index 07476545..bddf5eaa 100644 --- a/src/Classes/App.php +++ b/src/Classes/App.php @@ -40,7 +40,11 @@ public static function getRoot(): string public static function getShopRoot(): string { - return realPath(__DIR__ . '/../../../'); + $shopRoot = empty(Config::getOption('shopRoot')) + ? realpath(__DIR__ . '/../../../') + : rtrim(Config::getOption('shopRoot'), '/\\'); + + return $shopRoot; } public static function getSrcRoot(): string From 5ae50f000be38d25ff79c7f2bb50f4480eef0a1b Mon Sep 17 00:00:00 2001 From: grandeljay Date: Thu, 12 Jan 2023 13:08:53 +0100 Subject: [PATCH 08/14] Refactor --- src/Classes/App.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Classes/App.php b/src/Classes/App.php index bddf5eaa..bf535a07 100644 --- a/src/Classes/App.php +++ b/src/Classes/App.php @@ -40,11 +40,12 @@ public static function getRoot(): string public static function getShopRoot(): string { - $shopRoot = empty(Config::getOption('shopRoot')) - ? realpath(__DIR__ . '/../../../') - : rtrim(Config::getOption('shopRoot'), '/\\'); + $shopRootOption = Config::getOption('shopRoot'); + $shopRootDirectory = empty($shopRootOption) + ? realpath(__DIR__ . '/../../../') + : rtrim($shopRootOption, '/\\'); - return $shopRoot; + return $shopRootDirectory; } public static function getSrcRoot(): string From ccc686b5adbce02b6a5d7389897013adf6fe80d3 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Thu, 12 Jan 2023 16:35:24 +0100 Subject: [PATCH 09/14] Automatically determine the shop root --- config/_config.php | 12 +----------- src/Classes/App.php | 7 +------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/config/_config.php b/config/_config.php index e9a35aa9..9583e0c2 100644 --- a/config/_config.php +++ b/config/_config.php @@ -24,15 +24,5 @@ * @param string selfUpdate stable, latest */ 'installMode' => 'copy', - 'selfUpdate' => 'stable', - - /** - * Settings revolving around your modified-shop - * - * Overwrite the default shop path. If your MMLC installation is not inside - * of your modified-shop root and exists as a symbolic link, you may need to - * define your shop root here. - * - * 'shopRoot' => '/path/to/modified-shop', - */ + 'selfUpdate' => 'stable' ]; diff --git a/src/Classes/App.php b/src/Classes/App.php index bf535a07..d54bebd6 100644 --- a/src/Classes/App.php +++ b/src/Classes/App.php @@ -40,12 +40,7 @@ public static function getRoot(): string public static function getShopRoot(): string { - $shopRootOption = Config::getOption('shopRoot'); - $shopRootDirectory = empty($shopRootOption) - ? realpath(__DIR__ . '/../../../') - : rtrim($shopRootOption, '/\\'); - - return $shopRootDirectory; + return dirname(dirname($_SERVER['SCRIPT_FILENAME'])); } public static function getSrcRoot(): string From 677521c1317f8658e5a813ca1d800ef2b30041a5 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Fri, 13 Jan 2023 09:26:37 +0100 Subject: [PATCH 10/14] Revert "Automatically determine the shop root" This reverts commit ccc686b5adbce02b6a5d7389897013adf6fe80d3. --- config/_config.php | 12 +++++++++++- src/Classes/App.php | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/config/_config.php b/config/_config.php index 9583e0c2..e9a35aa9 100644 --- a/config/_config.php +++ b/config/_config.php @@ -24,5 +24,15 @@ * @param string selfUpdate stable, latest */ 'installMode' => 'copy', - 'selfUpdate' => 'stable' + 'selfUpdate' => 'stable', + + /** + * Settings revolving around your modified-shop + * + * Overwrite the default shop path. If your MMLC installation is not inside + * of your modified-shop root and exists as a symbolic link, you may need to + * define your shop root here. + * + * 'shopRoot' => '/path/to/modified-shop', + */ ]; diff --git a/src/Classes/App.php b/src/Classes/App.php index d54bebd6..bf535a07 100644 --- a/src/Classes/App.php +++ b/src/Classes/App.php @@ -40,7 +40,12 @@ public static function getRoot(): string public static function getShopRoot(): string { - return dirname(dirname($_SERVER['SCRIPT_FILENAME'])); + $shopRootOption = Config::getOption('shopRoot'); + $shopRootDirectory = empty($shopRootOption) + ? realpath(__DIR__ . '/../../../') + : rtrim($shopRootOption, '/\\'); + + return $shopRootDirectory; } public static function getSrcRoot(): string From 25add0215be4af90099fa20079c0cf420968d9f5 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Fri, 13 Jan 2023 09:54:44 +0100 Subject: [PATCH 11/14] Fix missing log directory --- src/Classes/Api/V1/HttpRequest.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Classes/Api/V1/HttpRequest.php b/src/Classes/Api/V1/HttpRequest.php index 1cf86f65..1d8da5db 100644 --- a/src/Classes/Api/V1/HttpRequest.php +++ b/src/Classes/Api/V1/HttpRequest.php @@ -46,7 +46,14 @@ public function sendPostRequest(string $url, $data) // Logging if ($this->logging) { - file_put_contents(App::getLogsRoot() . '/log.txt', $result); + $logFilepath = App::getLogsRoot() . '/log.txt'; + $logDirectory = dirname($logFilepath); + + if (!file_exists($logDirectory)) { + mkdir($logDirectory); + } + + file_put_contents($logFilepath, $result); } return $result; From 6d3867bfa3040ec983cd133e4ae2c03e3a33ee7e Mon Sep 17 00:00:00 2001 From: grandeljay Date: Fri, 13 Jan 2023 09:55:31 +0100 Subject: [PATCH 12/14] Trim white spaces --- src/Templates/Settings.tmpl.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Templates/Settings.tmpl.php b/src/Templates/Settings.tmpl.php index ec07e2c5..7506565a 100644 --- a/src/Templates/Settings.tmpl.php +++ b/src/Templates/Settings.tmpl.php @@ -73,7 +73,7 @@ function viewIsSelected(bool $value): string

Mit diesem Namen meldest du dich im MMLC an.

- +
@@ -104,7 +104,7 @@ function viewIsSelected(bool $value): string - +

Du kannst zwischen copy und link wählen. Hast du den MMLC in einem Live-Shop im Einsatz, wähle copy. Wenn du mit dem MMLC Module entwickelst, wähle link.

@@ -126,7 +126,7 @@ function viewIsSelected(bool $value): string $(tabId).tab('show') }) - + From d0c0cc1305a3a5bc8636ea6bfb5326087edfbf2f Mon Sep 17 00:00:00 2001 From: grandeljay Date: Fri, 13 Jan 2023 10:11:29 +0100 Subject: [PATCH 13/14] Set a default, empty shop root --- config/_config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/_config.php b/config/_config.php index e9a35aa9..1a356b9e 100644 --- a/config/_config.php +++ b/config/_config.php @@ -33,6 +33,7 @@ * of your modified-shop root and exists as a symbolic link, you may need to * define your shop root here. * - * 'shopRoot' => '/path/to/modified-shop', + * Leave empty for default. */ + 'shopRoot' => '', ]; From b8bb530ab767baf7f0d35347e8de0f1b589cc9e7 Mon Sep 17 00:00:00 2001 From: grandeljay Date: Fri, 13 Jan 2023 10:12:18 +0100 Subject: [PATCH 14/14] Add shop root UI option --- src/Classes/App.php | 7 +------ src/Classes/Config.php | 20 ++++++++++++++++++++ src/Classes/IndexController.php | 4 ++++ src/Templates/Settings.tmpl.php | 7 +++++++ 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/Classes/App.php b/src/Classes/App.php index bf535a07..14790422 100644 --- a/src/Classes/App.php +++ b/src/Classes/App.php @@ -40,12 +40,7 @@ public static function getRoot(): string public static function getShopRoot(): string { - $shopRootOption = Config::getOption('shopRoot'); - $shopRootDirectory = empty($shopRootOption) - ? realpath(__DIR__ . '/../../../') - : rtrim($shopRootOption, '/\\'); - - return $shopRootDirectory; + return Config::getShopRoot(); } public static function getSrcRoot(): string diff --git a/src/Classes/Config.php b/src/Classes/Config.php index a7dc7e40..4699fb0e 100644 --- a/src/Classes/Config.php +++ b/src/Classes/Config.php @@ -225,6 +225,26 @@ public static function setAdminDir(string $newAdminDir): void self::writeConfiguration(['adminDir' => $newAdminDir]); } + /** + * Get the modified-shop root directory. + * + * @return string + */ + public static function getShopRoot(): string + { + $shopRootOption = self::getOption('shopRoot'); + $shopRootDirectory = empty($shopRootOption) + ? realpath(__DIR__ . '/../../../') + : rtrim($shopRootOption, '/\\'); + + return $shopRootDirectory; + } + + public static function setShopRoot(string $newShopRoot): void + { + self::writeConfiguration(['shopRoot' => $newShopRoot]); + } + /** * Get modulesLocalDir from config. * diff --git a/src/Classes/IndexController.php b/src/Classes/IndexController.php index 8eb4a284..eb95ebd2 100644 --- a/src/Classes/IndexController.php +++ b/src/Classes/IndexController.php @@ -602,6 +602,10 @@ public function invokeSettings() Config::setAccessToken($parsedBody['accessToken']); } + if (isset($parsedBody['shopRoot'])) { + Config::setShopRoot($parsedBody['shopRoot']); + } + if (isset($parsedBody['modulesLocalDir'])) { Config::setModulesLocalDir($parsedBody['modulesLocalDir']); } diff --git a/src/Templates/Settings.tmpl.php b/src/Templates/Settings.tmpl.php index 7506565a..e10665c5 100644 --- a/src/Templates/Settings.tmpl.php +++ b/src/Templates/Settings.tmpl.php @@ -90,6 +90,13 @@ function viewIsSelected(bool $value): string

Erweitert

+ +
+ + +

Verzeichnis vom modified-shop. Lasse dieses Feld leer für die Standard Einstellung.

+
+