Mover configuracions da portada a zoa de xestion.

This commit is contained in:
Laegnur 2022-12-06 10:05:56 +01:00
parent 45c2119645
commit a42d9f340c
10 changed files with 49 additions and 25 deletions

View file

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View file

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View file

@ -42,6 +42,18 @@ if(!defined("PROCESSWIRE")) die();
*/
$config->useFunctionsAPI = true;
/**
* Enable use of front-end markup regions?
*
* When enabled, HTML elements with an "id" attribute that are output before the opening
* `<!doctype>` or `<html>` tag can replace elements in the document that have the same id.
* Also supports append, prepend, replace, remove, before and after options.
*
* @var bool
*
*/
$config->useMarkupRegions = true;
/*** INSTALLER CONFIG ********************************************************************/

View file

@ -3,17 +3,15 @@
$menu = '';
$contido = '';
$mantemento = $inicio->mantemento;
$contido .= renderMigasPan($page) . "\n";
$contido .= '<article id="inicio">' . "\n";
$contido .= '<div class="contedor">' . "\n";
$contido .= '<h2 class="visually-hidden">' . ucfirst($inicio->title) . '</h2>' . "\n";
if($mantemento && !$user->isLoggedin())
if($configuracion['mantemento']['activo'] && !$user->isLoggedin())
{
$menu = renderMenu($inicio, 0, 'paxinas');
$contido .= getSeccions($inicio->mantemento_mensaxe) . "\n";
$contido .= renderTextoMantemento($configuracion['mantemento']['titular'], $configuracion['mantemento']['artigo'], $configuracion['mantemento']['imaxe']) . "\n";
}
else
{

View file

@ -15,6 +15,21 @@ function getConfig($paxina)
list($r, $g, $b) = sscanf($config->parametro_cor, "%02x%02x%02x");
$configuracion[$config->parametro_nome] = $r . ', ' . $g . ', ' . $b;
break;
case 'mantemento':
if($config->parametro_mantemento==1)
{
$configuracion['mantemento'] = array(
"activo" => true,
"titular" => $config->titular,
"artigo" => $config->artigo,
"imaxe" => $config->imaxe
);
}
else
{
$configuracion['mantemento'] = array("activo" => false);
}
break;
}
}
@ -58,9 +73,6 @@ function getSeccions($seccions)
break;
}
break;
case 'repeater_mantemento_mensaxe':
$saida .= renderTextoMantemento($seccion->titular, $seccion->artigo, $seccion->imaxe);
break;
case 'repeater_imaxe_ligazon':
$saida .= renderImaxeLigazon($seccion->titular, $seccion->imaxe, $seccion->ligazon);
break;

View file

@ -4,5 +4,6 @@ include_once('./layout/func.php');
$start = microtime(true);
$inicio = $pages->get('/');
$configuracion = getConfig($inicio);
$xestion = $pages->get('/gestion');
$configuracion = getConfig($xestion);
$titulo = $page->title . ' - ' . $configuracion['sitio_nome'];

View file

@ -56,6 +56,15 @@ if($input->get->logout == true)
--imaxe_destacada: <?php echo $page->imaxe ? 'url("'. $page->imaxe->url . '")' : 'none'; ?>;
}
</style>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K9CF4D4SZX"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-K9CF4D4SZX');
</script>
</head>
<body>
<a href="#contido" class="visually-hidden element-focusable bypass-to-main"><?php echo _x('Skip to content', 'bypass'); ?></a>

View file

@ -1,11 +1,11 @@
<?php namespace ProcessWire;
$menu = renderMenu($gestion->children, 0, 'paxinas');
include('./layout/partial/xes-head.php');
?>
<main id="contido">
<?php
echo $contido;
?>
<?php echo renderMigasPan($page); ?>
</main>
<?php
include('./layout/partial/xes-foot.php');

View file

@ -1,14 +1,6 @@
<?php namespace ProcessWire;
$menu = '';
$contido = '';
$gestion = $pages->get('/gestion');
$menu = renderMenu($gestion->children, 0, 'paxinas');
$contido .= renderMigasPan($page) . "\n";
$contido .= '<article id="gestion">' . "\n";
$contido .= '<div class="contedor">' . "\n";
$contido .= '<h2>' . ucfirst($page->title) . '</h2>' . "\n";
$contido .= '</div>' . "\n";
$contido .= '</article>' . "\n";
<?php namespace ProcessWire; ?>
<article id="gestion" pw-append='contido'>
<div class="contedor">
<h2><?php echo ucfirst($page->title); ?></h2>
</div>
</article>