Subversion Repositories eFlore/Applications.cel-consultation

Rev

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

Rev 3 Rev 11
Line 40... Line 40...
40
    	$this->setSortie(self::RENDU_CORPS, $formulaire);     
40
    	$this->setSortie(self::RENDU_CORPS, $formulaire);     
41
    }
41
    }
Line 42... Line 42...
42
    
42
    
Line 43... Line 43...
43
    public function rechercherImage() {
43
    public function rechercherImage() {
44
    	
44
    	
45
        if(!isset($_GET['image_recherche']) || trim($_GET['image_recherche']) == '') {
45
        if (!isset($_GET['image_recherche']) || trim($_GET['image_recherche']) == '') {
Line 46... Line 46...
46
    		$_GET['image_recherche'] = '';
46
    		$_GET['image_recherche'] = '';
47
    	}
47
    	}
48
    	
48
    	
Line 49... Line 49...
49
    	if(isset($_GET['start'])) {
49
    	if (isset($_GET['start'])) {
50
    		$this->start = $_GET['start'];
50
    		$this->start = $_GET['start'];
51
    	}
51
    	}
Line 52... Line 52...
52
    	
52
    	
Line 53... Line 53...
53
        if(isset($_GET['limit'])) {
53
        if (isset($_GET['limit'])) {
54
    		$this->limit = $_GET['limit'];
54
    		$this->limit = $_GET['limit'];
55
    	}
55
    	}
56
    	
56
    	
57
    	$critere_pour_dao = $_GET['image_recherche'];
57
    	$critere_pour_dao = $_GET['image_recherche'];
Line 72... Line 72...
72
    
72
    
Line 73... Line 73...
73
    public function afficherResultatRechercheImage($donnees_images, $criteres = '') {
73
    public function afficherResultatRechercheImage($donnees_images, $criteres = '') {
Line 74... Line 74...
74
    	
74
    	
75
    	$images = array();
75
    	$images = array();
76
    	    	
76
    	    	
77
    	if(isset($donnees_images['images'])) {
77
    	if (isset($donnees_images['images'])) {
Line 78... Line 78...
78
    		$images = $donnees_images['images'];
78
    		$images = $donnees_images['images'];
Line 79... Line 79...
79
    		$this->total_resultats = $donnees_images['total'];
79
    		$this->total_resultats = $donnees_images['total'];
80
    	}
80
    	}
Line 81... Line 81...
81
    	
81
    	
-
 
82
    	foreach ($images as &$image) {
-
 
83
    		
-
 
84
			$taille_image = array($image['ci_meta_height'],$image['ci_meta_width']);
-
 
85
			$image['taille'] = $this->calculerDimensionPourVignette($taille_image);
82
    	foreach($images as &$image) {
86
    		
83
    		
87
    		$id = $image['coi_ce_image'];
84
			$taille_image = array($image['ci_meta_height'],$image['ci_meta_width']);
88
    		
Line 85... Line 89...
85
			$image['taille'] = $this->calculerDimensionPourVignette($taille_image);
89
    		$format_galerie = Config::get('format_image_galerie');
Line 86... Line 90...
86
    		
90
    		$format_zoom = Config::get('format_image_zoom');
Line 99... Line 103...
99
    
103
    
100
    // +---------------------------------------------------------------------------------------------------------------+
104
    // +---------------------------------------------------------------------------------------------------------------+
101
    // METHODES D'AFFICHAGE DE PAGE
105
    // METHODES D'AFFICHAGE DE PAGE
Line 102... Line 106...
102
    public function afficherBarrePagination($criteres) {
106
    public function afficherBarrePagination($criteres) {
103
    	    	
107
    	    	
104
    	if(isset($_GET['start'])) {
108
    	if (isset($_GET['start'])) {
Line 105... Line 109...
105
    		$this->start = $_GET['start'];
109
    		$this->start = $_GET['start'];
106
    	}
110
    	}
107
    	
111
    	
Line 108... Line 112...
108
        if(isset($_GET['limit'])) {
112
        if (isset($_GET['limit'])) {
109
    		$this->limit = $_GET['limit'];
113
    		$this->limit = $_GET['limit'];
110
    	}
114
    	}
111
    	
115
    	
112
    	if($this->start == 0) {
116
    	if ($this->start == 0) {
Line 113... Line 117...
113
    		$page_en_cours = 1;
117
    		$page_en_cours = 1;
114
    	} else if($this->total_resultats != 0) {	    	
118
    	} else if ($this->total_resultats != 0) {	    	
115
    		$page_en_cours = floor(($this->start + 1)/$this->limit + 1);
119
    		$page_en_cours = floor(($this->start + 1)/$this->limit + 1);
Line 116... Line 120...
116
    	}
120
    	}
117
    	
121
    	
118
    	$pages_avant_apres = (ceil($this->intervalle_pages /2) + 1);
122
    	$pages_avant_apres = (ceil($this->intervalle_pages /2) + 1);
119
    	$pages_debut_intervalle = 0;
123
    	$pages_debut_intervalle = 0;
120
    	$nb_pages = 0;
124
    	$nb_pages = 0;
Line 131... Line 135...
131
    	    	
135
    	    	
Line 132... Line 136...
132
    	$donnees['url_base_pagination'] = '?module=Image&action=rechercherImage&image_recherche='.$criteres.'&limit='.$this->limit.'&start=';
136
    	$donnees['url_base_pagination'] = '?module=Image&action=rechercherImage&image_recherche='.$criteres.'&limit='.$this->limit.'&start=';
Line 133... Line 137...
133
    	
137
    	
134
    	$nb_pages = ceil($this->total_resultats/$this->limit);  
138
    	$nb_pages = ceil($this->total_resultats/$this->limit);  
135
 
139
 
Line 136... Line 140...
136
        if($page_en_cours == $nb_pages) {
140
        if ($page_en_cours == $nb_pages) {
137
    		$intervalle_max = $this->total_resultats;
141
    		$intervalle_max = $this->total_resultats;
Line 164... Line 168...
164
		$niveauDossier = split("_", $id) ;
168
		$niveauDossier = split("_", $id) ;
Line 165... Line 169...
165
	
169
	
166
		$dossierNiveau1 = $niveauDossier[0] ;
170
		$dossierNiveau1 = $niveauDossier[0] ;
Line 167... Line -...
167
		$dossierNiveau2 = $niveauDossier[1] ;
-
 
168
		
-
 
169
		$fichier_s = $chemin_sur_serveur.'/'.$dossierNiveau1.'/'.$dossierNiveau2.'/S/'.$id.'_S.jpg' ;
171
		$dossierNiveau2 = $niveauDossier[1] ;
Line 170... Line -...
170
		$fichier_m = $chemin_sur_serveur.'/'.$dossierNiveau1.'/'.$dossierNiveau2.'/M/'.$id.'_M.jpg' ;
-
 
171
		$fichier_l = $chemin_sur_serveur.'/'.$dossierNiveau1.'/'.$dossierNiveau2.'/L/'.$id.'_L.jpg' ;
-
 
172
		
172
		
173
		switch($format) {
-
 
174
			case 'S':
-
 
175
				return $fichier_s;
-
 
176
			break;
-
 
177
			
-
 
178
			case 'M':
-
 
179
				return $fichier_m;
-
 
180
			break;
-
 
181
			
-
 
182
			case 'L':
-
 
183
				return $fichier_l;
-
 
184
			break;
-
 
185
			
-
 
186
			default:
-
 
187
				return $fichier_m;
173
		$fichier = $chemin_sur_serveur.'/'.$dossierNiveau1.'/'.$dossierNiveau2.'/'.$format.'/'.$id.'_'.$format.'.jpg' ;
Line -... Line 174...
-
 
174
		
188
			break;
175
		return $fichier;
189
		}
176
	}
190
	}
177
	
191
	
178
	// commentaire 
192
	private function getTypeMime($format) {
179
	private function getTypeMime($format) {
Line 206... Line 193...
206
	}
193
	}
Line 207... Line 194...
207
	
194
	
Line 208... Line 195...
208
	private function calculerDimensionPourVignette($tab_dimension_originale) {
195
	private function calculerDimensionPourVignette($tab_dimension_originale) {
209
 
-
 
210
		$taille_max = Config::get('taille_max_vignettes');
-
 
211
 
-
 
Line 212... Line -...
212
        $maxTailleHW = max($tab_dimension_originale[1],$tab_dimension_originale[0]) ;
-
 
213
        $XYresize = array();
-
 
214
        
-
 
215
        $rapport = $tab_dimension_originale[1]/$tab_dimension_originale[0] ;
-
 
216
        $XYresize[0] = $taille_max ;
196
 
Line 217... Line 197...
217
        $XYresize[1] = $taille_max*$rapport ;
197
		$taille_max = Config::get('taille_max_vignettes');
Line 218... Line 198...
218
 
198