2013-03-04 19:46:06 +01:00
< ? php
2014-09-04 17:52:18 +02:00
/**
* 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
2016-08-04 22:26:37 +02:00
* Authors of Framadate / OpenSondage : Framasoft ( https :// github . com / framasoft )
2014-09-04 17:52:18 +02:00
*
2014-07-04 11:21:31 +02:00
* =============================
2014-09-04 17:52:18 +02:00
*
* 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
*
2014-07-04 11:21:31 +02:00
* Auteurs de STUdS ( projet initial ) : Guilhem BORGHESI ( borghesi @ unistra . fr ) et Raphaël DROZ
2014-09-04 17:52:18 +02:00
* Auteurs de Framadate / OpenSondage : Framasoft ( https :// github . com / framasoft )
2014-07-04 11:21:31 +02:00
*/
2014-12-25 00:55:52 +01:00
use Framadate\Utils ;
2011-05-15 01:32:47 +02:00
2014-09-04 17:52:18 +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 )
{
2014-11-14 17:35:22 +01:00
global $ALLOWED_LANGUAGES ;
2018-02-19 00:18:43 +01:00
$img = ( IMAGE_TITRE ) ? '<img src="' . Utils :: get_server_name () . IMAGE_TITRE . '" alt="' . NOMAPPLICATION . '" class="img-responsive">' : '' ;
2014-09-04 17:52:18 +02:00
echo '
2014-11-11 20:28:14 +01:00
< header role = " banner " > ' ;
2015-03-04 23:46:42 +01:00
if ( count ( $ALLOWED_LANGUAGES ) > 1 ){
2021-12-17 14:05:19 +01:00
echo ' < form method = " post " class = " hidden-print " >
2014-10-21 01:31:26 +02:00
< div class = " input-group input-group-sm pull-right col-md-2 col-xs-4 " >
2018-02-19 00:18:43 +01:00
< select name = " lang " class = " form-control " title = " ' . __('Language selector', 'Select the language') . ' " > ' . liste_lang() . ' </ select >
2014-09-04 17:52:18 +02:00
< span class = " input-group-btn " >
2018-02-19 00:18:43 +01:00
< button type = " submit " class = " btn btn-default btn-sm " title = " ' . __('Language selector', 'Change the language') . ' " > OK </ button >
2014-09-04 17:52:18 +02:00
</ span >
</ div >
2014-11-11 20:28:14 +01:00
</ form > ' ;
2014-11-14 17:35:22 +01:00
}
2014-11-11 20:28:14 +01:00
echo '
2015-03-30 15:19:56 +02:00
< h1 >< a href = " ' . Utils::get_server_name() . ' " title = " ' . __('Generic', 'Home') . ' - ' . NOMAPPLICATION . ' " > ' . $img . ' </ a ></ h1 >
2018-02-19 00:18:43 +01:00
< h2 class = " lead " >< i > ' . $titre . ' </ i ></ h2 >
2014-11-14 17:35:22 +01:00
< hr class = " trait " role = " presentation " />
2014-09-04 17:52:18 +02:00
</ header >
2014-10-21 01:31:26 +02:00
< main role = " main " > ' ;
2021-12-17 14:08:09 +01:00
2014-12-03 21:08:08 +01:00
global $connect ;
2014-12-31 01:33:56 +01:00
$tables = $connect -> allTables ();
2015-01-01 01:18:49 +01:00
$diff = array_diff ([ Utils :: table ( 'comment' ), Utils :: table ( 'poll' ), Utils :: table ( 'slot' ), Utils :: table ( 'vote' )], $tables );
2018-02-19 00:18:43 +01:00
if ( 0 !== count ( $diff )) {
echo '<div class="alert alert-danger">' . __ ( 'Error' , 'Framadate is not properly installed, please check the "INSTALL" to setup the database before continuing.' ) . '</div>' ;
2014-12-03 21:08:08 +01:00
bandeau_pied ();
die ();
}
2011-05-15 01:32:47 +02:00
}
2021-12-20 17:46:50 +01:00
function liste_lang () : string
2011-05-15 03:56:54 +02:00
{
2015-04-13 11:24:44 +02:00
global $ALLOWED_LANGUAGES ; global $locale ;
2011-05-15 01:32:47 +02:00
2014-09-04 17:52:18 +02:00
$str = '' ;
2011-05-15 01:32:47 +02:00
2014-09-04 17:52:18 +02:00
foreach ( $ALLOWED_LANGUAGES as $k => $v ) {
2021-12-20 17:46:50 +01:00
if ( strpos ( $k , $locale ) === 0 ) {
2018-02-19 00:18:43 +01:00
$str .= '<option lang="' . substr ( $k , 0 , 2 ) . '" selected value="' . $k . '">' . $v . '</option>' . " \n " ;
2014-09-04 17:52:18 +02:00
} else {
2018-02-19 00:18:43 +01:00
$str .= '<option lang="' . substr ( $k , 0 , 2 ) . '" value="' . $k . '">' . $v . '</option>' . " \n " ;
2014-09-04 17:52:18 +02:00
}
}
2011-05-15 01:32:47 +02:00
2014-09-04 17:52:18 +02:00
return $str ;
2011-05-15 03:56:54 +02:00
}
2015-03-04 23:46:42 +01:00
function bandeau_pied ()
2011-05-15 03:56:54 +02:00
{
2014-09-04 17:52:18 +02:00
echo '
</ main >
</ div > <!-- . container -->
</ body >
2018-02-19 00:18:43 +01:00
</ html > ' . " \n " ;
2011-12-30 03:34:02 +01:00
}