Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 270 | Rev 960 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 270 Rev 288
Line 12... Line 12...
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
13
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
14
 * @version		$Id$
14
 * @version		$Id$
15
 */
15
 */
16
class FicheMetadonnees extends aControleur {
16
class FicheMetadonnees extends aControleur {
17
	
17
 
18
	private $projet = '';	
18
	private $projet = '';
19
	private $serviceMetaDonnees;
19
	private $serviceMetaDonnees;
20
	
20
 
21
	public function __construct($metadonnees = null) {
21
	public function __construct($metadonnees = null) {
22
		$this->capturerParametres();
22
		$this->capturerParametres();
23
		$this->serviceMetaDonnees = (is_null($this->serviceMetaDonnees)) ? new MetaDonnees($this->projet) : $metadonnees;
23
		$this->serviceMetaDonnees = (is_null($this->serviceMetaDonnees)) ? new MetaDonnees($this->projet) : $metadonnees;
24
	}
24
	}
25
		
25
 
26
	public function executerActionParDefaut() {
26
	public function executerActionParDefaut() {
27
		$this->executerAffichageMetaDonnees();
27
		$this->executerAffichageMetaDonnees();
28
	}
28
	}
29
	
29
 
30
	public function chargerMetadonneesHtml() {
30
	public function chargerMetadonneesHtml() {
31
		$donnees['metadonnees'] = $this->serviceMetaDonnees->getMetaDonnees();
31
		$donnees['metadonnees'] = $this->serviceMetaDonnees->getMetaDonnees();
32
		$html = $this->getVue(dirname(__FILE__).'/squelettes/metadonnees', $donnees);
32
		$html = $this->getVue(dirname(__FILE__).'/squelettes/metadonnees', $donnees);
33
		return $html;
33
		return $html;
34
	}
34
	}
35
	
35
 
36
	public function executerAffichageMetaDonnees($donnees) {
36
	public function executerAffichageMetaDonnees($donnees) {
37
		header('Content-type: text/html');
37
		header('Content-type: text/html');
38
		$html = $this->chargerMetadonneesHtml();
38
		$html = $this->chargerMetadonneesHtml();
39
		echo $html;
39
		echo $html;
40
		exit;
40
		exit;
41
	}
41
	}
42
		
42
 
43
	private function capturerParametres() {
43
	private function capturerParametres() {
44
		if (isset($_GET['projet'])) {
44
		if (isset($_GET['projet'])) {
45
			$this->projet = $_GET['projet'];
45
			$this->projet = $_GET['projet'];
46
		}
46
		}
47
	}
47
	}
48
	
-
 
49
	protected function recupererTableauConfig($param) {
-
 
50
		$tableau = array();
-
 
51
		$tableauPartiel = explode(',', Config::get($param));
-
 
52
		$tableauPartiel = array_map('trim', $tableauPartiel);
-
 
53
		foreach ($tableauPartiel as $champ) {
-
 
54
			if (strpos($champ, '=') === false) {
-
 
55
				$tableau[] = $champ;
-
 
56
			} else {
-
 
57
				list($cle, $val) = explode('=', $champ);
-
 
58
				$tableau[$cle] = $val;
-
 
59
			}
-
 
60
		}
-
 
61
		return $tableau;
-
 
62
	}
-
 
63
}
48
}
64
?>
49
?>
65
50