Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 51 → Rev 57

/trunk/interfaces/controleurs/Versionnage.php
90,6 → 90,7
}
$donnees['messages'] = $this->getMessages();
$this->traiterEsperluette($donnees);
$this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
$this->construireMenu($this->referentiel);
$this->construireFilAriane($this->referentiel);
99,7 → 100,8
$version = array();
foreach ($this->version as $champ) {
if (isset($_POST[$champ])) {
$version[$champ] = stripslashes($_POST[$champ]);
$version[$champ] = $this->supprimerSlash($_POST[$champ]);
$version[$champ] = $this->traiterCasesACocher($version[$champ]);
} else {
$version[$champ] = $this->getValeurParDefaut($champ);
108,6 → 110,13
return $version;
}
private function traiterCasesACocher($valeur_post) {
if (is_array($valeur_post)) {
$valeur_post = array_flip($valeur_post);
}
return $valeur_post;
}
public function getValeurParDefaut($champ) {
$valeur = '';
if ('date_prod' == $champ) {
/trunk/interfaces/controleurs/AppliControleur.php
142,11 → 142,24
}
}
private function remplacerEsperluette($txt) {
protected function remplacerEsperluette($txt) {
$txt = preg_replace('/&(?!([a-z]+|#[0-9]+|#x[0-9a-f]+);)/i', '&', $txt, -1);
return $txt;
}
protected function supprimerSlash($doc) {
if (is_string($doc)) {
$doc = stripslashes($doc);
} else if (is_array($doc)) {
if (count($doc) > 0) {
foreach ($doc as $cle => $valeur) {
$doc[$cle] = $this->supprimerSlash($valeur);
}
}
}
return $doc;
}
protected function initialiserModulePrincipal() {
$_SESSION['module_principal'] = null;
}