From a42d9f340c7d50c56d2dda7f5dae42ed66f5515f Mon Sep 17 00:00:00 2001 From: Laegnur Date: Tue, 6 Dec 2022 10:05:56 +0100 Subject: [PATCH] Mover configuracions da portada a zoa de xestion. --- .../files/{1074 => 1153}/mantemento.0x260.jpg | Bin .../files/{1074 => 1153}/mantemento.jpg | Bin site/config.php | 12 +++++++++++ site/templates/{portada.php => inicio.php} | 6 ++---- site/templates/layout/func.php | 18 +++++++++++++--- site/templates/layout/init.php | 3 ++- site/templates/layout/partial/main_head.php | 9 ++++++++ site/templates/layout/xes.php | 6 +++--- .../templates/{xestion.php => xes-inicio.php} | 0 site/templates/xes-panel.php | 20 ++++++------------ 10 files changed, 49 insertions(+), 25 deletions(-) rename site/assets/files/{1074 => 1153}/mantemento.0x260.jpg (100%) rename site/assets/files/{1074 => 1153}/mantemento.jpg (100%) rename site/templates/{portada.php => inicio.php} (69%) rename site/templates/{xestion.php => xes-inicio.php} (100%) diff --git a/site/assets/files/1074/mantemento.0x260.jpg b/site/assets/files/1153/mantemento.0x260.jpg similarity index 100% rename from site/assets/files/1074/mantemento.0x260.jpg rename to site/assets/files/1153/mantemento.0x260.jpg diff --git a/site/assets/files/1074/mantemento.jpg b/site/assets/files/1153/mantemento.jpg similarity index 100% rename from site/assets/files/1074/mantemento.jpg rename to site/assets/files/1153/mantemento.jpg diff --git a/site/config.php b/site/config.php index 8cd9244..08075a6 100644 --- a/site/config.php +++ b/site/config.php @@ -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 + * `` or `` 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 ********************************************************************/ diff --git a/site/templates/portada.php b/site/templates/inicio.php similarity index 69% rename from site/templates/portada.php rename to site/templates/inicio.php index a68110e..49caf44 100644 --- a/site/templates/portada.php +++ b/site/templates/inicio.php @@ -3,17 +3,15 @@ $menu = ''; $contido = ''; -$mantemento = $inicio->mantemento; - $contido .= renderMigasPan($page) . "\n"; $contido .= '
' . "\n"; $contido .= '
' . "\n"; $contido .= '

' . ucfirst($inicio->title) . '

' . "\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 { diff --git a/site/templates/layout/func.php b/site/templates/layout/func.php index 22b0307..9c1adcf 100644 --- a/site/templates/layout/func.php +++ b/site/templates/layout/func.php @@ -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; diff --git a/site/templates/layout/init.php b/site/templates/layout/init.php index 461b41a..15be729 100644 --- a/site/templates/layout/init.php +++ b/site/templates/layout/init.php @@ -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']; \ No newline at end of file diff --git a/site/templates/layout/partial/main_head.php b/site/templates/layout/partial/main_head.php index 6336d16..4d69c4e 100644 --- a/site/templates/layout/partial/main_head.php +++ b/site/templates/layout/partial/main_head.php @@ -56,6 +56,15 @@ if($input->get->logout == true) --imaxe_destacada: imaxe ? 'url("'. $page->imaxe->url . '")' : 'none'; ?>; } + + + diff --git a/site/templates/layout/xes.php b/site/templates/layout/xes.php index 6f380c9..ef2f66a 100644 --- a/site/templates/layout/xes.php +++ b/site/templates/layout/xes.php @@ -1,11 +1,11 @@ children, 0, 'paxinas'); + include('./layout/partial/xes-head.php'); ?>
- +
get('/gestion'); - -$menu = renderMenu($gestion->children, 0, 'paxinas'); -$contido .= renderMigasPan($page) . "\n"; -$contido .= '
' . "\n"; -$contido .= '
' . "\n"; -$contido .= '

' . ucfirst($page->title) . '

' . "\n"; -$contido .= '
' . "\n"; -$contido .= '
' . "\n"; \ No newline at end of file + +
+
+

title); ?>

+
+
\ No newline at end of file