diff --git a/apps/maarch_entreprise/index.php b/apps/maarch_entreprise/index.php index 7809299dd056132e7bd6289ff1b67433850e33c5..abb911e3d80eb18fd8482d887700c7ae12195915 100755 --- a/apps/maarch_entreprise/index.php +++ b/apps/maarch_entreprise/index.php @@ -355,7 +355,7 @@ if ($_REQUEST['page'] && empty($_REQUEST['triggerAngular'])) { $user = \User\models\UserModel::getByUserId(['userId' => $cookie['userId'], 'select' => ['password_modification_date', 'change_password', 'status']]); //HTML CONTENT OF ANGULAR - echo '<body></body>'; + echo \SrcCore\models\CoreConfigModel::initAngularStructure(); if ($user['status'] == 'ABS') { $_REQUEST['triggerAngular'] = 'activateUser'; diff --git a/src/core/models/CoreConfigModel.php b/src/core/models/CoreConfigModel.php index 4c501b43a049a65438d355986a75d6de5e2676cf..7a6c7f8b84cc74ac2895bf18892753a90ef5932f 100644 --- a/src/core/models/CoreConfigModel.php +++ b/src/core/models/CoreConfigModel.php @@ -203,4 +203,40 @@ class CoreConfigModel return $xmlfile; } + + public static function getFavIcon(array $aArgs) + { + ValidatorModel::notEmpty($aArgs, ['path']); + ValidatorModel::stringType($aArgs, ['path']); + + $customId = CoreConfigModel::getCustomId(); + + if (file_exists("custom/{$customId}/{$aArgs['path']}")) { + $path = "custom/{$customId}/{$aArgs['path']}"; + } else { + $path = $aArgs['path']; + } + + return $path; + } + + public static function initAngularStructure() + { + $lang = CoreConfigModel::getLanguage(); + $appName = CoreConfigModel::getApplicationName(); + $favIconPath = CoreConfigModel::getFavIcon(["path" => "apps/maarch_entreprise/img/logo_only.svg"]); + + $structure = '<!doctype html>'; + $structure = "<html lang='{$lang}'>"; + $structure .= '<head>'; + $structure .= "<meta charset='utf-8'>"; + $structure .= "<title>{$appName}</title>"; + $structure .= "<link rel='icon' href='../../{$favIconPath}' />"; + $structure .= '</head>'; + $structure .= '<body>'; + $structure .= '</body>'; + $structure .= '</html>'; + + return $structure; + } }