123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- <?php require_once __DIR__.DIRECTORY_SEPARATOR.'common.php';
- $scheme = define_url_scheme();
- $mediaRoot = define_media_root();
- if($myUser->preference('passwordTime')!='' && !$myUser->superadmin){
- $basepage = explode('?',$page);
- $basepage = $basepage[0];
- if(is_numeric($conf->get('password_delay')) && $basepage!="account.php" && ( (time() - ($conf->get('password_delay') * 86400) > $myUser->preference('passwordTime')) ) ) header('location: account.php?error=Votre mot de passe est trop vieux, veuillez le renouveller ci dessous.');
- }
- //Redirige la home si définie dans les settings
- if(($page=='index.php' || $page==basename(ROOT_URL) || $page=='') && !isset($_['module']) && !empty($conf->get('home_page')))
- header('location:'.$conf->get('home_page'));
- $cssModule = array();
- foreach(array('module','page','section') as $term){
- if(isset($_[$term])) $cssModule[] = preg_replace('/([^a-z])/i', '-',$term.'-'.$_[$term]);
- }
- if(empty($cssModule) && ($page=='index.php' || $page==basename(ROOT_URL) || $page=='')) $cssModule[] = 'module-index';
- if(!isset($_['admin_login']) && file_exists('enabled.maintenance') && !$myUser->connected()){
- isset($_['error']) && !empty($_['error']) ? header('Location: maintenance.php?error='.$_['error']) : header('Location: maintenance.php');
- exit();
- } else {
- $mainMenu = array();
- Plugin::callHook("menu_main", array(&$mainMenu));
- uasort ($mainMenu , function($a,$b){return $a['sort']>$b['sort']?1:-1;});
-
- $userMenu = array();
- if ($myUser->connected()){
- Plugin::callHook("menu_user", array(&$userMenu));
- uasort ($userMenu , function($a,$b){return $a['sort']>$b['sort']?1:-1;});
- }
- ?>
- <!DOCTYPE html>
- <html class="html <?php echo implode(' ',$cssModule); ?>" lang="fr">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <meta name="description" content="">
- <meta name="author" content="">
- <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
- <link rel="shortcut icon" type="image/png" href="action.php?action=general_favicon_download" />
-
- <?php
- $title=$myUser->connected() ? 'Accueil':'Connexion';
- foreach($mainMenu as $item):
- $title = (!empty($item['url']) && strpos($page, $item['url']) !== false) ? $item['label'] : $title;
- endforeach;
- foreach($userMenu as $item):
- $title = (isset($item['url']) && strpos($page, $item['url']) !== false) ? $item['label'] : $title;
- endforeach;
- ?>
-
- <title><?php echo PROGRAM_NAME.' - '.$title ?></title>
-
- <!-- Bootstrap core CSS -->
- <link href="<?php echo $mediaRoot ?>/css/bootstrap.min.css" rel="stylesheet">
- <!-- Jquery ui -->
- <link rel="stylesheet" href="<?php echo $mediaRoot ?>/css/jquery-ui.min.css">
- <link rel="stylesheet" href="<?php echo $mediaRoot ?>/css/jquery.timepicker.min.css">
- <!-- Font awesome -->
- <link rel="stylesheet" href="<?php echo $mediaRoot ?>/css/fontawesome-all.min.css">
- <!-- Trumbowyg -->
- <link href="<?php echo $mediaRoot ?>/css/trumbowyg.min.css" rel="stylesheet">
- <link href="<?php echo $mediaRoot ?>/css/trumbowyg.table.css" rel="stylesheet">
- <link href="<?php echo $mediaRoot ?>/css/trumbowyg.colors.css" rel="stylesheet">
- <?php if(!$conf->get('offline_mode')): ?>
- <!-- Lato font-->
- <link href="https://fonts.googleapis.com/css?family=Lato:300,400" rel="stylesheet">
- <?php endif; ?>
- <!-- Custom styles for this template -->
- <link href="<?php echo $mediaRoot ?>/css/main.css?v=<?php echo $cacheVersion; ?>" rel="stylesheet">
- <!-- Plugin css files -->
- <?php echo Plugin::callCss($mediaRoot,$cacheVersion); ?>
- </head>
-
- <body>
- <!-- Fixed navbar -->
- <nav id="mainMenu" class="navbar navbar-expand-md navbar-dark fixed-top noPrint">
- <?php if ($myUser->connected()): ?>
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
- <div class="menu">
- <div class="menu-icon">
- <div class="menu-line menu-line-1"></div>
- <div class="menu-line menu-line-2"></div>
- <div class="menu-line menu-line-3"></div>
- <div class="menu-line menu-line-4"></div>
- <div class="menu-line menu-line-5"></div>
- </div>
- </div>
- </button>
- <?php endif; ?>
- <a class="navbar-brand" style="background-image: url('action.php?action=general_logo_download')" <?php echo $conf->get('logo_website_header') ? 'target="_blank" href="'.$conf->get('logo_website_header').'"' : 'href="index.php"'; ?>><?php echo $conf->get('show_application_name') ? PROGRAM_NAME : ''; ?></a>
- <div class="collapse navbar-collapse" id="navbarCollapse">
- <ul class="navbar-nav navbar-main">
- <?php foreach($mainMenu as $item): ?>
- <?php if (isset($item['label']) && $item['label'] == 'Réglages') $page = basename($_SERVER['PHP_SELF']);
- $classes = isset($item['classes'])? $item['classes']: '';
- if(isset($item['url'])
- && ((!empty($item['url'])
- && strpos($page, $item['url']) !== false
- && $item['url'] != 'index.php') || $page == $item['url'])
- || (isset($item['active']) && $item['active'] ==true)
- ){
- $classes .= ' active';
- }
- ?>
- <li data-id="<?php echo isset($item['id'])?$item['id']:''; ?>" class="nav-item <?php echo $classes; ?> ">
- <a class="nav-link"
- title="<?php echo isset($item['title'])?$item['title']:''; ?>"
- target="<?php echo isset($item['target'])?$item['target']:''; ?>"
- onclick="<?php echo isset($item['onclick'])?$item['onclick']:''; ?>"
- <?php echo isset($item['url'])? 'href="'.$item['url'].'"':''; ?>>
- <?php echo (isset($item['icon'])?'<i class="'.$item['icon'].'"></i> ':'').'<span>'.(isset($item['label'])?$item['label']:'').'</span>'; ?>
- <?php echo isset($item['html'])? $item['html']:''; ?>
- </a>
- </li>
- <?php endforeach; ?>
- </ul>
- <?php Plugin::callHook("header", array()); ?>
- <div id="loginHeader" class="ml-auto d-flex text-right">
- <?php Plugin::callHook("login_header", array());
- if(!$conf->get('hide_header_login') || $myUser->connected()): ?>
- <div class="dropdown user-dropdown-menu ml-1">
- <button class="btn btn-dark dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- <?php if ($myUser->connected()): ?>
- <img src="<?php echo $myUser->getAvatar(); ?>" class="avatar-mini avatar-rounded avatar-login" title="<?php echo htmlentities($myUser->fullName()); ?>">
- <?php else: ?>
- Connexion
- <?php endif;?>
- </button>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
- <?php if (!$myUser->connected()): ?>
- <div class="dropdown-item login-item">
- <form id="loginForm" data-action="login" class="form-inline mt-mb-0 login-form">
- <label for="login">Identifiant</label>
- <input name="login" id="login" maxlength="260" class="form-control form-control-sm mb-2" type="text" required="required" autofocus="true" autocomplete="username">
- <label for="password">Mot de passe</label>
- <input data-type="password" name="password" id="password" class="form-control form-control-sm " type="password" required="required" autocomplete="current-password">
- <div class="form-check connection-remember">
- <input data-type="checkbox" class="form-check-input" type="checkbox" id="rememberMe" name="rememberMe">
- <label class="form-check-label" for="rememberMe">Se souvenir de moi</label>
- </div>
- <div class="btn btn-success btn-sm w-100" id="login-button" onclick="core_login(this,'body>.container-fluid')" tabindex="0">Se connecter</div>
- <?php if($conf->get('password_allow_lost')): ?>
- <a href="account.lost.php" title="Changer son mot de passe oublié" class="d-block w-100 text-center mt-1 lost-password">Mot de passe oublié ?</a>
- <?php endif; ?>
- </form>
- </div>
- <?php else: ?>
- <div class="font-weight-bold text-primary p-2 text-center user-fullname"><?php echo $myUser->fullName(); ?></div>
- <?php foreach($userMenu as $item): ?>
- <?php if(isset($item['custom'])):
- echo $item['custom'];
- else: ?>
- <a class="dropdown-item user-menu-item" href="<?php echo $item['url']; ?>">
- <?php echo (isset($item['icon'])?'<i class="'.$item['icon'].'"></i> ':'').$item['label']; ?>
- </a>
- <?php endif; ?>
- <?php endforeach; ?>
- <?php endif; ?>
- </div>
- </div>
- <?php endif; ?>
- </div>
- </div>
- </nav>
-
- <!-- Begin page content -->
- <div class="container-fluid">
- <?php } ?>
|