Merge pull request #643 from openclassify/vedatakd

add page layouts
This commit is contained in:
Ozcan Durak 2020-08-20 13:58:37 +03:00 committed by GitHub
commit ecf70a63f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 48 additions and 5 deletions

View File

@ -35,14 +35,20 @@ class redirectDiffrentLang
$setting_language = setting_value('streams::default_locale');
$current_language = $request->session()->get('_locale', $setting_language);
$request_url = ltrim($request->getRequestUri(), '/');
// If the segment(1) is admin and language parameters is not null, no forwarding will be made.
if ($request->segment(1) == "admin" and in_array($current_language, explode('/', $original_url))) {
return $this->redirect->to($request->fullUrl());
}
if ($current_language != $setting_language) {
if ($request_url != "" and $original_url != '/' . $current_language . '/' . $request_url) {
// If the method is get, no forwarding will be made.
// If the segment(1) is admin, no forwarding will be made.
if ($request->method() == "GET" and $request->segment(1) != "admin" and $request_url != "" and $original_url != '/' . $current_language . '/' . $request_url) {
return $this->redirect->to('/' . $current_language . '/' . $request_url);
}
} else {
if ($request_url == "" and '/' . $current_language != $original_url) {
$this->redirect->to($current_language);
}
}
return $next($request);

View File

@ -0,0 +1,37 @@
<!doctype html>
<!--[if lt IE 7]>
<html class="nojs ms lt_ie7" lang="en"><![endif]-->
<!--[if IE 7]>
<html class="nojs ms ie7" lang="en"><![endif]-->
<!--[if IE 8]>
<html class="nojs ms ie8" lang="en"><![endif]-->
<!--[if gt IE 8]>
<html class="nojs ms" lang="en"><![endif]-->
<html>
<head>
{% include "visiosoft.theme.base::partials/metadata" %}
{% block styles %}{% endblock %}
</head>
<body>
{% include "visiosoft.theme.base::partials/header" %}
<main id="main">
<div class="container">
{% include "visiosoft.theme.base::partials/messages" %}
{% block content %}{% endblock %}
</div>
</main>
{% include "visiosoft.theme.base::partials/footer" %}
{% include "visiosoft.theme.base::partials/settings" %}
</body>
</html>