Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 3280 → Rev 3281

/trunk/widget/modules/manager/Manager.php
48,11 → 48,9
$framework = dirname( __FILE__ ) . '/framework.php';
 
if ( !file_exists( $framework ) ) {
 
$e = 'Veuillez paramĂȘtrer l\'emplacement et la version du Framework dans le fichier $framework';
trigger_error( $e, E_USER_ERROR );
} else {
 
// Inclusion du Framework
require_once $framework;
// Ajout d'information concernant cette application
61,7 → 59,6
}
 
if ( !isset( $mode ) ) {
 
$mode = self::SERVICE_DEFAUT;
}
 
68,16 → 65,13
$this->cel_url_tpl = $this->config['manager']['celUrlTpl'];
 
if ( $_POST !== array() ) { //print_r($_POST);
 
$this->parametres['projet'] = $_POST['projet'];
$this->parametres['langue'] = $_POST['langue'];
 
if ( $mode === 'modification' ) {
 
$parametres = $this->traiterParametresModif();
$json = $this->getDao()->modifier( $this->cel_url_tpl, $parametres );
} else {
 
$donnees = array_merge( $_POST, $this->traiterDonneesFiles() );
// var_dump($donnees);
$json = $this->getDao()->ajouter( $this->cel_url_tpl, $donnees );
87,7 → 81,6
 
$methode = $this->traiterNomMethodeExecuter( $mode );
if ( method_exists( $this, $methode ) ) {
 
$retour = $this->$methode();
} else {
 
101,7 → 94,6
} else {
 
if ( isset( $retour['donnees'] ) ) {
 
$retour['donnees']['params'] = '&projet=' . $_POST['projet'] . '&langue=' . $_POST['langue'];
$retour['donnees']['prod'] = ( $this->config['parametres']['modeServeur'] === 'prod' );
$retour['donnees']['bar'] = $this->bar;
124,7 → 116,6
 
foreach ( $this->parametres_autorises as $id => $pa ) {
if ( isset( $this->parametres[$pa] ) ) {
 
$params[] = $pa . '=' . $this->parametres[$pa];
}
}
133,7 → 124,6
$url = $this->cel_url_tpl;
 
if ( $param !== '' ) {
 
$url .= '?' . $param;
}
 
154,7 → 144,6
$retour['donnees']['widget'] = array();
 
if ( isset( $this->parametres['projet'] ) ) {
 
$url = $this->cel_url_tpl . '?projet=' . $this->parametres['projet'];
$json = $this->getDao()->consulter( $url );
$tableau = (array) json_decode( $json, true );
191,7 → 180,7
}
private function traiterParametres() {
$parametres_flux = '?';
$criteres = array( 'utilisateur', 'commune', 'dept', 'taxon', 'commentaire', 'date', 'tag', 'motcle', 'projet', 'num_taxon', 'num_nom', 'referentiel', 'groupe_zones_geo' );
$criteres = array( 'projet', 'langue', 'titre' );
 
foreach( $this->parametres as $nom_critere => $valeur_critere ) {
if ( in_array( $nom_critere, $criteres ) ) {
215,7 → 204,6
$parametres_modif[$id] = $parametres;
}
}
 
return $parametres_modif;
}