Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1476 | Rev 1479 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1474 delphine 1
<?php
2
 
3
function __autoload($nom_classe) {
4
	$chemins = array(
5
			'..'.DS.'bibliotheque'.DS.'dao',
6
			'..'.DS.'bibliotheque'.DS.'utilitaires',
7
			'bibliotheque'.DS.'pear','composants');	foreach ($chemins as $chemin) {
8
		$fichier_a_inclure = dirname(__FILE__).DS.$chemin.DS.$nom_classe.'.php';
9
		if (file_exists($fichier_a_inclure)) {
10
			include_once $fichier_a_inclure;
11
			return null;
12
		}
13
	}
14
}
15
 
16
// ATTENTION: aucune autre langue que le français n'est supportée pour eflore
17
// pour le moment on supprime le paramètre à la main car la présence des fichiers d'i18n n'est pas testée
18
if(isset($_GET['langue'])) {
19
	unset($_GET['langue']);
20
}
21
 
1477 mathias 22
// Inclusion du Framework
23
$framework = __DIR__ . '/framework.php';
24
require_once $framework;
1474 delphine 25
 
1477 mathias 26
// Ajout d'information concernant cette application
27
Framework::setCheminAppli(__FILE__);// Obligatoire
28
Framework::setInfoAppli(Config::get('info'));// Optionnel
1474 delphine 29
 
1477 mathias 30
// Annuler les fausses bonnes idées du JPFramework
31
restore_exception_handler();
32
restore_error_handler();
33
//error_reporting(E_ALL ^ E_NOTICE);
1474 delphine 34
 
1477 mathias 35
// Configuration spécifique à Wordpress (URL racine, fichier d'index)
36
Config::charger(__DIR__ . "/configurations/config_wordpress.ini");
1474 delphine 37
 
1477 mathias 38
// Configuration issue de la page ACF "Applis externes"
39
Config::set('base_url_application', $chemin_eflore_http);
1474 delphine 40
 
1477 mathias 41
// Initialisation du controleur principal de l'application
42
AppControleur::initialiser();
1474 delphine 43
 
1477 mathias 44
// Hook d'ajout des scripts
45
add_action('wp_enqueue_scripts', 'eflore_scripts_et_styles');
1474 delphine 46
 
1477 mathias 47
// ajout des scripts - utiliser dans le hook ci-dessus uniquement
48
function eflore_scripts_et_styles() {
49
	global $chemin_eflore_http;
50
	// Styles
51
	wp_enqueue_style('eFlore-wordpress', $chemin_eflore_http . '/presentations/styles/eflore_wordpress.css');
52
	wp_enqueue_style('jquery-ui', 'https://resources.tela-botanica.org/jquery/jquery-ui/1.10.2/css/smoothness/jquery-ui-1.10.2.custom.css');
53
	wp_enqueue_style('jquery-fancybox', 'https://resources.tela-botanica.org/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.css');
1474 delphine 54
 
1477 mathias 55
	// Scripts
56
	// @TODO remplacer ce patch cracra par une mise à jour du code JS d'eFlore
57
	wp_enqueue_script('jquery-noconflict-compat', 'https://resources.tela-botanica.org/jquery/jquery-noconflict-compat.js');
58
	//wp_enqueue_script('jquery', 'https://resources.tela-botanica.org/jquery/1.9.1/jquery.min.js');
59
	wp_enqueue_script('jquery-cookie', 'https://resources.tela-botanica.org/jquery/cookie/1.0/jquery.cookie.min.js');
60
	wp_enqueue_script('jquery-ui', 'https://resources.tela-botanica.org/jquery/jquery-ui/1.10.2/js/jquery-ui-1.10.2.custom.min.js');
61
	wp_enqueue_script('jquery-fancybox', 'https://resources.tela-botanica.org/jquery/fancybox/1.3.4/jquery.fancybox-1.3.4.pack.js');
1474 delphine 62
 
1477 mathias 63
	//wp_enqueue_script('eFlore-commun', $chemin_eflore_http . '/presentations/scripts/commun.js');
64
	wp_enqueue_script('eFlore-eFlore', $chemin_eflore_http . '/presentations/scripts/eflore.js');
65
	wp_enqueue_script('eFlore-recherche', $chemin_eflore_http . '/presentations/scripts/recherche.js');
66
	wp_enqueue_script('eFlore-fiche-synthese', $chemin_eflore_http . '/presentations/scripts/fiche-synthese.js');
67
	wp_enqueue_script('eFlore-fiche-synthese', $chemin_eflore_http . '/presentations/scripts/fiche-synthese.js');
68
}
1474 delphine 69
 
1477 mathias 70
// Affichage du contenu de l'application
71
function eflore_get_contenu() {
72
	return AppControleur::getContenuCorps();
73
}