Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
42
Issues
42
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Packages
Packages
Container Registry
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
b1a09786
Commit
b1a09786
authored
Apr 12, 2019
by
Dominik Hebeler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
settings can now be deleted one by one or all at once
parent
15697a02
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
1 deletion
+54
-1
app/Http/Controllers/SettingsController.php
app/Http/Controllers/SettingsController.php
+22
-0
app/MetaGer.php
app/MetaGer.php
+1
-0
resources/views/settings/allSettings.blade.php
resources/views/settings/allSettings.blade.php
+28
-1
routes/cookie.php
routes/cookie.php
+3
-0
No files found.
app/Http/Controllers/SettingsController.php
View file @
b1a09786
...
...
@@ -218,4 +218,26 @@ class SettingsController extends Controller
->
with
(
'url'
,
$request
->
input
(
'url'
,
''
))
->
with
(
'sumaFile'
,
$sumaFile
);
}
public
function
removeOneSetting
(
Request
$request
)
{
$key
=
$request
->
input
(
'key'
,
''
);
$path
=
\Request
::
path
();
$cookiePath
=
"/"
.
substr
(
$path
,
0
,
strpos
(
$path
,
"meta/"
)
+
5
);
Cookie
::
queue
(
$key
,
""
,
0
,
$cookiePath
,
null
,
false
,
false
);
return
redirect
(
$request
->
input
(
'url'
,
'https://metager.de'
));
}
public
function
removeAllSettings
(
Request
$request
)
{
$path
=
\Request
::
path
();
$cookiePath
=
"/"
.
substr
(
$path
,
0
,
strpos
(
$path
,
"meta/"
)
+
5
);
foreach
(
Cookie
::
get
()
as
$key
=>
$value
)
{
Cookie
::
queue
(
$key
,
""
,
0
,
$cookiePath
,
null
,
false
,
false
);
}
return
redirect
(
$request
->
input
(
'url'
,
'https://metager.de'
));
}
}
app/MetaGer.php
View file @
b1a09786
...
...
@@ -524,6 +524,7 @@ class MetaGer
}
}
# Implements Yahoo Ads if Yahoo is not enabled as a searchengine
if
(
!
$this
->
apiAuthorized
&&
empty
(
$this
->
enabledSearchengines
[
"yahoo"
])
&&
$this
->
fokus
!=
"bilder"
&&
!
empty
(
$this
->
sumaFile
->
sumas
->
{
"yahoo-ads"
}))
{
$this
->
enabledSearchengines
[
"yahoo-ads"
]
=
$this
->
sumaFile
->
sumas
->
{
"yahoo-ads"
};
...
...
resources/views/settings/allSettings.blade.php
View file @
b1a09786
...
...
@@ -34,12 +34,39 @@
Ihr
Schlüssel
für
die
werbefreie
Suche
@
endif
</
td
>
<
td
></
td
>
<
td
>
<
form
action
=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('removeOneSetting')) }}"
method
=
"post"
>
<
input
type
=
"hidden"
name
=
"key"
value
=
"{{
$key
}}"
>
<
input
type
=
"hidden"
name
=
"url"
value
=
"{{ url()->full() }}"
>
<
button
type
=
"submit"
title
=
"Diesen Cookie entfernen"
>
<
i
class
=
"fas fa-trash-alt"
></
i
>
</
button
>
</
form
>
</
td
>
</
tr
>
@
endforeach
</
tbody
>
</
table
>
<
div
id
=
"actions"
>
<
a
href
=
"{{
$url
}}"
class
=
"btn btn-sm btn-default"
>
Zurück
zur
letzten
Seite
</
a
>
<
form
action
=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), route('removeAllSettings'))}}"
method
=
"post"
>
<
input
type
=
"hidden"
name
=
"url"
value
=
"{{ url()->full() }}"
>
<
button
type
=
"submit"
class
=
"btn btn-sm btn-danger"
>
Alle
Einstellungen
entfernen
</
button
>
</
form
>
</
div
>
</
div
>
</
div
>
</
div
>
<
style
>
#actions {
display
:
flex
;
margin
-
left
:
-
8
px
;
align
-
items
:
center
;
justify
-
content
:
center
;
}
#actions > a, #actions > form {
margin
-
left
:
8
px
;
}
</
style
>
@
endsection
routes/cookie.php
View file @
b1a09786
...
...
@@ -22,6 +22,9 @@ Route::group(
# Route to show and delete all settings
Route
::
get
(
'all-settings'
,
'SettingsController@allSettingsIndex'
)
->
name
(
'showAllSettings'
);
Route
::
post
(
'all-settings/removeOne'
,
'SettingsController@removeOneSetting'
)
->
name
(
'removeOneSetting'
);
Route
::
post
(
'all-settings/removeAll'
,
'SettingsController@removeAllSettings'
)
->
name
(
'removeAllSettings'
);
});
}
);
Write
Preview
Markdown
is supported
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