Mercurial
view .cms/mini/html.php @ 1:1d486627aa1e draft default tip
24.10
author | Coffee CMS <info@coffee-cms.ru> |
---|---|
date | Sat, 12 Oct 2024 02:51:39 +0000 |
parents | 78edf6b517a0 |
children |
line wrap: on
line source
<?php // Пример кода для мультиязычного сайта // switch ( substr( $cms["url"]["path"], 0, 3 ) ) { // case "en/": // $cms["config"]["lang"] = "en"; // $cms["config"]["locale"] = "en_US.UTF-8"; // break; // case "ru/": // $cms["config"]["lang"] = "ru"; // $cms["config"]["locale"] = "ru_RU.UTF-8"; // break; // case "uk/": // $cms["config"]["lang"] = "uk"; // $cms["config"]["locale"] = "uk_UA.UTF-8"; // break; // } ?> <!doctype html> <html lang="<?php echo $cms["config"]["lang"]; ?>"> <head> <meta charset="utf-8"> <?php $rss_title = __( "tpl_rss_title", "rss.mod.php" ) . " {$cms['url']['host']}"; ?> <?php $rss_url = "{$cms['url']['scheme']}://{$cms['url']['host']}{$cms['base_path']}rss.xml"; ?> <link rel="alternate" type="application/rss+xml" title="<?php echo $rss_title; ?>" href="<?php echo $rss_url; ?>"> <?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"; } ?> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php if ( ! empty( $cms["page"]["description"] ) ) { echo '<meta name="description" content="' . htmlspecialchars( $cms["page"]["description"] ) . "\">\n"; } ?> <link rel="icon" href="<?php echo $cms["base_path"] . $cms["template"]; ?>/favicon.svg" type="image/svg+xml"> <style> <?php echo file_get_contents( dirname( __FILE__ ) . "/styles.css" ); ?> </style> </head> <?php if ( empty( $cms["page"]["id"] ) ) { $tpl_name = "page-404"; $id = "page-404"; } else { $tpl_name = str_replace( ".", "-", $cms["page"]["tpl"] ); $id = $tpl_name . "-" . $cms["page"]["id"]; } ?> <body id="<?php echo $id; ?>" class="<?php echo $tpl_name; ?>"> <header> <div class="header-content"> <div class="lrtop"> <div class="button-mobimenu-container"> <div class="menu-icon"> <span class="line-1"></span> <span class="line-2"></span> </div> </div> </div> <div class="logo"> <a href="<?php echo $cms["base_path"]; ?>"></mini></a> </div> <div class="lrtop"> <div class="icons-container"> <div class="phone-number-container"> <a title="Телефон" href="tel:+77777777777">+7 777 777 7777</a> </div> <div class="icon-box"> <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> </div> <div class="icon-whatsapp-box"> <a title="WhatsApp" target="_blank" href="https://wa.me/+77777777777"> <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> </div> <div class="icon-tg-box"> <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> </div> </div> </div> </div> </header> <nav> <?php // Пример кода для мультиязычного сайта // switch ( substr( $cms["url"]["path"], 0, 3 ) ) { // case "en/": // echo menu( "header_en" ); // break; // case "ru/": // echo menu( "header_ru" ); // break; // case "uk/": // echo menu( "header_uk" ); // break; // default: // echo menu( "header" ); // break; // } echo menu( "header" ); ?> </nav> <?php $f = dirname( __FILE__ ) . "/{$cms['page']['tpl']}.php"; if ( $cms["status"] === "404" ) { $text = ""; if ( isset( $cms["page"]["text"] ) ) $text = trim( preg_replace( "/<!--.*?-->/u", "", $cms["page"]["text"] ) ); if ( ! empty( $text ) && is_admin() ) { if ( is_file( $f ) ) { include( $f ); } } else { $f404 = dirname( __FILE__ ) . "/404.{$cms['config']['locale']}.php"; if ( is_file( $f404 ) ) { include( $f404 ); } else { include( dirname( __FILE__ ) . "/404.en_US.UTF-8.php" ); } } } else { if ( is_file( $f ) ) { include( $f ); } } ?> <footer> <div class="footer-content"> <div class="left-footer"> <?php echo menu( "footer" ); ?> <div class="copyright">Powered by <a target="_blank" href="https://coffee-cms.ru/">Coffee CMS</a></div> </div> <div class="right-footer"> <div><!--Your Code ;)--></div> </div> </div> </footer> <aside> <?php echo menu( "side" ); ?> <?php echo dyn_menu( "side" ); ?> </aside> <div class="bg-reset"></div> <script> document.addEventListener( "DOMContentLoaded", function( event ) { let toggle_btns = document.querySelectorAll( ".button-mobimenu-container, .bg-reset, aside li" ); toggle_btns.forEach( function( toggle_btn ) { toggle_btn.addEventListener( "click", function() { document.body.classList.toggle( "mobile-menu-open" ); } ); } ); } ); document.querySelectorAll( "img.lbox" ).forEach( function( img ) { img.addEventListener( "click", function () { if ( document.querySelector( "#lbox-window" ) == null ) { let img = document.createElement( "img" ); img.src = this.getAttribute( "src" ); let div = document.createElement( "div" ); div.id = "lbox-window"; div.appendChild( img ); document.body.appendChild( div ); div.addEventListener( "click", function( e ) { this.remove(); } ); } } ); } ); </script> </body> </html>