Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open-source
MetaGer
Commits
28606856
Commit
28606856
authored
7 years ago
by
Aria Givi
Browse files
Options
Downloads
Patches
Plain Diff
Dateien lassen sich herunterladen, fehlt noch das archivieren und runterladen mehrerer Dateien
parent
ac67270e
No related branches found
Branches containing commit
No related tags found
2 merge requests
!912
Development
,
!904
Resolve "Arbeit am Übersetzungstool"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Http/Controllers/MailController.php
+35
-8
35 additions, 8 deletions
app/Http/Controllers/MailController.php
resources/views/languages/synoptic.blade.php
+2
-1
2 additions, 1 deletion
resources/views/languages/synoptic.blade.php
with
37 additions
and
9 deletions
app/Http/Controllers/MailController.php
+
35
−
8
View file @
28606856
...
...
@@ -262,17 +262,38 @@ class MailController extends Controller
$editedFiles
[
$langdir
]
=
$filename
;
}
#Überspringe Datei, falls diese nicht bearbeitet worden ist
if
(
!
isset
(
$editedFiles
[
$langdir
]))
{
continue
;
}
#Key verarbeiten, sodass er nur den eigentlichen Keynamen enthält
$key
=
$this
->
processKey
(
$key
);
$data
[
$langdir
][
$key
]
=
$value
;
#Aufdröseln von 2D-Arrays
if
(
!
strpos
(
$key
,
"#"
))
{
$data
[
$langdir
][
$key
]
=
$value
;
}
else
{
$ref
=
&
$data
;
do
{
$ref
=
&
$ref
[
$langdir
][
substr
(
$key
,
0
,
strpos
(
$key
,
"#"
))];
$key
=
substr
(
$key
,
strpos
(
$key
,
"#"
)
+
1
);
}
while
(
strpos
(
$key
,
"#"
));
$ref
=
&
$ref
[
$key
];
$ref
=
$value
;
}
}
$output
=
json_encode
(
$data
,
JSON_PRETTY_PRINT
|
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
$output
=
preg_replace
(
"/\{/si"
,
"["
,
$output
);
$output
=
preg_replace
(
"/\}/si"
,
"]"
,
$output
);
$output
=
preg_replace
(
"/
\"
: ([
\"
\[])/si"
,
"
\"\t
=>
\t
$1"
,
$output
);
$output
=
"<?php
\n\n
return
$output
;
\n
"
;
#Erstelle Ausgabedateien
foreach
(
$data
as
$lang
=>
$entries
)
{
$output
[
$lang
]
=
json_encode
(
$entries
,
JSON_PRETTY_PRINT
|
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
$output
[
$lang
]
=
preg_replace
(
"/\{/si"
,
"["
,
$output
[
$lang
]);
$output
[
$lang
]
=
preg_replace
(
"/\}/si"
,
"]"
,
$output
[
$lang
]);
$output
[
$lang
]
=
preg_replace
(
"/
\"
: ([
\"
\[])/si"
,
"
\"\t
=>
\t
$1"
,
$output
[
$lang
]);
$output
[
$lang
]
=
"<?php
\n\n
return
$output[$lang]
;
\n
"
;
}
$ex
=
[];
if
(
$exclude
!==
""
)
{
try
{
...
...
@@ -297,7 +318,13 @@ class MailController extends Controller
$ex
=
base64_encode
(
serialize
(
$ex
));
return
redirect
(
url
(
'synoptic'
,
[
'exclude'
=>
$ex
]));
$zip
=
new
ZipArchive
();
return
response
()
->
make
(
$output
[
"fr"
])
->
header
(
"Content-type"
,
"text/plain; charset=utf-8"
)
->
header
(
"Content-disposition"
,
"attachment; filename=
\"
"
.
$filename
.
"
\"
"
);
//return response()->download($output["fr"], $filename);
//return redirect(url('synoptic', ['exclude' => $ex]));
}
...
...
This diff is collapsed.
Click to expand it.
resources/views/languages/synoptic.blade.php
+
2
−
1
View file @
28606856
...
...
@@ -52,7 +52,8 @@
<p>{!! trans('languages.hinweis.3') !!}</p>
<p>{!! trans('languages.email') !!}</p>
-->
<button
class=
"btn btn-success"
type=
"submit"
form=
"submit"
>
Daten übermitteln
</button>
<button
class=
"btn btn-success"
type=
"submit"
form=
"submit"
>
Dateien herunterladen
</button>
<button
class=
"btn btn-success"
type=
"submit"
form=
"submit"
>
Nächste Seite
</button>
<script
type=
"text/javascript"
src=
"{{ elixir('js/lib.js') }}"
></script>
<script
type=
"text/javascript"
src=
"{{ elixir('js/editLanguage.js') }}"
></script>
@endsection
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment