comparison .cms/mini/html.php @ 0:78edf6b517a0 draft

24.10
author Coffee CMS <info@coffee-cms.ru>
date Fri, 11 Oct 2024 22:40:23 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:78edf6b517a0
1 <?php
2 // Пример кода для мультиязычного сайта
3 // switch ( substr( $cms["url"]["path"], 0, 3 ) ) {
4 // case "en/":
5 // $cms["config"]["lang"] = "en";
6 // $cms["config"]["locale"] = "en_US.UTF-8";
7 // break;
8 // case "ru/":
9 // $cms["config"]["lang"] = "ru";
10 // $cms["config"]["locale"] = "ru_RU.UTF-8";
11 // break;
12 // case "uk/":
13 // $cms["config"]["lang"] = "uk";
14 // $cms["config"]["locale"] = "uk_UA.UTF-8";
15 // break;
16 // }
17 ?>
18 <!doctype html>
19 <html lang="<?php echo $cms["config"]["lang"]; ?>">
20 <head>
21 <meta charset="utf-8">
22 <?php $rss_title = __( "tpl_rss_title", "rss.mod.php" ) . " {$cms['url']['host']}"; ?>
23 <?php $rss_url = "{$cms['url']['scheme']}://{$cms['url']['host']}{$cms['base_path']}rss.xml"; ?>
24 <link rel="alternate" type="application/rss+xml" title="<?php echo $rss_title; ?>" href="<?php echo $rss_url; ?>">
25 <?php if ( ! empty( $cms["page"]["seo_title"] ) ) { print "<title>{$cms["page"]["seo_title"]}</title>\n"; } elseif ( ! empty( $cms["page"]["title"] ) ) { print "<title>{$cms["page"]["title"]}</title>\n"; } ?>
26 <meta name="viewport" content="width=device-width, initial-scale=1.0">
27 <?php if ( ! empty( $cms["page"]["description"] ) ) { echo '<meta name="description" content="' . htmlspecialchars( $cms["page"]["description"] ) . "\">\n"; } ?>
28 <link rel="icon" href="<?php echo $cms["base_path"] . $cms["template"]; ?>/favicon.svg" type="image/svg+xml">
29 <style>
30 <?php echo file_get_contents( dirname( __FILE__ ) . "/styles.css" ); ?>
31 </style>
32 </head>
33
34 <?php
35 if ( empty( $cms["page"]["id"] ) ) {
36 $tpl_name = "page-404";
37 $id = "page-404";
38 } else {
39 $tpl_name = str_replace( ".", "-", $cms["page"]["tpl"] );
40 $id = $tpl_name . "-" . $cms["page"]["id"];
41 }
42 ?>
43 <body id="<?php echo $id; ?>" class="<?php echo $tpl_name; ?>">
44 <header>
45 <div class="header-content">
46 <div class="lrtop">
47 <div class="button-mobimenu-container">
48 <div class="menu-icon">
49 <span class="line-1"></span>
50 <span class="line-2"></span>
51 </div>
52 </div>
53 </div>
54
55 <div class="logo">
56 <a href="<?php echo $cms["base_path"]; ?>">&lt;/mini&gt;</a>
57 </div>
58
59 <div class="lrtop">
60 <div class="icons-container">
61 <div class="phone-number-container">
62 <a title="Телефон" href="tel:+77777777777">+7 777 777 7777</a>
63 </div>
64
65 <div class="icon-box">
66 <a href="tel:+77777777777" aria-label="Телефон"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 23.96 23.96"><defs><style>.a-phone{fill:none;stroke:#00ab00;stroke-miterlimit:10;stroke-width:1.7px;}.b-phone{fill:#00ab00;}</style></defs><circle class="a-phone" cx="11.98" cy="11.98" r="11.13"/><path class="b-phone" d="M5.23,15.65V17a1.46,1.46,0,0,0,1.52,1.37A12.41,12.41,0,0,0,18.41,6.75v-.1A1.46,1.46,0,0,0,17,5.23H15.7a1.46,1.46,0,0,0-1.43,1.3L14,8.37a1.49,1.49,0,0,0,.42,1.22l1.35,1.35a11.05,11.05,0,0,1-4.83,4.83L9.59,14.43A1.48,1.48,0,0,0,8.38,14l-1.86.21A1.47,1.47,0,0,0,5.23,15.65Z" transform="translate(0.15 0.15)"/></svg></a>
67 </div>
68
69 <div class="icon-whatsapp-box">
70 <a title="WhatsApp" target="_blank" href="https://wa.me/+77777777777">
71 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 360 361.74"><defs><style>.a-whatsapp{fill:#25d366;fill-rule:evenodd;}</style></defs><path class="a-whatsapp" d="M307.55,52.57A178,178,0,0,0,180.76,0C82,0,1.54,80.4,1.5,179.24a179,179,0,0,0,23.93,89.6L0,361.74l95-24.93a179,179,0,0,0,85.66,21.82h.08c98.78,0,179.21-80.42,179.24-179.25A178.16,178.16,0,0,0,307.55,52.57ZM180.76,328.35h-.06a148.76,148.76,0,0,1-75.84-20.76l-5.44-3.23L43,319.15l15-55-3.54-5.64a148.59,148.59,0,0,1-22.77-79.29c0-82.14,66.86-149,149-149A149,149,0,0,1,329.74,179.36c0,82.15-66.87,149-149,149Zm81.72-111.57c-4.48-2.25-26.5-13.08-30.61-14.57s-7.09-2.24-10.07,2.24S210.23,219,207.62,222s-5.23,3.36-9.71,1.12-18.91-7-36-22.23c-13.31-11.88-22.3-26.54-24.91-31s-.28-6.92,2-9.14c2-2,4.48-5.23,6.72-7.85s3-4.48,4.48-7.47.75-5.6-.37-7.84S139.69,113.29,136,104.32c-3.63-8.73-7.33-7.54-10.07-7.69s-5.6-.15-8.59-.15a16.4,16.4,0,0,0-11.94,5.6c-4.11,4.49-15.68,15.32-15.68,37.36s16,43.35,18.29,46.34,31.58,48.22,76.51,67.63A260.34,260.34,0,0,0,210,262.85a61.27,61.27,0,0,0,28.21,1.77c8.61-1.29,26.5-10.83,30.23-21.29s3.73-19.44,2.61-21.3-4.1-3-8.58-5.24Z"/></svg></a>
72 </div>
73
74 <div class="icon-tg-box">
75 <a title="Telegram" target="_blank" href="https://t.me/+77777777777"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 1000 1000"><defs><style>.a-tg{fill:url(#a);}.b-tg{fill:#fff;fill-rule:evenodd;}</style><linearGradient id="a" x1="111.39" y1="888.11" x2="111.39" y2="887.12" gradientTransform="matrix(1000, 0, 0, -1000, -110889, 888111)" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#2aabee"/><stop offset="1" stop-color="#229ed9"/></linearGradient></defs><circle class="a-tg" cx="500" cy="500" r="500"/><path class="b-tg" d="M226.33,494.72Q445,399.47,517.92,369.12C656.77,311.37,685.63,301.33,704.43,301c4.14-.07,13.39,1,19.38,5.82,5.05,4.1,6.45,9.65,7.11,13.54a87.82,87.82,0,0,1,.84,19.68C724.23,419.1,691.68,611,675.11,699.52c-7,37.46-20.81,50-34.17,51.26-29,2.67-51.08-19.19-79.21-37.63-44-28.84-68.86-46.8-111.58-74.95-49.37-32.53-17.36-50.41,10.77-79.63,7.36-7.65,135.3-124,137.77-134.57.31-1.32.6-6.24-2.33-8.84s-7.23-1.71-10.35-1q-6.62,1.5-210.9,139.4-29.94,20.55-54.22,20c-17.86-.39-52.2-10.1-77.73-18.4-31.31-10.18-56.2-15.56-54-32.84Q190.83,508.84,226.33,494.72Z"/></svg></a>
76 </div>
77 </div>
78 </div>
79 </div>
80 </header>
81
82 <nav>
83 <?php
84 // Пример кода для мультиязычного сайта
85 // switch ( substr( $cms["url"]["path"], 0, 3 ) ) {
86 // case "en/":
87 // echo menu( "header_en" );
88 // break;
89 // case "ru/":
90 // echo menu( "header_ru" );
91 // break;
92 // case "uk/":
93 // echo menu( "header_uk" );
94 // break;
95 // default:
96 // echo menu( "header" );
97 // break;
98 // }
99 echo menu( "header" );
100 ?>
101 </nav>
102
103 <?php
104 $f = dirname( __FILE__ ) . "/{$cms['page']['tpl']}.php";
105 if ( $cms["status"] === "404" ) {
106 $text = "";
107 if ( isset( $cms["page"]["text"] ) )
108 $text = trim( preg_replace( "/<!--.*?-->/u", "", $cms["page"]["text"] ) );
109 if ( ! empty( $text ) && is_admin() ) {
110 if ( is_file( $f ) ) {
111 include( $f );
112 }
113 } else {
114 $f404 = dirname( __FILE__ ) . "/404.{$cms['config']['locale']}.php";
115 if ( is_file( $f404 ) ) {
116 include( $f404 );
117 } else {
118 include( dirname( __FILE__ ) . "/404.en_US.UTF-8.php" );
119 }
120 }
121 } else {
122 if ( is_file( $f ) ) {
123 include( $f );
124 }
125 }
126 ?>
127
128 <footer>
129 <div class="footer-content">
130 <div class="left-footer">
131 <?php echo menu( "footer" ); ?>
132 <div class="copyright">Powered by <a target="_blank" href="https://coffee-cms.ru/">Coffee CMS</a></div>
133 </div>
134 <div class="right-footer">
135 <div><!--Your Code ;)--></div>
136 </div>
137 </div>
138 </footer>
139
140 <aside>
141 <?php echo menu( "side" ); ?>
142 <?php echo dyn_menu( "side" ); ?>
143 </aside>
144 <div class="bg-reset"></div>
145
146 <script>
147 document.addEventListener( "DOMContentLoaded", function( event ) {
148 let toggle_btns = document.querySelectorAll( ".button-mobimenu-container, .bg-reset, aside li" );
149 toggle_btns.forEach( function( toggle_btn ) {
150 toggle_btn.addEventListener( "click", function() {
151 document.body.classList.toggle( "mobile-menu-open" );
152 } );
153 } );
154 } );
155
156 document.querySelectorAll( "img.lbox" ).forEach( function( img ) {
157 img.addEventListener( "click", function () {
158 if ( document.querySelector( "#lbox-window" ) == null ) {
159 let img = document.createElement( "img" );
160 img.src = this.getAttribute( "src" );
161 let div = document.createElement( "div" );
162 div.id = "lbox-window";
163 div.appendChild( img );
164 document.body.appendChild( div );
165 div.addEventListener( "click", function( e ) {
166 this.remove();
167 } );
168 }
169 } );
170 } );
171 </script>
172 </body>
173 </html>