mikuli.cz

:)
git clone https://git.sr.ht/~ashymad/mikuli.cz
Log | Files | Refs

commit e386c5fd9729bd2c6d5c5e3f378e9e2cdea2fe8e
parent 3279aed045314c24c2ccc1514ff1099f6d573f84
Author: markseu <mark2011@mayberg.se>
Date:   Mon, 22 Apr 2019 11:06:04 +0200

Refactored code, sunshine remix

Diffstat:
Msystem/extensions/install.php | 26++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/system/extensions/install.php b/system/extensions/install.php @@ -188,20 +188,18 @@ class YellowInstall { // Update content public function updateContent($language, $name, $location) { $statusCode = 200; - if ($language!="en") { - $fileName = $this->yellow->lookup->findFileFromLocation($location); - $fileData = strreplaceu("\r\n", "\n", $this->yellow->toolbox->readFile($fileName)); - if (!empty($fileData)) { - $titleOld = "Title: ".$this->yellow->text->getText("install{$name}Title", "en"); - $titleNew = "Title: ".$this->yellow->text->getText("install{$name}Title", $language); - $textOld = strreplaceu("\\n", "\n", $this->yellow->text->getText("install{$name}Text", "en")); - $textNew = strreplaceu("\\n", "\n", $this->yellow->text->getText("install{$name}Text", $language)); - if ($name!="Footer") $fileData = strreplaceu($titleOld, $titleNew, $fileData); - $fileData = strreplaceu($textOld, $textNew, $fileData); - if (!$this->yellow->toolbox->createFile($fileName, $fileData)) { - $statusCode = 500; - $this->yellow->page->error($statusCode, "Can't write file '$fileName'!"); - } + $fileName = $this->yellow->lookup->findFileFromLocation($location); + $fileData = strreplaceu("\r\n", "\n", $this->yellow->toolbox->readFile($fileName)); + if (!empty($fileData) && $language!="en") { + $titleOld = "Title: ".$this->yellow->text->getText("install{$name}Title", "en"); + $titleNew = "Title: ".$this->yellow->text->getText("install{$name}Title", $language); + $textOld = strreplaceu("\\n", "\n", $this->yellow->text->getText("install{$name}Text", "en")); + $textNew = strreplaceu("\\n", "\n", $this->yellow->text->getText("install{$name}Text", $language)); + if ($name!="Footer") $fileData = strreplaceu($titleOld, $titleNew, $fileData); + $fileData = strreplaceu($textOld, $textNew, $fileData); + if (!$this->yellow->toolbox->createFile($fileName, $fileData)) { + $statusCode = 500; + $this->yellow->page->error($statusCode, "Can't write file '$fileName'!"); } } return $statusCode;