Convert common/tpl/*_layout files to template v2

This commit is contained in:
Kijin Sung 2023-10-25 23:28:26 +09:00
parent 9d5dff5371
commit e0c396bb3e
3 changed files with 65 additions and 46 deletions

View file

@ -1,82 +1,99 @@
<config version="2" />
<!DOCTYPE html>
<html lang="{$lang_type = Context::getLangType()}" class="xe-mobilelayout"|cond="$m">
<html lang="{{ $lang_type = Context::getLangType() }}" class="xe-mobilelayout"|if="$m">
<head>
<!-- META -->
<meta charset="utf-8">
<meta name="generator" content="Rhymix">
<meta name="viewport" content="{config('mobile.viewport') ?? HTMLDisplayHandler::DEFAULT_VIEWPORT}" />
<meta name="viewport" content="{{ config('mobile.viewport') ?? HTMLDisplayHandler::DEFAULT_VIEWPORT }}" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<block loop="Context::getMetaTag() => $no, $val">
<meta http-equiv="{$val['name']}"|cond="$val['is_http_equiv']" name="{$val['name']}"|cond="!$val['is_http_equiv']" content="{$val['content']}" />
</block>
<meta name="csrf-token" content="{\Rhymix\Framework\Session::getGenericToken()}" />
@foreach (Context::getMetaTag() as $val)
<meta http-equiv="{{ $val['name'] }}"|if="$val['is_http_equiv']" name="{{ $val['name'] }}"|if="!$val['is_http_equiv']" content="{{ $val['content'] }}" />
@endforeach
<meta name="csrf-token" content="{{ \Rhymix\Framework\Session::getGenericToken()|noescape }}" />
<!-- TITLE -->
<title>{Context::getBrowserTitle()}</title>
<title>{{ Context::getBrowserTitle() }}</title>
<!-- CSS -->
<block loop="Context::getCssFile(true) => $key, $css_file">
<link rel="stylesheet" href="{$css_file['file']}" media="{$css_file['media']}"|cond="$css_file['media'] != 'all'" />
</block>
@foreach (Context::getCssFile(true) as $css_file)
<link rel="stylesheet" href="{{ $css_file['file']|noescape }}" media="{{ $css_file['media']|noescape }}"|if="$css_file['media'] !== 'all'" />
@endforeach
<!-- JS -->
<block loop="Context::getJsFile('head', true) => $key, $js_file">
<script src="{$js_file['file']}"></script>
</block>
@foreach (Context::getJsFile('head', true) as $js_file)
<script src="{{ $js_file['file']|noescape }}"></script>
@endforeach
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" cond="isset($rss_url) && $rss_url" />
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" cond="isset($general_rss_url) && $general_rss_url" />
<link rel="alternate" type="application/atom+xml" title="Atom" href="{$atom_url}" cond="isset($atom_url) && $atom_url" />
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{$general_atom_url}" cond="isset($general_atom_url) && $general_atom_url" />
@if (!empty($rss_url))
<link rel="alternate" type="application/rss+xml" title="RSS" href="{{ $rss_url }}" />
@endif
@if (!empty($general_rss_url))
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{{ $general_rss_url }}" />
@endif
@if (!empty($atom_url))
<link rel="alternate" type="application/atom+xml" title="Atom" href="{{ $atom_url }}" />
@endif
@if (!empty($general_atom_url))
<link rel="alternate" type="application/atom+xml" title="Site Atom" href="{{ $general_atom_url }}" />
@endif
<!-- ICONS AND OTHER LINKS -->
<link cond="Context::getCanonicalURL()" rel="canonical" href="{Context::getCanonicalURL()}" />
<link cond="$favicon_url" rel="shortcut icon" href="{$favicon_url}" />
<link cond="$mobicon_url" rel="apple-touch-icon" href="{$mobicon_url}" />
@if (!empty($canonical_url = Context::getCanonicalURL()))
<link rel="canonical" href="{{ $canonical_url }}" />
@endif
@if (!empty($favicon_url))
<link rel="shortcut icon" href="{$favicon_url}" />
@endif
@if (!empty($mobicon_url))
<link rel="apple-touch-icon" href="{$mobicon_url}" />
@endif
<!-- OTHER HEADERS -->
<block loop="Context::getOpenGraphData() => $og_metadata">
@foreach (Context::getOpenGraphData() as $og_metadata)
<meta property="{$og_metadata['property']}" content="{$og_metadata['content']}" />
</block>
{Context::getHtmlHeader()|noescape}
@endforeach
{{ Context::getHtmlHeader()|noescape }}
</head>
<!-- BODY START -->
<body{Context::getBodyClass()|noescape}>
<body{{ Context::getBodyClass()|noescape }}>
<!-- COMMON JS VARIABLES -->
<script>
var default_url = "{\Rhymix\Framework\URL::encodeIdna(Context::getDefaultUrl(null, RX_SSL))}";
var current_url = "{\Rhymix\Framework\URL::encodeIdna($current_url)}";
var request_uri = "{\Rhymix\Framework\URL::encodeIdna($request_uri)}";
var current_lang = xe.current_lang = "{$lang_type}";
var current_mid = {json_encode(isset($mid) ? $mid : null)};
var http_port = {Context::get("_http_port") ?: 'null'};
var https_port = {Context::get("_https_port") ?: 'null'};
var enforce_ssl = {$site_module_info->security === 'always' ? 'true' : 'false'};
var cookies_ssl = {config('session.use_ssl_cookies') ? 'true' : 'false'};
var rewrite_level = {intval(\Rhymix\Framework\Router::getRewriteLevel())};
var default_url = @json(\Rhymix\Framework\URL::encodeIdna(Context::getDefaultUrl(null, RX_SSL)));
var current_url = @json(\Rhymix\Framework\URL::encodeIdna($current_url));
var request_uri = @json(\Rhymix\Framework\URL::encodeIdna($request_uri));
var current_lang = xe.current_lang = @json($lang_type);
var current_mid = @json($mid ?? null);
var http_port = @json(Context::get("_http_port") ?: null);
var https_port = @json(Context::get("_https_port") ?: null);
var enforce_ssl = @json($site_module_info->security === 'always' ? true : false);
var cookies_ssl = @json(config('session.use_ssl_cookies') ? true : false);
var rewrite_level = @json(intval(\Rhymix\Framework\Router::getRewriteLevel()));
if (detectColorScheme) detectColorScheme();
</script>
<!-- PAGE CONTENT -->
{Context::getBodyHeader()|noescape}
{$content|noescape}
{Context::getHtmlFooter()|noescape}
{"\n\n"}
{{ Context::getBodyHeader()|noescape }}
{{ $content|noescape }}
{{ Context::getHtmlFooter()|noescape }}
{{ "\n\n" }}
<!-- ETC -->
<div id="rhymix_waiting" class="wfsr" data-message="{$lang->msg_call_server}" cond="!$m"></div>
@desktop
<div id="rhymix_waiting" class="wfsr" data-message="@lang('msg_call_server')"></div>
@enddesktop
<div id="rhymix_alert"></div>
<div id="rhymix_debug_panel"></div>
<div id="rhymix_debug_button"></div>
<!-- BODY JS -->
<block loop="Context::getJsFile('body', true) => $key, $js_file">
<script src="{$js_file['file']}"></script>
</block>
@foreach (Context::getJsFile('body', true) as $js_file)
<script src="{{ $js_file['file']|noescape }}"></script>
@endforeach
</body>
</html>

View file

@ -1 +1,2 @@
{$content|noescape}
@version(2)
{{ $content|noescape }}

View file

@ -1,7 +1,8 @@
<load target="../../modules/admin/tpl/css/admin.bootstrap.css" />
<load target="../../modules/admin/tpl/css/admin.css" />
@version(2)
@load('../../modules/admin/tpl/css/admin.bootstrap.css')
@load('../../modules/admin/tpl/css/admin.css')
<div class="x popup">
{$content|noescape}
{{ $content|noescape }}
</div>
<script>
jQuery(function() {