praiadeseselle/site/templates/layout/head.php

122 lines
6.4 KiB
PHP

<?php namespace ProcessWire;
/** @var Page $page */
/** @var Pages $pages */
/** @var Config $config */
/** @var Sanitizer $sanitizer API variable */
/** @var WireInput $input API variable */
/** @var User $user API variable */
/** @var Languages $languages API variable */
/** @var SiteConfig $configuracion */
/** @var HomePage $inicio */
if($input->get->logout == true)
{
$session->logout();
$session->redirect($inicio->url);
}
?><!DOCTYPE html>
<html lang="<?=_x('en', 'HTML language code');?>">
<head>
<title><?=$titulo;?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php if($configuracion['sitio_descripcion']):?>
<meta name="description" content="<?=$configuracion['sitio_nome'] . ' ' . $configuracion['sitio_descripcion'];?>">
<?php endif;?>
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-config" content="<?=$config->urls->templates;?>images/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<link rel="apple-touch-icon" sizes="180x180" href="<?=$config->urls->templates;?>images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="<?=$config->urls->templates;?>images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="<?=$config->urls->templates;?>images/favicon-16x16.png">
<link rel="manifest" href="<?=$config->urls->templates;?>images/site.webmanifest">
<link rel="mask-icon" href="<?=$config->urls->templates;?>images/safari-pinned-tab.svg" color="#00a099">
<link rel="shortcut icon" href="<?=$config->urls->templates;?>images/favicon.ico">
<link rel="stylesheet" type="text/css" href="<?=$config->urls->templates;?>css/reset.css">
<link rel="stylesheet" type="text/css" href="<?=$config->urls->templates;?>css/fonts.css">
<link rel="stylesheet" type="text/css" href="<?=$config->urls->templates;?>css/swiper-bundle.min.css">
<link title="Praia de Seselle" rel="stylesheet" type="text/css" href="<?=$config->urls->templates?>css/main.css">
<?php foreach($languages as $idioma):?>
<?php if(!$page->viewable($idioma)): continue; endif;?>
<link rel="alternate" hreflang="<?=$inicio->getLanguageValue($idioma, 'name');?>" href="<?=$page->httpUrl($idioma);?>">
<?php endforeach;?>
<style>
:root
{
--cor_60: <?=$configuracion['cor_fondo']?>;
--cor_30: <?=$configuracion['cor_principal']?>;
--cor_10: <?=$configuracion['cor_secundario']?>;
}
</style>
<script src="<?=$config->urls->templates?>js/swiper-bundle.min.js"></script>
</head>
<body class="grella">
<a href="#contido" class="visually-hidden element-focusable bypass-to-main"><?=_x('Skip to content', 'bypass');?></a>
<header id="cabeceira" class="completo">
<div id="cabeceira-superior" class="completo">
<nav id="menu-usuario" aria-label="<?=_x('User', 'User');?>">
<button class="boton" type="button" onclick="abrirMenu()">
<i class='icon-menu'></i><span class="visually-hidden"><?=_x('Open menu', 'Open the menu');?></span>
</button>
<ul>
<?php if($user->isLoggedin()):?>
<li><a class="boton" href="/?logout=true"><i class='icon-user'></i><span class="visually-hidden"><?=_x('Log out', 'Log out');?></span></a></li>
<li><a class="boton" href='/pwadmin'><i class='icon-settings'></i> <span class="visually-hidden"><?=_x('Management', 'Management');?></span></a></li>
<?php else:?>
<li><a class="boton" href='/pwadmin'><i class='icon-user'></i><span class="visually-hidden"><?=_x('Log in', 'Log in');?></span></a></li>
<?php endif;?>
</ul>
</nav>
</div>
<div id="cabeceira-inferior">
<a id="logo" class="centrado" href="/">
<?php
$logo = $configuracion['logo']['completo'];
if($logo)
{
$movil = $logo->rasterize(150, 0);
$desktop = $logo->rasterize(250, 0);
}
?>
<p class="visually-hidden"><?=$configuracion['sitio_nome'] . ' ' . $configuracion['sitio_descripcion'];?></p>
<picture>
<source srcset="<?=$movil->url;?>" media="(max-width: 767px)">
<source srcset="<?=$desktop->url;?>" media="(min-width: 768px)">
<img src="<?=$logo->url;?>" alt="<?=$logo->description;?>">
</picture>
</a>
<form id="atopar" action="<?=pages()->get('template=atopar')->url;?>" method="get" role="search">
<input type="search" id="atopar-consulta" name="q">
<label class="py-1" for="atopar-consulta"><?=_x("Search", "search");?>&hellip;</label>
<button type="submit" class="boton primario">
<i class="icon-search"></i><span class="visually-hidden"><?=_x("Search", "search");?></span>
</button>
</form>
<nav id="menu-idiomas" aria-label="<?=_x("Languages", "Languages");?>">
<ul>
<?php foreach($languages as $idioma) :?>
<?php if(!$page->viewable($idioma)) continue;?>
<li>
<?php
$url = $page->localUrl($idioma);
$hreflang = $inicio->getLanguageValue($idioma, 'name');
?>
<a class="boton<?=$idioma->id == $user->language->id? ' activo' : '';?>" title="<?=$idioma->title;?>" hreflang="<?=$hreflang;?>" href="<?=$url;?>">
<?=$hreflang;?>
</a>
</li>
<?php endforeach;?>
</ul>
</nav>
<nav id="menu-principal" aria-label="<?=_x("Main navigation", "Main navigation");?>">
<div id="menu-despregable" style="">
<button class="boton pechar" type="button" onclick="pecharMenu()">
<i class='icon-x'></i><span class="visually-hidden"><?=_x('Close menu', 'Close the menu');?></span>
</button>
<?=$menu;?>
</div>
</nav>
</div>
</header>