date.chapril.org-framadate/bandeaux.php

81 lines
2.7 KiB
PHP
Raw Normal View History

<?php
/**
* This software is governed by the CeCILL-B license. If a copy of this license
* is not distributed with this file, you can obtain one at
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.txt
*
* Authors of STUdS (initial project): Guilhem BORGHESI (borghesi@unistra.fr) and Raphaël DROZ
* Authors of Framadate/OpenSondate: Framasoft (https://github.com/framasoft)
*
* =============================
*
* Ce logiciel est régi par la licence CeCILL-B. Si une copie de cette licence
* ne se trouve pas avec ce fichier vous pouvez l'obtenir sur
* http://www.cecill.info/licences/Licence_CeCILL-B_V1-fr.txt
*
* Auteurs de STUdS (projet initial) : Guilhem BORGHESI (borghesi@unistra.fr) et Raphaël DROZ
* Auteurs de Framadate/OpenSondage : Framasoft (https://github.com/framasoft)
*/
2014-12-25 00:55:52 +01:00
use Framadate\Utils;
2011-05-15 01:32:47 +02:00
include_once __DIR__ . '/app/inc/init.php';
2011-05-15 03:56:54 +02:00
2011-05-15 01:32:47 +02:00
// bandeaux de titre
2011-05-15 03:56:54 +02:00
function bandeau_titre($titre)
{
global $ALLOWED_LANGUAGES;
2014-11-06 15:20:03 +01:00
$img = ( IMAGE_TITRE ) ? '<img src="'. Utils::get_server_name(). IMAGE_TITRE. '" alt="'.NOMAPPLICATION.'">' : '';
echo '
<header role="banner">';
if(count($ALLOWED_LANGUAGES)>1){
echo '<form method="post" action="#">
2014-10-21 01:31:26 +02:00
<div class="input-group input-group-sm pull-right col-md-2 col-xs-4">
<select name="lang" class="form-control" title="'. _("Select the language") .'" >' . liste_lang() . '</select>
<span class="input-group-btn">
<button type="submit" class="btn btn-default btn-sm" title="'. _("Change the language") .'">OK</button>
</span>
</div>
</form>';
}
echo '
<h1><a href="'.str_replace('/admin','', Utils::get_server_name()).'" title="'._("Home").' - '.NOMAPPLICATION.'">'.$img.'</a></h1>
2014-11-06 15:20:03 +01:00
<h2 class="lead"><i>'. $titre .'</i></h2>
<hr class="trait" role="presentation" />
</header>
2014-10-21 01:31:26 +02:00
<main role="main">';
global $connect;
if ($connect->areTablesCreated()) {
echo '<div class="alert alert-danger">'. _('Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.') .'</div>';
bandeau_pied();
die();
}
2011-05-15 01:32:47 +02:00
}
2011-05-15 03:56:54 +02:00
function liste_lang()
{
global $ALLOWED_LANGUAGES; global $lang;
2011-05-15 01:32:47 +02:00
$str = '';
2011-05-15 01:32:47 +02:00
foreach ($ALLOWED_LANGUAGES as $k => $v ) {
if (substr($k,0,2)==$lang) {
$str .= '<option lang="'.substr($k,0,2).'" selected value="' . $k . '">' . $v . '</option>' . "\n" ;
} else {
$str .= '<option lang="'.substr($k,0,2).'" value="' . $k . '">' . $v . '</option>' . "\n" ;
}
}
2011-05-15 01:32:47 +02:00
return $str;
2011-05-15 03:56:54 +02:00
}
function bandeau_pied($admin=false)
2011-05-15 03:56:54 +02:00
{
echo '
</main>
</div> <!-- .container -->
</body>
</html>'."\n";
}