Subversion Repositories Sites.tela-botanica.org

Compare Revisions

Ignore whitespace Rev 380 → Rev 381

/trunk/scripts/bibliotheque/noyau/aModule.class.php
81,7 → 81,7
if (!is_null($this->getCacheDuree())) {
$fichier_cache .= '_['.$this->getCacheDuree().']';
}
$fichier_cache .= '.cache.'.$this->registre->get('format');
$fichier_cache .= '.cache.'.$this->getRegistre()->get('format');
return $fichier_cache;
}
89,7 → 89,7
public function getCacheDuree()
{
$dlc = null;
$methode_cache_dlc = 'getCacheDlc'.ucfirst($this->registre->get('action'));
$methode_cache_dlc = 'getCacheDlc'.$this->getActionNom();
if (method_exists($this, $methode_cache_dlc) && !is_null($this->$methode_cache_dlc())) {
$dlc = call_user_func(array($this, $methode_cache_dlc)); // dlc en seconde
}
99,7 → 99,7
public function getActionNom()
{
if ($this->getRegistre()->get('action') != null) {
return $action = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->registre->get('action'))));
return $action = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->getRegistre()->get('action'))));
}
return null;
}
195,10 → 195,22
$this->getRegistre()->set('squelette_moteur', aModule::TPL_PHP);
// Gestion du multilinguisme
//if (isset($GLOBALS['_EF_']['i18n'][$module_nom][$action])) {
//$this->getRegistre()->set('module_i18n', $GLOBALS['_EF_']['i18n'][$module_nom][$action]);
//}
/*
if (isset($GLOBALS['_EF_']['i18n'][$module_nom][$action]) || isset($GLOBALS['_EF_']['i18n']['_defaut_'][$action])) {
$this->getRegistre()->set('module_i18n', $GLOBALS['_EF_']['i18n']['_defaut_']['general']);
if (isset($GLOBALS['_EF_']['i18n']['_defaut_'][$action])) {
$this->getRegistre()->set('module_i18n', $GLOBALS['_EF_']['i18n']['_defaut_'][$action]);
}
if (isset($GLOBALS['_EF_']['i18n'][$module_nom][$action])) {
$this->getRegistre()->set('module_i18n', $GLOBALS['_EF_']['i18n'][$module_nom][$action]);
}
$aso_donnees = $this->getRegistre()->get('squelette_donnees');
$aso_donnees['i18n'] = $this->getRegistre()->get('module_i18n');
$this->getRegistre()->set('squelette_donnees', $aso_donnees);
}
*/
// Exécution du rendu de l'action
$sortie .= $this->traiterRendu($action);
}
236,10 → 248,21
}
if (method_exists($this, $methode_action)) {
call_user_func(array($this, $methode_action));
} else {
$e = 'La méthode '.$methode_action.' pour l\'action '.$this->registre->get('action').' n\'existe pas!';
trigger_error($e, E_USER_WARNING);
return null;
} else if (!$this->getSqueletteFichier()) {
// Tentative de recherche de l'action dans le module des Communs
$fichier_communs = SC_CHEMIN_MODULE.'communs'.DIRECTORY_SEPARATOR.'Communs.class.php';
if (file_exists($fichier_communs)) {
include_once $fichier_communs;
$Commun = new Communs();
$sortie_commun = $Commun->traiterAction();
}
if (isset($sortie_commun)) {
return $sortie_commun;
} else {
$e = 'Aucun squelette ou méthode "'.$methode_action.'" n\'existe pour l\'action '.$this->registre->get('action');
trigger_error($e, E_USER_WARNING);
return null;
}
}
 
// Gestion du rendu en fonction du type de template
246,10 → 269,8
switch($this->registre->get('squelette_moteur')) {
case aModule::TPL_PHP_MAIL :
case aModule::TPL_PHP :
$aso_donnees = $this->registre->get('squelette_donnees');
//$aso_donnees['i18n'] = $this->registre->get('module_i18n');
$Squelette = new SquelettePhp();
$Squelette->set($aso_donnees);
$Squelette->set($this->getRegistre()->get('squelette_donnees'));
if ($this->getSqueletteFichier()) {
$sortie = $Squelette->analyser($this->getSqueletteFichier());
if ($this->registre->get('squelette_moteur') == aModule::TPL_PHP_MAIL) {
277,9 → 298,10
// Gestion du cache : écriture du fichier
if ($this->cache_bool) {
if (!is_null($this->getCacheId())) {
$fp = fopen($this->getCacheFichier(), 'w');
fwrite($fp, $this->registre->get('sortie'));
fclose($fp);
if (!file_put_contents($this->getCacheFichier(), $this->getRegistre()->get('sortie'))) {
$e = 'Écriture du fichier de cache impossible : '.$this->getCacheFichier();
trigger_error($e, E_USER_WARNING);
}
}
}
307,7 → 329,7
return $this->getRegistre()->get('sortie');
break;
case aModule::SORTIE_EXIT_HTML :
echo $this->registre->get('sortie');
echo $this->getRegistre()->get('sortie');
exit();
break;
case aModule::SORTIE_XML :