From: Jonathan H. <j_...@us...> - 2007-02-27 16:48:11
|
Update of /cvsroot/stack/stack-dev/lib/CAS In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv32435/lib/CAS Modified Files: displayCASText.php Log Message: Will now display as much as possible on case of error. Error handeling & display improved. Index: displayCASText.php =================================================================== RCS file: /cvsroot/stack/stack-dev/lib/CAS/displayCASText.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** displayCASText.php 13 Feb 2007 14:10:57 -0000 1.2 --- displayCASText.php 27 Feb 2007 16:48:04 -0000 1.3 *************** *** 171,174 **** --- 171,175 ---- { // Looks for the name of each $local as such a dummy string + if (is_array($this->locals)) *************** *** 177,188 **** { $dummy = '@'.$key.'@'; ! if (strstr($this->strin,$dummy)) { $this->mathmlString = str_replace($dummy,$value,$this->mathmlString); }//if work to be done }//foreach } //echo '<br />string:'.$this->mathmlString.'<br />'; return $this->mathmlString; --- 178,202 ---- { $dummy = '@'.$key.'@'; + + //add cas errors if any + + + if ($this->errs[$key] !== NULL) + { + $replace = $this->errs[$key]; + $this->mathmlString = str_replace($dummy,$replace,$this->mathmlString); + } ! elseif (strstr($this->strin,$dummy)) { $this->mathmlString = str_replace($dummy,$value,$this->mathmlString); }//if work to be done + + + }//foreach } //echo '<br />string:'.$this->mathmlString.'<br />'; + return $this->mathmlString; *************** *** 196,200 **** { // Looks for the name of each $local as such a dummy string ! if (is_array($this->locals)) { --- 210,214 ---- { // Looks for the name of each $local as such a dummy string ! //echo 'No Returned: '.count($this->locals).'<br />'; if (is_array($this->locals)) { *************** *** 202,207 **** { $dummy = '@'.$key.'@'; ! if (strstr($this->strin,$dummy)) { $this->strin = str_replace($dummy,$value,$this->strin); --- 216,228 ---- { $dummy = '@'.$key.'@'; + ! if ($this->errs[$key] !== NULL) ! { ! $replace = '<html>'.$this->errs[$key].'</html>'; ! $this->strin = str_replace($dummy,$replace,$this->strin); ! } ! ! elseif (strstr($this->strin,$dummy)) { $this->strin = str_replace($dummy,$value,$this->strin); |