Commit 83cf190d authored by Aria Givi's avatar Aria Givi
Browse files

Text felder der zuletzt veraenderten Dateien werden eingefaerbt

parent 7d345395
......@@ -190,11 +190,17 @@ class LanguageController extends Controller
}
$snippets = [];
$changeTime = 0;
$recentlyChangedFiles = [];
# Speichere den Inhalt der ausgewählten Datei in allen Sprachen in $snippets ab
foreach($languageObjects as $folder => $languageObject) {
foreach($languageObject->stringMap as $languageFileName => $languageFile) {
if($languageFileName === $fn) {
if($changeTime <= filemtime($languageObject->filePath."/".$languageFileName)) {
$changeTime = filemtime($languageObject->filePath."/".$languageFileName);
$recentlyChangedFiles[] = $languageObject->language;
}
foreach($languageFile as $key => $value) {
$snippets[$key][$languageObject->language] = $value;
}
......@@ -203,7 +209,7 @@ class LanguageController extends Controller
}
}
# Fülle $snippets auf mit leeren Einträgen für übrige Sprachen
# Fülle $snippets auf mit leeren Einträgen für die restlichen Sprachen
foreach($to as $t) {
foreach($snippets as $key => $langArray) {
if(!isset($langArray[$t])) {
......@@ -211,11 +217,12 @@ class LanguageController extends Controller
}
}
}
return view('languages.synoptic')
->with('to', $to) # Alle vorhandenen Sprachen
->with('texts', $snippets) # Array mit Sprachsnippets
->with('filename', $fn) # Name der Datei
->with('recentlyChangedFiles', $recentlyChangedFiles)
->with('title', trans('titles.languages.edit'));
}
......
......@@ -11,7 +11,7 @@ class LanguageObject
public $filePath = "";
#2D-Array der Form [$filename][$key]
# 2D-Array der Form [$filename][$key]
public $stringMap = [];
public function __construct($lang, $path)
......
......@@ -32,9 +32,15 @@
<td class="name language-name">{{$key}}</td>
@foreach($language as $lang => $languageValue)
@if($languageValue !== "")
<td>
<textarea class="language-text-area" rows="1" cols="20" form="submit" name="{{base64_encode($lang."_".$key)}}">{{$languageValue}}</textarea>
</td>
@if(in_array($lang, $recentlyChangedFiles))
<td>
<textarea class="language-text-area" rows="1" cols="20" style="background-color: Khaki;" form="submit" name="{{base64_encode($lang."_".$key)}}">{{$languageValue}}</textarea>
</td>
@else
<td>
<textarea class="language-text-area" rows="1" cols="20" form="submit" name="{{base64_encode($lang."_".$key)}}">{{$languageValue}}</textarea>
</td>
@endif
@else
<td>
<textarea class="language-text-area" rows="1" cols="20" form="submit" name="{{base64_encode("_new_".$lang."_".$key)}}"></textarea>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment