Commit 3b3d2321 authored by Aria Givi's avatar Aria Givi
Browse files

alle dateien werden in array gespeichert um eine auswahl der datei zu ermoeglichen

parent f4893719
......@@ -146,9 +146,12 @@ class LanguageController extends Controller
public function createSynopticEditPage(Request $request, $exclude = "")
{
$languageFolders = scandir($this->languageFilePath);
# Enthält zu jeder Sprache ein Objekt mit allen Daten
$languageObjects = [];
$to = []; # Alle vorhandenen Sprachen
# Alle vorhandenen Sprachen
$to = [];
# Dekodieren ausgeschlossener Dateien anhand des URL-Parameters
$ex = $this->decodeExcludedFiles($exclude);
......@@ -159,12 +162,15 @@ class LanguageController extends Controller
$languageObjects[$folder] = new LanguageObject($folder, $this->languageFilePath.$folder);
}
}
$fileNames = [];
# Speichere Daten in LanguageObject, überspringe ausgeschlossene Dateien
foreach ($languageObjects as $folder => $languageObject) {
$to[] = $folder;
$di = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($languageObject->filePath));
foreach($di as $filename => $file) {
if(!$this->endsWith($filename, ".") && !in_array(basename($filename), $fileNames)) {
$fileNames[] = basename($filename);
}
foreach($ex['files'] as $file) {
if($file === basename($filename)) {
continue 2;
......@@ -226,6 +232,7 @@ class LanguageController extends Controller
->with('texts', $snippets) # Array mit Sprachsnippets
->with('filename', $fn) # Name der Datei
->with('recentlyChangedFiles', $recentlyChangedFiles)
->with('otherFiles', $fileNames) # Namen der restlichen Sprachdateien
->with('title', trans('titles.languages.edit'));
}
......
......@@ -9,6 +9,7 @@ class LanguageObject
{
public $language = "";
# bspw. /home/MetaGer/resources/lang/de
public $filePath = "";
# 2D-Array der Form [$filename][$key]
......
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