Subversion Repositories eFlore/Applications.del

Rev

Rev 1821 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1821 Rev 1922
Line 76... Line 76...
76
		$retour = $this->initialiserService();
76
		$retour = $this->initialiserService();
77
		return $retour;
77
		return $retour;
78
	}
78
	}
Line 79... Line 79...
79
 
79
 
80
	private function analyserRessources() {
80
	private function analyserRessources() {
-
 
81
		if ($this->methode == 'consulter' && isset($this->ressources[0])) {
-
 
82
			if (preg_match('/^tags|votes-?-Par-?Tag|tags-?Par-?Protocole$/i', $this->ressources[0])) {
-
 
83
				$this->sousServiceNom = 'tags';
-
 
84
			} else if (preg_match('/^votes|votes-?Par-?Protocole$/i', $this->ressources[0])){
81
		if ($this->methode == 'consulter') {
85
				$this->sousServiceNom = 'votes';
82
			if (isset($this->ressources[0])) {
86
			} else if ($this->ressources[0] == 'commentaires') {
83
				$this->sousServiceNom = $this->ressources[0];
87
				$this->sousServiceNom = 'commentaires';
84
			}
88
			}
85
		}
89
		}
86
		if ($this->sousServiceNom == null) {
90
		if ($this->sousServiceNom == null) {
87
			$this->lancerMessageErreurRessource();
91
			$this->lancerMessageErreurRessource();
Line 107... Line 111...
107
			" Paramètres : \n".
111
			" Paramètres : \n".
108
			"  - format : $formatsAutorises";
112
			"  - format : $formatsAutorises";
109
	}
113
	}
Line 110... Line 114...
110
 
114
 
111
	private function initialiserService() {
115
	private function initialiserService() {
112
		$classe = $this->obtenirNomClasseService($this->sousServiceNom);
116
		$classe = $this->obtenirNomClasseService();
113
		$chemins = array();
117
		$chemins = array();
114
		$chemins[] = $this->cheminCourant.$this->serviceNom.DS.$classe.'.php';
118
		$chemins[] = $this->cheminCourant.$this->serviceNom.DS.$classe.'.php';
115
		$chemins[] = $this->cheminCourant.'commun'.DS.$classe.'.php';
119
		$chemins[] = $this->cheminCourant.'commun'.DS.$classe.'.php';
116
		$retour = '';
120
		$retour = '';
Line 140... Line 144...
140
			throw new Exception($message, $code);
144
			throw new Exception($message, $code);
141
		}
145
		}
142
		return $retour;
146
		return $retour;
143
	}
147
	}
Line 144... Line 148...
144
 
148
 
145
	private function obtenirNomClasseService($mot) {
149
	private function obtenirNomClasseService() {
146
		$classeNom = str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $mot))));
-
 
147
		return $classeNom;
150
		return str_replace(' ', '', ucwords(strtolower(str_replace('-', ' ', $this->sousServiceNom))));
Line 148... Line 151...
148
	}
151
	}
149
 
152
 
150
	private function creerResultatService($donnees) {
153
	private function creerResultatService($donnees) {