Changeset 666
- Timestamp:
- 11/28/07 00:53:39 (1 year ago)
- Files:
-
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (1 diff)
- trunk/lib/jelix/core/defaultconfig.ini.php (modified) (1 diff)
- trunk/lib/jelix/core/response/jResponseHtml.class.php (modified) (2 diffs)
- trunk/lib/jelix/core/response/jResponseHtml.class.php (modified) (2 diffs)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (1 diff)
- trunk/testapp/var/config/defaultconfig.ini.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/jelix/core/defaultconfig.ini.php
r665 r666 72 72 emailHeaders = "Content-Type: text/plain; charset=UTF-8\nFrom: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n" 73 73 quietMessage="A technical error has occured. Sorry for this trouble." 74 75 showInFirebug = off 74 76 75 77 ; mots clés que vous pouvez utiliser : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE trunk/lib/jelix/core/defaultconfig.ini.php
r665 r666 72 72 emailHeaders = "Content-Type: text/plain; charset=UTF-8\nFrom: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n" 73 73 quietMessage="A technical error has occured. Sorry for this trouble." 74 75 showInFirebug = off 74 76 75 77 ; mots clés que vous pouvez utiliser : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE trunk/lib/jelix/core/response/jResponseHtml.class.php
r663 r666 176 176 177 177 if($this->hasErrors()){ 178 echo '<div id="jelixerror" style="position:absolute;left:0px;top:0px;border:3px solid red; background-color:#f39999;color:black;">'; 179 echo $this->getFormatedErrorMsg(); 180 echo '<p><a href="#" onclick="document.getElementById(\'jelixerror\').style.display=\'none\';return false;">fermer</a></p></div>'; 178 if($GLOBALS['gJConfig']->error_handling['showInFirebug']){ 179 echo '<script type="text/javascript">if(console){'; 180 foreach( $GLOBALS['gJCoord']->errorMessages as $e){ 181 switch ($e[0]) { 182 case 'warning': 183 echo 'console.warn("[warning '; 184 break; 185 case 'notice': 186 echo 'console.info("[notice '; 187 break; 188 case 'strict': 189 echo 'console.info("[strict '; 190 break; 191 case 'error': 192 echo 'console.error("[error '; 193 break; 194 } 195 echo $e[1].'] '.str_replace('"','\"',$e[2]),' (',$e[3],' ',$e[4],')");'; 196 } 197 echo '}else{alert("there are some errors, you should activate Firebug to see them");}</script>'; 198 }else{ 199 echo '<div id="jelixerror" style="position:absolute;left:0px;top:0px;border:3px solid red; background-color:#f39999;color:black;">'; 200 echo $this->getFormatedErrorMsg(); 201 echo '<p><a href="#" onclick="document.getElementById(\'jelixerror\').style.display=\'none\';return false;">fermer</a></p></div>'; 202 } 181 203 } 182 204 echo implode("\n",$this->_bodyBottom); … … 224 246 $errors=''; 225 247 foreach( $GLOBALS['gJCoord']->errorMessages as $e){ 226 // FIXME : Pourquoi utiliser htmlentities() ? 227 $errors .= '<p style="margin:0;"><b>['.$e[0].' '.$e[1].']</b> <span style="color:#FF0000">'.htmlentities($e[2], ENT_NOQUOTES, $this->_charset)."</span> \t".$e[3]." \t".$e[4]."</p>\n"; 248 $errors .= '<p style="margin:0;"><b>['.$e[0].' '.$e[1].']</b> <span style="color:#FF0000">'.htmlspecialchars($e[2], ENT_NOQUOTES, $this->_charset)."</span> \t".$e[3]." \t".$e[4]."</p>\n"; 228 249 } 229 250 return $errors; trunk/lib/jelix/core/response/jResponseHtml.class.php
r663 r666 176 176 177 177 if($this->hasErrors()){ 178 echo '<div id="jelixerror" style="position:absolute;left:0px;top:0px;border:3px solid red; background-color:#f39999;color:black;">'; 179 echo $this->getFormatedErrorMsg(); 180 echo '<p><a href="#" onclick="document.getElementById(\'jelixerror\').style.display=\'none\';return false;">fermer</a></p></div>'; 178 if($GLOBALS['gJConfig']->error_handling['showInFirebug']){ 179 echo '<script type="text/javascript">if(console){'; 180 foreach( $GLOBALS['gJCoord']->errorMessages as $e){ 181 switch ($e[0]) { 182 case 'warning': 183 echo 'console.warn("[warning '; 184 break; 185 case 'notice': 186 echo 'console.info("[notice '; 187 break; 188 case 'strict': 189 echo 'console.info("[strict '; 190 break; 191 case 'error': 192 echo 'console.error("[error '; 193 break; 194 } 195 echo $e[1].'] '.str_replace('"','\"',$e[2]),' (',$e[3],' ',$e[4],')");'; 196 } 197 echo '}else{alert("there are some errors, you should activate Firebug to see them");}</script>'; 198 }else{ 199 echo '<div id="jelixerror" style="position:absolute;left:0px;top:0px;border:3px solid red; background-color:#f39999;color:black;">'; 200 echo $this->getFormatedErrorMsg(); 201 echo '<p><a href="#" onclick="document.getElementById(\'jelixerror\').style.display=\'none\';return false;">fermer</a></p></div>'; 202 } 181 203 } 182 204 echo implode("\n",$this->_bodyBottom); … … 224 246 $errors=''; 225 247 foreach( $GLOBALS['gJCoord']->errorMessages as $e){ 226 // FIXME : Pourquoi utiliser htmlentities() ? 227 $errors .= '<p style="margin:0;"><b>['.$e[0].' '.$e[1].']</b> <span style="color:#FF0000">'.htmlentities($e[2], ENT_NOQUOTES, $this->_charset)."</span> \t".$e[3]." \t".$e[4]."</p>\n"; 248 $errors .= '<p style="margin:0;"><b>['.$e[0].' '.$e[1].']</b> <span style="color:#FF0000">'.htmlspecialchars($e[2], ENT_NOQUOTES, $this->_charset)."</span> \t".$e[3]." \t".$e[4]."</p>\n"; 228 249 } 229 250 return $errors; trunk/testapp/var/config/defaultconfig.ini.php
r569 r666 33 33 emailHeaders = "Content-Type: text/plain; charset=UTF-8\nFrom: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n" 34 34 quietMessage="Une erreur technique est survenue. Désolé pour ce désagrément." 35 35 showInFirebug = off 36 36 ; mots clés que vous pouvez utiliser : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE 37 37 default = ECHO EXIT trunk/testapp/var/config/defaultconfig.ini.php
r569 r666 33 33 emailHeaders = "Content-Type: text/plain; charset=UTF-8\nFrom: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n" 34 34 quietMessage="Une erreur technique est survenue. Désolé pour ce désagrément." 35 35 showInFirebug = off 36 36 ; mots clés que vous pouvez utiliser : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE 37 37 default = ECHO EXIT
