fixing built-in functions so that they work with modified imagemap.

This commit is contained in:
Martynas Mickevicius
2010-07-29 20:22:03 +03:00
parent 1c1d555002
commit fe77ca741c
2 changed files with 12 additions and 6 deletions

View File

@@ -88,7 +88,8 @@
drawPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$EnhanceColors=TRUE,$Skew=60,$SpliceHeight=20,$SpliceDistance=0,$Decimals=0) drawPieGraph($Data,$DataDescription,$XPos,$YPos,$Radius=100,$DrawLabels=PIE_NOLABEL,$EnhanceColors=TRUE,$Skew=60,$SpliceHeight=20,$SpliceDistance=0,$Decimals=0)
Other methods : Other methods :
setImageMap($Mode=TRUE,$GraphID="MyGraph") setImageMap($Mode=TRUE,$GraphID="MyGraph")
getImageMap($MapName,$Flush=TRUE) getImageMap()
getSavedImageMap($MapName,$Flush=TRUE)
Render($FileName) Render($FileName)
Stroke() Stroke()
*/ */
@@ -3491,8 +3492,14 @@
} }
/* Get the current image map */
function getImageMap()
{
return json_encode($this->ImageMap);
}
/* Load and cleanup the image map from disk */ /* Load and cleanup the image map from disk */
function getImageMap($MapName,$Flush=TRUE) function getSavedImageMap($MapName,$Flush=TRUE)
{ {
/* Strip HTML query strings */ /* Strip HTML query strings */
$Values = $this->tmpFolder.$MapName; $Values = $this->tmpFolder.$MapName;
@@ -3537,8 +3544,7 @@
} }
else else
{ {
foreach($this->ImageMap as $Key => $Value) fwrite($Handle, $this->getImageMap());
fwrite($Handle, htmlentities($Value)."\r");
} }
fclose ($Handle); fclose ($Handle);
} }

View File

@@ -192,7 +192,7 @@ abstract class PMA_pChart_Chart extends PMA_Chart
$returnData .= '</div>'; $returnData .= '</div>';
$returnData .= ' $returnData .= '
<script type="text/javascript"> <script type="text/javascript">
imageMap.loadImageMap(\''.json_encode($this->getImageMap()).'\'); imageMap.loadImageMap(\''.$this->getImageMap().'\');
</script> </script>
'; ';
@@ -241,7 +241,7 @@ abstract class PMA_pChart_Chart extends PMA_Chart
protected function getImageMap() protected function getImageMap()
{ {
return $this->chart->ImageMap; return $this->chart->getImageMap();
} }
} }