@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | use Amenadiel\JpGraph\Text; |
12 | 12 | use Amenadiel\JpGraph\Util; |
13 | 13 | |
14 | -require_once dirname(__FILE__).'/../includes/jpgraph.php'; |
|
14 | +require_once dirname(__FILE__) . '/../includes/jpgraph.php'; |
|
15 | 15 | |
16 | 16 | //=================================================== |
17 | 17 | // CLASS Graph |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $this->inputValues['aTimeout'] = $aTimeout; |
211 | 211 | $this->inputValues['aInline'] = $aInline; |
212 | 212 | |
213 | - $theme_class = '\Amenadiel\JpGraph\Themes\\'.DEFAULT_THEME_CLASS; |
|
213 | + $theme_class = '\Amenadiel\JpGraph\Themes\\' . DEFAULT_THEME_CLASS; |
|
214 | 214 | |
215 | 215 | if (class_exists($theme_class)) { |
216 | 216 | $this->graph_theme = new $theme_class(); |
@@ -904,7 +904,7 @@ discard block |
||
904 | 904 | } |
905 | 905 | |
906 | 906 | $urlarg = $this->GetURLArguments(); |
907 | - $this->csimcachename = CSIMCACHE_DIR.$aCacheName.$urlarg; |
|
907 | + $this->csimcachename = CSIMCACHE_DIR . $aCacheName . $urlarg; |
|
908 | 908 | $this->csimcachetimeout = $aTimeOut; |
909 | 909 | |
910 | 910 | // First determine if we need to check for a cached version |
@@ -918,8 +918,8 @@ discard block |
||
918 | 918 | $base = basename($this->csimcachename); |
919 | 919 | $base = strtok($base, '.'); |
920 | 920 | $suffix = strtok('.'); |
921 | - $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; |
|
922 | - $baseimg = $dir.'/'.$base.'?'.$urlarg.'.'.$this->img->img_format; |
|
921 | + $basecsim = $dir . '/' . $base . '?' . $urlarg . '_csim_.html'; |
|
922 | + $baseimg = $dir . '/' . $base . '?' . $urlarg . '.' . $this->img->img_format; |
|
923 | 923 | |
924 | 924 | $timedout = false; |
925 | 925 | // Does it exist at all ? |
@@ -951,7 +951,7 @@ discard block |
||
951 | 951 | if ($aAddRecursiveBlocker) { |
952 | 952 | // This is a JPGRAPH internal defined that prevents |
953 | 953 | // us from recursively coming here again |
954 | - $urlarg = _CSIM_DISPLAY.'=1'; |
|
954 | + $urlarg = _CSIM_DISPLAY . '=1'; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | // Now reconstruct any user URL argument |
@@ -959,10 +959,10 @@ discard block |
||
959 | 959 | while (list($key, $value) = each($_GET)) { |
960 | 960 | if (is_array($value)) { |
961 | 961 | foreach ($value as $k => $v) { |
962 | - $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); |
|
962 | + $urlarg .= '&' . $key . '%5B' . $k . '%5D=' . urlencode($v); |
|
963 | 963 | } |
964 | 964 | } else { |
965 | - $urlarg .= '&'.$key.'='.urlencode($value); |
|
965 | + $urlarg .= '&' . $key . '=' . urlencode($value); |
|
966 | 966 | } |
967 | 967 | } |
968 | 968 | |
@@ -973,10 +973,10 @@ discard block |
||
973 | 973 | while (list($key, $value) = each($_POST)) { |
974 | 974 | if (is_array($value)) { |
975 | 975 | foreach ($value as $k => $v) { |
976 | - $urlarg .= '&'.$key.'%5B'.$k.'%5D='.urlencode($v); |
|
976 | + $urlarg .= '&' . $key . '%5B' . $k . '%5D=' . urlencode($v); |
|
977 | 977 | } |
978 | 978 | } else { |
979 | - $urlarg .= '&'.$key.'='.urlencode($value); |
|
979 | + $urlarg .= '&' . $key . '=' . urlencode($value); |
|
980 | 980 | } |
981 | 981 | } |
982 | 982 | |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | // create a random map name |
995 | 995 | srand((float) microtime() * 1000000); |
996 | 996 | $r = rand(0, 100000); |
997 | - $aCSIMName = '__mapname'.$r.'__'; |
|
997 | + $aCSIMName = '__mapname' . $r . '__'; |
|
998 | 998 | } |
999 | 999 | |
1000 | 1000 | if ($aScriptName == 'auto') { |
@@ -1015,8 +1015,8 @@ discard block |
||
1015 | 1015 | $base = basename($this->csimcachename); |
1016 | 1016 | $base = strtok($base, '.'); |
1017 | 1017 | $suffix = strtok('.'); |
1018 | - $basecsim = $dir.'/'.$base.'?'.$urlarg.'_csim_.html'; |
|
1019 | - $baseimg = $base.'?'.$urlarg.'.'.$this->img->img_format; |
|
1018 | + $basecsim = $dir . '/' . $base . '?' . $urlarg . '_csim_.html'; |
|
1019 | + $baseimg = $base . '?' . $urlarg . '.' . $this->img->img_format; |
|
1020 | 1020 | |
1021 | 1021 | // Check that apache can write to directory specified |
1022 | 1022 | |
@@ -1028,15 +1028,15 @@ discard block |
||
1028 | 1028 | $this->cache->MakeDirs($dir); |
1029 | 1029 | |
1030 | 1030 | // Write the image file |
1031 | - $this->Stroke(CSIMCACHE_DIR.$baseimg); |
|
1031 | + $this->Stroke(CSIMCACHE_DIR . $baseimg); |
|
1032 | 1032 | |
1033 | 1033 | // Construct wrapper HTML and write to file and send it back to browser |
1034 | 1034 | |
1035 | 1035 | // In the src URL we must replace the '?' with its encoding to prevent the arguments |
1036 | 1036 | // to be converted to real arguments. |
1037 | 1037 | $tmp = str_replace('?', '%3f', $baseimg); |
1038 | - $htmlwrap = $this->GetHTMLImageMap($aCSIMName)."\n". |
|
1039 | - '<img src="'.CSIMCACHE_HTTP_DIR.$tmp.'" ismap="ismap" usemap="#'.$aCSIMName.' width="'.$this->img->width.'" height="'.$this->img->height.'" alt="'.$this->iCSIMImgAlt."\" />\n"; |
|
1038 | + $htmlwrap = $this->GetHTMLImageMap($aCSIMName) . "\n" . |
|
1039 | + '<img src="' . CSIMCACHE_HTTP_DIR . $tmp . '" ismap="ismap" usemap="#' . $aCSIMName . ' width="' . $this->img->width . '" height="' . $this->img->height . '" alt="' . $this->iCSIMImgAlt . "\" />\n"; |
|
1040 | 1040 | |
1041 | 1041 | if ($fh = @fopen($basecsim, 'w')) { |
1042 | 1042 | fwrite($fh, $htmlwrap); |
@@ -1049,7 +1049,7 @@ discard block |
||
1049 | 1049 | if ($aScriptName == '') { |
1050 | 1050 | Util\JpGraphError::RaiseL(25030); //('Missing script name in call to StrokeCSIM(). You must specify the name of the actual image script as the first parameter to StrokeCSIM().'); |
1051 | 1051 | } |
1052 | - echo $this->GetHTMLImageMap($aCSIMName).$this->GetCSIMImgHTML($aCSIMName, $aScriptName, $aBorder); |
|
1052 | + echo $this->GetHTMLImageMap($aCSIMName) . $this->GetCSIMImgHTML($aCSIMName, $aScriptName, $aBorder); |
|
1053 | 1053 | } |
1054 | 1054 | } else { |
1055 | 1055 | $this->Stroke(); |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | } |
1071 | 1071 | $urlarg = $this->GetURLArguments(true); |
1072 | 1072 | |
1073 | - return '<img src="'.$aScriptName.'?'.$urlarg.'" ismap="ismap" usemap="#'.$aCSIMName.'" height="'.$this->img->height.'" alt="'.$this->iCSIMImgAlt."\" />\n"; |
|
1073 | + return '<img src="' . $aScriptName . '?' . $urlarg . '" ismap="ismap" usemap="#' . $aCSIMName . '" height="' . $this->img->height . '" alt="' . $this->iCSIMImgAlt . "\" />\n"; |
|
1074 | 1074 | } |
1075 | 1075 | |
1076 | 1076 | public function GetTextsYMinMax($aY2 = false) |
@@ -2104,7 +2104,7 @@ discard block |
||
2104 | 2104 | $f = 'imagecreatefromjpeg'; |
2105 | 2105 | $imgtag = 'jpg'; |
2106 | 2106 | } else { |
2107 | - $f = 'imagecreatefrom'.$imgtag; |
|
2107 | + $f = 'imagecreatefrom' . $imgtag; |
|
2108 | 2108 | } |
2109 | 2109 | |
2110 | 2110 | // Compare specified image type and file extension |
@@ -165,18 +165,18 @@ discard block |
||
165 | 165 | |
166 | 166 | public function AddCSIMPoly($aPts) |
167 | 167 | { |
168 | - $coords = round($aPts[0]).', '.round($aPts[1]); |
|
168 | + $coords = round($aPts[0]) . ', ' . round($aPts[1]); |
|
169 | 169 | $n = count($aPts) / 2; |
170 | 170 | for ($i = 1; $i < $n; ++$i) { |
171 | - $coords .= ', '.round($aPts[2 * $i]).', '.round($aPts[2 * $i + 1]); |
|
171 | + $coords .= ', ' . round($aPts[2 * $i]) . ', ' . round($aPts[2 * $i + 1]); |
|
172 | 172 | } |
173 | 173 | $this->csimareas = ''; |
174 | 174 | if (!empty($this->csimtarget)) { |
175 | 175 | $this->csimareas .= "<area shape=\"poly\" coords=\"${coords}\" "; |
176 | - $this->csimareas .= 'href="'.htmlentities($this->csimtarget).'"'; |
|
176 | + $this->csimareas .= 'href="' . htmlentities($this->csimtarget) . '"'; |
|
177 | 177 | |
178 | 178 | if (!empty($this->csimwintarget)) { |
179 | - $this->csimareas .= ' target="'.$this->csimwintarget.'" '; |
|
179 | + $this->csimareas .= ' target="' . $this->csimwintarget . '" '; |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | if (!empty($this->csimalt)) { |
@@ -195,10 +195,10 @@ discard block |
||
195 | 195 | $this->csimareas = ''; |
196 | 196 | if (!empty($this->csimtarget)) { |
197 | 197 | $this->csimareas .= "<area shape=\"circle\" coords=\"${x},${y},${r}\" "; |
198 | - $this->csimareas .= 'href="'.htmlentities($this->csimtarget).'"'; |
|
198 | + $this->csimareas .= 'href="' . htmlentities($this->csimtarget) . '"'; |
|
199 | 199 | |
200 | 200 | if (!empty($this->csimwintarget)) { |
201 | - $this->csimareas .= ' target="'.$this->csimwintarget.'" '; |
|
201 | + $this->csimareas .= ' target="' . $this->csimwintarget . '" '; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | if (!empty($this->csimalt)) { |
@@ -348,12 +348,12 @@ discard block |
||
348 | 348 | |
349 | 349 | $img->Copy($this->markimg, $dx, $dy, 0, 0, $dw, $dh, $w, $h); |
350 | 350 | if (!empty($this->csimtarget)) { |
351 | - $this->csimareas = '<area shape="rect" coords="'. |
|
352 | - $dx.','.$dy.','.round($dx + $dw).','.round($dy + $dh).'" '. |
|
353 | - 'href="'.htmlentities($this->csimtarget).'"'; |
|
351 | + $this->csimareas = '<area shape="rect" coords="' . |
|
352 | + $dx . ',' . $dy . ',' . round($dx + $dw) . ',' . round($dy + $dh) . '" ' . |
|
353 | + 'href="' . htmlentities($this->csimtarget) . '"'; |
|
354 | 354 | |
355 | 355 | if (!empty($this->csimwintarget)) { |
356 | - $this->csimareas .= ' target="'.$this->csimwintarget.'" '; |
|
356 | + $this->csimareas .= ' target="' . $this->csimwintarget . '" '; |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | if (!empty($this->csimalt)) { |
@@ -207,10 +207,10 @@ |
||
207 | 207 | $yp = floor($yc - $radius * sin($sa)); |
208 | 208 | $coords .= ", ${xp}, ${yp}"; |
209 | 209 | if (!empty($this->csimtargets[$i])) { |
210 | - $this->csimareas .= "<area shape=\"poly\" coords=\"${coords}\" href=\"".$this->csimtargets[$i].'"'; |
|
210 | + $this->csimareas .= "<area shape=\"poly\" coords=\"${coords}\" href=\"" . $this->csimtargets[$i] . '"'; |
|
211 | 211 | $tmp = ''; |
212 | 212 | if (!empty($this->csimwintargets[$i])) { |
213 | - $this->csimareas .= ' target="'.$this->csimwintargets[$i].'" '; |
|
213 | + $this->csimareas .= ' target="' . $this->csimwintargets[$i] . '" '; |
|
214 | 214 | } |
215 | 215 | if (!empty($this->csimalts[$i])) { |
216 | 216 | $tmp = sprintf($this->csimalts[$i], $this->data[$i]); |