Skip to content

Commit

Permalink
feat: gestione dei meta title nei moduli
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoPistorello committed Jan 21, 2025
1 parent 4d8da59 commit 964b323
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
12 changes: 10 additions & 2 deletions include/top.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,15 @@
$paths = App::getPaths();
$user = Auth::user();

$pageTitle = !empty($pageTitle) ? $pageTitle : ($structure ? $structure->getTranslation('title') : tr('OpenSTAManager'));
if (empty($pageTitle)) {
if ($structure->getTranslation('meta_title') && !empty($id_record)) {
$pageTitle = $structure->replacePlaceholders($id_record, $structure->getTranslation('meta_title'));
} elseif ($structure) {
$pageTitle = $structure->getTranslation('title');
} else {
$pageTitle = tr('OpenSTAManager');
}
}

$lang = (empty($lang) || $lang == '|lang|') ? 'it_IT' : $lang;

Expand All @@ -37,7 +45,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>'.$pageTitle.' - '.tr('OpenSTAManager').'</title>
<title>'.$pageTitle.'</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
Expand Down
5 changes: 4 additions & 1 deletion update/2_7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ INSERT INTO `zz_settings` (`nome`, `valore`, `tipo`, `editable`, `sezione`, `ord
SELECT @id_record := `id` FROM `zz_settings` WHERE `nome` = "Conto predefinito per le spese d'incasso";
INSERT INTO `zz_settings_lang` (`id_lang`, `id_record`, `title`, `help`) VALUES
('1', @id_record, "Conto predefinito per le spese d'incasso", ''),
('2', @id_record, 'Default account for collection costs', '');
('2', @id_record, 'Default account for collection costs', '');

-- Gestione meta title dei moduli
ALTER TABLE `zz_modules_lang` ADD `meta_title` VARCHAR(255) NOT NULL AFTER `title`;

0 comments on commit 964b323

Please sign in to comment.