Merge branch 'muammertop' of https://github.com/openclassify/openclassify into m_alibaba

 Conflicts:
	app/Providers/AppServiceProvider.php
This commit is contained in:
Muammer Top 2021-02-09 16:11:38 +03:00
commit efa10aea95
3 changed files with 12 additions and 5 deletions

View File

@ -2,7 +2,7 @@
<ul>
{% for key, navigation in template.cp.navigation %}
<li class="{{ navigation.active ? 'active' }} variant-border" data-slug="{{ navigation.slug }}">
<li class="{{ navigation.active ? 'active' }} {{ navigation.class }} variant-border" data-slug="{{ navigation.slug }}">
<a {{ html_attributes(navigation.attributes) }} title="{{ trans(navigation.title) }}">
<span class="icon">{{ navigation.icon()|raw }}</span>
<span class="title">{{ trans(navigation.title) }}</span>

View File

@ -30,7 +30,7 @@
<div class="dropdown-menu results">
<h6 class="dropdown-header">Navigation</h6>
{% for key, navigation in template.cp.navigation %}
<a class="dropdown-item" {{ html_attributes(navigation.attributes) }}>
<a class="dropdown-item" {{ html_attributes(navigation.attributes) }} {{ navigation.class }}>
<span class="title">{{ trans(navigation.title) }}</span>
</a>
{% endfor %}

View File

@ -14,9 +14,16 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
//Auto Language Switcher
view()->composer('*', function ($view) {
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
view()->composer('*', function ($view) {
//Hidden menu items in sidebar on dashboard
if (auth()->check() and template()->get('cp')){
template()->get('cp')->getNavigation()->get('anomaly.module.variables')->setClass('hidden');
template()->get('cp')->getNavigation()->get('anomaly.module.system')->setClass('hidden');
template()->get('cp')->getNavigation()->get('anomaly.module.redirects')->setClass('hidden');
template()->get('cp')->getNavigation()->get('anomaly.module.repeaters')->setClass('hidden');
}
//Auto Language Switcher
if (config('advs.lang_switcher_for_browser') and is_null(Request()->session()->get('_locale')) and isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);//Get Browser Language
$acceptLang = config('streams::locales.enabled'); //Supported Language
$lang = in_array($lang, $acceptLang) ? $lang : config('streams::locales.default', 'en');