diff --git a/app/Http/Controllers/MailController.php b/app/Http/Controllers/MailController.php index 2c7a35e76c0fbef4a251f1f86e9de8771b063963..393b50d33f88fa1a8ca5771f4986c668bdafec39 100644 --- a/app/Http/Controllers/MailController.php +++ b/app/Http/Controllers/MailController.php @@ -121,7 +121,6 @@ class MailController extends Controller public function isEdited($k, $v, $filename) { $temp = include resource_path()."/".$filename; - foreach ($temp as $key => $value) { if($k === $key && $v !== $value) { return true; @@ -219,6 +218,7 @@ class MailController extends Controller public function downloadModifiedLanguagefiles(Request $request, $exclude = "") { + $filename = $request->input('filename'); # Wir erstellen nun zunächst den Inhalt der Datei: $data = []; @@ -230,17 +230,15 @@ class MailController extends Controller if ($key === "filename" || $value === "") { continue; } - if($key === "email") { - $emailAddress = $value; - continue; - } $key = base64_decode($key); + #Pfad zur Datei anhand des Schlüsselnamens rekonstruieren (Schlüssel enthält Sprachkürzel) + $filename = "languages/".substr($key, strpos($key, "/_\w\w_/"), strripos($key, "_"))."/".$filename; if (strpos($key, "_new_") === 0 && $value !== "") { $new++; - $key = substr($key, strpos($key, "_new_") + 5); + $key = preg_filter("/_\w*_/", "", $key); $editedKeys = $editedKeys."\n".$key; - } + } else if ($this->isEdited($key, $value, $filename)) { $new++; $editedKeys = $editedKeys."\n".$key; @@ -293,8 +291,6 @@ class MailController extends Controller } - // var_dump($ex); - //die(); $ex = base64_encode(serialize($ex)); return redirect(url('synoptic', ['exclude' => $ex])); diff --git a/resources/views/languages/synoptic.blade.php b/resources/views/languages/synoptic.blade.php index f51b931734f2ba03a88e4757cc08dc0fb7b70559..ff59e4247e572a85734dd82849667bc56e188fc8 100644 --- a/resources/views/languages/synoptic.blade.php +++ b/resources/views/languages/synoptic.blade.php @@ -31,9 +31,9 @@ <tr> <!--Key --> <td class="name language-name">{{preg_replace("/(\s*).*#(.*)$/si", "$1$2", $key)}}</td> @foreach($language as $lang => $languageValue) - @if($lang === "de") + @if($languageValue !== "") <td> - <textarea class="language-text-area" rows="1" readonly cols="20" form="submit" name="{{base64_encode("_new_".$lang."_".$key)}}">{{ $languageValue }} </textarea> + <textarea class="language-text-area" rows="1" readonly cols="20" form="submit" name="{{base64_encode($lang."_".$key)}}">{{ $languageValue }} </textarea> </td> @else <td>