Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
e16191e3
Commit
e16191e3
authored
Jun 15, 2016
by
Dominik Hebeler
Browse files
Settings Seite zeigt nun nur noch verfügbare Suchmaschinen aus der XML-Datei
parent
8c5bb58f
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/StartpageController.php
View file @
e16191e3
...
...
@@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
Response
;
use
App
;
class
StartpageController
extends
Controller
{
...
...
@@ -96,4 +97,50 @@ class StartpageController extends Controller
return
$response
;
return
$link
;
}
public
function
loadSettings
(
Request
$request
)
{
$sumaFile
=
""
;
if
(
App
::
isLocale
(
'en'
))
$sumaFile
=
config_path
()
.
"/sumasEn.xml"
;
else
$sumaFile
=
config_path
()
.
"/sumas.xml"
;
$xml
=
simplexml_load_file
(
$sumaFile
);
$sumas
=
$xml
->
xpath
(
"suma"
);
$foki
=
[];
foreach
(
$sumas
as
$suma
)
{
if
(
(
!
isset
(
$suma
[
'disabled'
])
||
$suma
[
'disabled'
]
===
""
)
&&
(
!
isset
(
$suma
[
'userSelectable'
])
||
$suma
[
'userSelectable'
]
->
__toString
()
===
"1"
)
)
{
if
(
isset
(
$suma
[
'type'
])
)
{
$f
=
explode
(
","
,
$suma
[
'type'
]
->
__toString
());
foreach
(
$f
as
$tmp
)
{
$displayName
=
$suma
[
'displayName'
]
->
__toString
();
$url
=
isset
(
$suma
[
'homepage'
])
?
$suma
[
'homepage'
]
->
__toString
()
:
"https://metager.de"
;
$service
=
$suma
[
'service'
]
->
__toString
();
$foki
[
$tmp
][
$suma
[
'name'
]
->
__toString
()]
=
[
'displayName'
=>
$displayName
,
'url'
=>
$url
,
'service'
=>
$service
];
}
}
else
{
$displayName
=
$suma
[
'displayName'
]
->
__toString
();
$url
=
isset
(
$suma
[
'homepage'
])
?
$suma
[
'homepage'
]
->
__toString
()
:
"https://metager.de"
;
$service
=
$suma
[
'service'
]
->
__toString
();
$foki
[
"andere"
][
$suma
[
'name'
]
->
__toString
()]
=
[
'displayName'
=>
$displayName
,
'url'
=>
$url
,
'service'
=>
$service
];
}
}
}
return
view
(
'settings1'
)
->
with
(
'foki'
,
$foki
)
->
with
(
'title'
,
'Einstellungen'
)
->
with
(
'css'
,
'settings.css'
)
->
with
(
'js'
,
[
'settings.js'
]);
die
(
var_dump
(
$foki
));
return
$xml
->
saveXML
();
}
}
\ No newline at end of file
app/Http/routes.php
View file @
e16191e3
...
...
@@ -86,13 +86,7 @@
->
with
(
'css'
,
'widget.css'
);
});
Route
::
get
(
'settings'
,
function
()
{
return
view
(
'settings'
)
->
with
(
'title'
,
trans
(
'titles.settings'
))
->
with
(
'css'
,
'settings.css'
)
->
with
(
'js'
,
[
'settings.js'
]);
});
Route
::
get
(
'settings'
,
'StartpageController@loadSettings'
);
Route
::
get
(
'meta/meta.ger3'
,
'MetaGerSearch@search'
);
...
...
resources/views/settings1.blade.php
0 → 100644
View file @
e16191e3
@
extends
(
'layouts.subPages'
)
@
section
(
'title'
,
$title
)
@
section
(
'content'
)
<
form
action
=
"/"
method
=
"get"
>
<
h1
>
{{
trans
(
'settings.head.1'
)
}}
</
h1
>
<
p
id
=
"lead"
>
{{
trans
(
'settings.head.2'
)
}}
<
a
href
=
"#unten"
>
{{
trans
(
'settings.head.3'
)
}}
</
a
>
{{
trans
(
'settings.head.4'
)
}}
</
p
>
<
h2
>
{{
trans
(
'settings.allgemein.1'
)
}}
</
h2
>
<
input
type
=
"hidden"
name
=
"focus"
value
=
"angepasst"
>
<
div
class
=
"checkbox"
>
<
label
>
<
input
type
=
"checkbox"
name
=
"param_sprueche"
>
{{
trans
(
'settings.allgemein.2'
)
}}
</
label
></
div
>
<
div
class
=
"checkbox"
>
<
label
>
<
input
type
=
"checkbox"
name
=
"param_tab"
>
{{
trans
(
'settings.allgemein.3'
)
}}
</
label
></
div
>
<
label
class
=
"select-label"
>
{{
trans
(
'settings.allgemein.4'
)
}}
:</
label
>
<
select
class
=
"form-control"
name
=
"param_lang"
>
<
option
value
=
"all"
>
{{
trans
(
'settings.allgemein.5'
)
}}
</
option
>
<
option
value
=
"de"
>
{{
trans
(
'settings.allgemein.6'
)
}}
</
option
></
select
>
<
label
class
=
"select-label"
>
{{
trans
(
'settings.allgemein.7'
)
}}
:</
label
>
<
select
class
=
"form-control"
name
=
"param_resultCount"
>
<
option
value
=
"10"
>
10
</
option
>
<
option
value
=
"20"
selected
>
20
</
option
>
<
option
value
=
"50"
>
50
</
option
>
<
option
value
=
"100"
>
100
</
option
>
<
option
value
=
"0"
>
{{
trans
(
'settings.allgemein.8'
)
}}
</
option
></
select
>
<
label
class
=
"select-label"
>
{{
trans
(
'settings.allgemein.9'
)
}}
:</
label
>
<
select
class
=
"form-control"
name
=
"param_time"
>
<
option
value
=
"1000"
selected
>
1
{{
trans
(
'settings.allgemein.10'
)
}}
</
option
>
<
option
value
=
"2000"
>
2
{{
trans
(
'settings.allgemein.11'
)
}}
</
option
>
<
option
value
=
"5000"
>
5
{{
trans
(
'settings.allgemein.11'
)
}}
</
option
>
<
option
value
=
"10000"
>
10
{{
trans
(
'settings.allgemein.11'
)
}}
</
option
>
<
option
value
=
"20000"
>
20
{{
trans
(
'settings.allgemein.11'
)
}}
</
option
></
select
>
<
h2
>
{{
trans
(
'settings.suchmaschinen.1'
)
}}
</
h2
>
@
foreach
(
$foki
as
$fokus
=>
$sumas
)
<
div
class
=
"headingGroup {{
$fokus
}}"
>
<
h3
>
{{
ucfirst
(
$fokus
)
}}
<
small
>
<
a
class
=
"checker"
data
-
type
=
"{{
$fokus
}}"
>
(
alle
an
-/
abwählen
)
</
a
>
</
small
>
</
h3
>
<
div
class
=
"row"
>
@
foreach
(
$sumas
as
$name
=>
$data
)
<
div
class
=
"col-sm-6 col-md-4 col-lg-3"
>
<
div
class
=
"checkbox"
>
<
label
>
<
input
name
=
"param_{{
$data['service']
}}"
type
=
"checkbox"
/>
{{
$data
[
'displayName'
]
}}
</
label
>
<
a
class
=
"glyphicon glyphicon-link"
target
=
"_blank"
href
=
"{{
$data['url']
}}"
></
a
>
</
div
>
</
div
>
@
endforeach
</
div
>
</
div
>
@
endforeach
<
input
id
=
"unten"
type
=
"submit"
class
=
"btn btn-primary"
value
=
"Startseite für einmalige Nutzung generieren"
>
<
input
type
=
"button"
class
=
"btn btn-primary hidden"
id
=
"save"
value
=
"Einstellungen dauerhaft speichern"
>
<
input
id
=
"plugin"
type
=
"submit"
class
=
"btn btn-primary"
value
=
"Plugin mit diesen Einstellungen generieren."
>
<
input
type
=
"button"
class
=
"btn btn-danger hidden"
id
=
"reset"
value
=
"Einstellungen Zurücksetzen"
>
</
form
>
@
endsection
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment