Mensaxe mantemento.

This commit is contained in:
Laegnur 2022-03-09 18:09:44 +01:00
parent 3505a4ad7f
commit b12183c89f
13 changed files with 226 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -82,7 +82,7 @@ $config->tableSalt = '2a93d08392e7e35dc8063cd620e3bcca2e5413a3';
* Installer: File Permission Configuration * Installer: File Permission Configuration
* *
*/ */
$config->chmodDir = '0775'; // permission for directories created by ProcessWire $config->chmodDir = '2775'; // permission for directories created by ProcessWire
$config->chmodFile = '0664'; // permission for files created by ProcessWire $config->chmodFile = '0664'; // permission for files created by ProcessWire
/** /**
@ -124,3 +124,37 @@ $config->httpHosts = array('php.artabro.localhost');
*/ */
$config->debug = false; $config->debug = false;
/**
* Session name
*
* Default session name as used in session cookie. You may wish to change this if running
* multiple ProcessWire installations on the same server. By giving each installation a unique
* session name, you can stay logged into multiple installations at once.
*
* #notes Note that changing this will automatically logout any current sessions.
* @var string
*
*/
$config->sessionName = 'praiadeseselle';
/**
* Prepend template file
*
* PHP file in /site/templates/ that will be loaded before each page's template file.
*
* #notes Example: _init.php
* @var string
*
*/
$config->prependTemplateFile = '_init.php';
/**
* Append template file
*
* PHP file in /site/templates/ that will be loaded after each page's template file.
*
* #notes Example: _main.php
* @var string
*
*/
$config->appendTemplateFile = '_main.php';

2
site/templates/_foot.php Normal file
View file

@ -0,0 +1,2 @@
</body>
</html>

115
site/templates/_func.php Normal file
View file

@ -0,0 +1,115 @@
<?php namespace ProcessWire;
function getConfig($paxina)
{
$configuracion = array();
foreach($paxina->configuracion as $config)
{
$configuracion[$config->nome_parametro] = $config->valor_parametro;
}
return $configuracion;
}
function getSeccions($seccions, $mantemento = false)
{
$saida = '';
foreach($seccions as $seccion)
{
switch($seccion->template)
{
case 'repeater_seccions':
switch ($seccion->tipo_seccion->value)
{
case 'texto':
$saida .= renderTexto($seccion->artigo);
break;
case 'galeria':
$saida .= renderGaleria($seccion->galeria);
break;
case 'texto_imaxe_lateral':
$saida .= renderTextoImaxe($seccion->artigo, $seccion->imaxe, $seccion->posicion_imaxe->value);
break;
case 'texto_imaxe_superior':
$saida .= getSeccions($seccion->seccion_destacada);
break;
}
break;
case 'repeater_seccion_destacada':
if($mantemento)
{
$saida .= renderTextoImaxe($seccion->artigo, $seccion->imaxe, 'mantemento');
}
else
{
$saida .= renderTextoImaxe($seccion->artigo, $seccion->imaxe, 'superior');
}
break;
}
}
return $saida;
}
function renderTexto($artigo)
{
$saida = '';
$saida .= '<section>';
$saida .= $artigo;
$saida .= '</section>';
return $saida;
}
function renderGaleria($galeria)
{
$saida = '';
$saida .= '<section>';
$saida .= '<div class="swiper-wrapper">';
foreach($galeria as $imaxen)
{
$saida .= '<img src="' . $imaxen->url . '" alt="">';
}
$saida .= '</section>';
return $saida;
}
function renderTextoImaxe($texto, $imaxe, $posicion)
{
$saida = '';
switch ($posicion)
{
case 'esquerda':
$saida .= '<section>';
$saida .= '<img class="' . $posicion .'" src="' . $imaxe->url . '" alt="">';
$saida .= '<div>' . $texto . '</div>';
$saida .= '</section>';
break;
case 'dereita':
$saida .= '<section>';
$saida .= '<div>' . $texto . '</div>';
$saida .= '<img class="' . $posicion .'" src="' . $imaxe->url . '" alt="">';
$saida .= '</section>';
break;
case 'superior':
$saida .= '<section>';
$saida .= '<img class="' . $posicion .'" src="' . $imaxe->url . '" alt="">';
$saida .= '<div>' . $texto . '</div>';
$saida .= '</section>';
break;
case 'mantemento':
$saida .= '<section>';
$saida .= '<img class="' . $posicion .'" src="' . $imaxe->url . '" alt="">';
$saida .= '<div>' . $texto . '</div>';
$saida .= '</section>';
break;
}
return $saida;
}

11
site/templates/_head.php Normal file
View file

@ -0,0 +1,11 @@
<?php namespace ProcessWire;?><!DOCTYPE html>
<html lang="en">
<head>
<title><?php echo $titulo; ?></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>css/style.css" />
</head>
<body>
<h1><?php echo $configuracion['nome_sitio']; ?></h1>
<p><?php echo $configuracion['descripcion_sitio']; ?></p>

7
site/templates/_init.php Normal file
View file

@ -0,0 +1,7 @@
<?php namespace ProcessWire;
include_once('./_func.php');
$inicio = $pages->get('/');
$configuracion = getConfig($inicio);
$titulo = $page->title . ' - ' . $configuracion['nome_sitio'];

15
site/templates/_main.php Normal file
View file

@ -0,0 +1,15 @@
<?php namespace ProcessWire;
include('./_head.php');
?>
<main id="contido">
<?php
echo $contido;
?>
<?php if($page->editable()): ?>
<p><a href="<?php echo $page->editURL; ?>">Edit</a></p>
<?php endif; ?>
</main>
<?php
include('./_foot.php');
?>

View file

@ -0,0 +1,23 @@
*, *::before, *::after
{
box-sizing: border-box;
}
:root
{
font-size: 16px;
}
body
{
min-height: 100vh;
margin: 0;
background-color: #f2f0f1;
}
img
{
width: 100%;
}

View file

@ -1,3 +0,0 @@
<?php
include("./basic-page.php");

View file

@ -0,0 +1,18 @@
<?php namespace ProcessWire;
$mantemento = $inicio->mantemento;
if($mantemento && !$user->isLoggedin())
{
$menu = '';
$contido = '';
if(count($inicio->seccion_destacada))
{
$contido .= getSeccions($inicio->seccion_destacada, true);
}
}
else
{
$contido = '';
}

View file

@ -1 +0,0 @@
/* blank */