Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
MetaGer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
56
Issues
56
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
open-source
MetaGer
Commits
3940a174
Commit
3940a174
authored
Aug 03, 2018
by
Karl Hasselbring
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tips.xml wird von quicktip server geladen
parent
22b27f14
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
13 deletions
+43
-13
app/Http/Controllers/MetaGerSearch.php
app/Http/Controllers/MetaGerSearch.php
+25
-0
resources/lang/de/sidebar.php
resources/lang/de/sidebar.php
+1
-0
resources/lang/de/tips.php
resources/lang/de/tips.php
+2
-2
resources/views/parts/sidebar.blade.php
resources/views/parts/sidebar.blade.php
+4
-4
resources/views/tips.blade.php
resources/views/tips.blade.php
+11
-7
No files found.
app/Http/Controllers/MetaGerSearch.php
View file @
3940a174
...
...
@@ -6,6 +6,9 @@ use App;
use
App\MetaGer
;
use
Illuminate\Http\Request
;
#const TIP_SERVER = 'https://quicktips.metager3.de/tips.xml';
const
TIP_SERVER
=
'http://localhost:63825/tips.xml'
;
class
MetaGerSearch
extends
Controller
{
public
function
search
(
Request
$request
,
MetaGer
$metager
)
...
...
@@ -70,4 +73,26 @@ class MetaGerSearch extends Controller
$length
=
strlen
(
$needle
);
return
(
substr
(
$haystack
,
0
,
$length
)
===
$needle
);
}
public
function
tips
(
Request
$request
)
{
$tips_text
=
file_get_contents
(
TIP_SERVER
);
$tips
=
[];
try
{
$tips_xml
=
simplexml_load_string
(
$tips_text
);
$tips_xml
->
registerXPathNamespace
(
'mg'
,
'http://metager.de/tips/'
);
$tips_xml
=
$tips_xml
->
xpath
(
'mg:tip'
);
foreach
(
$tips_xml
as
$tip_xml
)
{
$tips
[]
=
$tip_xml
->
__toString
();
}
}
catch
(
\
Exception
$e
)
{
Log
::
error
(
"A problem occurred loading tips from the tip server."
);
Log
::
error
(
$e
->
getMessage
());
abort
(
500
);
}
return
view
(
'tips'
)
->
with
(
'title'
,
trans
(
'tips.title'
))
->
with
(
'tips'
,
$tips
);
}
}
resources/lang/de/sidebar.php
View file @
3940a174
...
...
@@ -27,4 +27,5 @@ return [
'nav25'
=>
'MetaGer App'
,
'nav26'
=>
'MetaGer-Fanshop'
,
'navigationToggle'
=>
'Navigation anzeigen'
,
'titles.tips'
=>
'Tips'
,
];
resources/lang/de/tips.php
View file @
3940a174
<?php
return
[
"title"
=>
"MetaGer Tipps, unsortiert - dies & das
- wussten Sie schon?"
,
"shorttitle"
=>
"Wussten Sie schon?"
"title"
=>
"MetaGer Tipps, unsortiert
- wussten Sie schon?"
,
"shorttitle"
=>
"Wussten Sie schon?"
,
];
resources/views/parts/sidebar.blade.php
View file @
3940a174
...
...
@@ -29,16 +29,16 @@
<a
class=
"inlink"
href=
"https://metager.de/klassik/asso/"
tabindex=
"228"
>
{{ trans('sidebar.nav11') }}
</a>
</li>
<li>
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
app
/")
}}"
tabindex=
"2
30
"
>
@lang('sidebar.nav25')
</a>
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
app
/")
}}"
tabindex=
"2
29
"
>
@lang('sidebar.nav25')
</a>
</li>
<li>
<a
class=
"inlink"
href=
"https://metager.to/"
tabindex=
"231"
>
{{ trans('sidebar.nav13
') }}
</a>
<a
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
tips
/")
}}"
tabindex=
"230"
>
{{ trans('sidebar.titles.tips
') }}
</a>
</li>
<li>
<a
class=
"inlink"
href=
"https://maps.metager.de"
target=
"_blank"
tabindex=
"23
2
"
>
Maps.MetaGer.de
</a>
<a
class=
"inlink"
href=
"https://maps.metager.de"
target=
"_blank"
tabindex=
"23
1
"
>
Maps.MetaGer.de
</a>
</li>
<li>
<a
class=
"outlink"
href=
"https://gitlab.metager3.de/open-source/MetaGer"
tabindex=
"23
3
"
>
{{ trans('sidebar.nav24') }}
</a>
<a
class=
"outlink"
href=
"https://gitlab.metager3.de/open-source/MetaGer"
tabindex=
"23
2
"
>
{{ trans('sidebar.nav24') }}
</a>
</li>
<li>
<a
class=
"outlink"
href=
"{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "
/
tor
/")
}}"
tabindex=
"234"
>
{{ trans('sidebar.nav14') }}
</a>
...
...
resources/views/tips.blade.php
View file @
3940a174
@
extends
(
'layouts.s
tatic
Pages'
)
@
extends
(
'layouts.s
ub
Pages'
)
@
section
(
'title'
,
$title
)
@
section
(
'navbarFocus.tips'
,
'class="active"'
)
@
section
(
'content'
)
<
h1
>
{
!!
trans
(
'tips.title'
)
!!
}
</
h1
>
<
ol
>
@
foreach
(
$tips
as
$tip
)
<
li
>
{
!!
$tip
!!
}
</
li
>
@
endforeach
</
ol
>
<
h1
class
=
"page-title"
>
{
!!
trans
(
'tips.title'
)
!!
}
</
h1
>
<
div
class
=
"card-heavy"
>
<
ol
>
@
foreach
(
$tips
as
$tip
)
<
li
>
{
!!
$tip
!!
}
</
li
>
@
endforeach
</
ol
>
</
div
>
@
endsection
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