Changeset 2817
- Timestamp:
- 11/26/06 05:16:36 (2 years ago)
- Files:
-
- plugins/sfJpGraphPlugin/LICENSE (modified) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph (added)
- plugins/sfJpGraphPlugin/lib/jpgraph/QPL.txt (moved) (moved from plugins/sfJpGraphPlugin/lib/QPL.txt)
- plugins/sfJpGraphPlugin/lib/jpgraph/flags.dat (moved) (moved from plugins/sfJpGraphPlugin/lib/flags.dat)
- plugins/sfJpGraphPlugin/lib/jpgraph/flags_thumb100x100.dat (moved) (moved from plugins/sfJpGraphPlugin/lib/flags_thumb100x100.dat)
- plugins/sfJpGraphPlugin/lib/jpgraph/flags_thumb35x35.dat (moved) (moved from plugins/sfJpGraphPlugin/lib/flags_thumb35x35.dat)
- plugins/sfJpGraphPlugin/lib/jpgraph/flags_thumb60x60.dat (moved) (moved from plugins/sfJpGraphPlugin/lib/flags_thumb60x60.dat)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_balls.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_balls.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_bevels.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_bevels.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_diamonds.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_diamonds.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_pushpins.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_pushpins.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_squares.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_squares.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_stars.inc (moved) (moved from plugins/sfJpGraphPlugin/lib/imgdata_stars.inc) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpg-config.inc.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpg-config.inc.php) (11 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph.php) (20 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_antispam-digits.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_antispam-digits.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_antispam.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_antispam.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_bar.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_bar.php) (2 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_canvas.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_canvas.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_canvtools.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_canvtools.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_date.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_date.php) (2 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_errhandler.inc.php (added)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_error.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_error.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_flags.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_flags.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_gantt.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_gantt.php) (5 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_gb2312.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_gb2312.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_gradient.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_gradient.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_iconplot.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_iconplot.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_imgtrans.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_imgtrans.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_line.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_line.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_log.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_log.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_mgraph.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_mgraph.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_pie.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_pie.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_pie3d.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_pie3d.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_plotband.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_plotband.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_plotmark.inc.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_plotmark.inc.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_polar.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_polar.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_radar.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_radar.php) (2 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_regstat.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_regstat.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_scatter.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_scatter.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_stock.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_stock.php) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_utils.inc.php (moved) (moved from plugins/sfJpGraphPlugin/lib/jpgraph_utils.inc.php) (15 diffs)
- plugins/sfJpGraphPlugin/lib/jpgraph/lang (moved) (moved from plugins/sfJpGraphPlugin/lib/lang)
- plugins/sfJpGraphPlugin/lib/jpgraph/lang/en.inc.php (modified) (1 diff)
- plugins/sfJpGraphPlugin/lib/jpgraph/lang/prod.inc.php (modified) (1 diff)
- plugins/sfJpGraphPlugin/lib/sfJpGraph.class.php (modified) (7 diffs)
- plugins/sfJpGraphPlugin/modules (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/actions (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/actions/actions.class.php (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/config (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/lib (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/templates (added)
- plugins/sfJpGraphPlugin/modules/sfJpGraph/validate (added)
- plugins/sfJpGraphPlugin/package.xml (modified) (3 diffs)
- plugins/sfJpGraphPlugin/test/sfJpGraphTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfJpGraphPlugin/LICENSE
r1002 r2817 6 6 7 7 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 9 The JPGRAPH library is licensed under THE Q PUBLIC LICENSE version 1.0, please see lib/jpgraph/QPL.txt for more information. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_balls.inc
r1002 r2817 4 4 // Description: Base64 encoded images for small round markers 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_balls.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_balls.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_bevels.inc
r1002 r2817 4 4 // Description: Base64 encoded images for round bevels 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_bevels.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_bevels.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_diamonds.inc
r1002 r2817 4 4 // Description: Base64 encoded images for diamonds 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_diamonds.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_diamonds.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_pushpins.inc
r1002 r2817 4 4 // Description: Base64 encoded images for pushpins 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_pushpins.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_pushpins.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_squares.inc
r1002 r2817 4 4 // Description: Base64 encoded images for squares 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_squares.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_squares.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/imgdata_stars.inc
r1002 r2817 4 4 // Description: Base64 encoded images for stars 5 5 // Created: 2003-03-20 6 // Author: Johan Persson (johanp@aditus.nu) 7 // Ver: $Id: imgdata_stars.inc 20 2005-05-30 20:34:41Z ljp $ 6 // Ver: $Id: imgdata_stars.inc 781 2006-10-08 08:07:47Z ljp $ 8 7 // 9 8 // Copyright (c) Aditus Consulting. All rights reserved. plugins/sfJpGraphPlugin/lib/jpgraph/jpg-config.inc.php
r1517 r2817 4 4 // Description: Configuration file for JpGraph library 5 5 // Created: 2004-03-27 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // … … 13 12 14 13 //------------------------------------------------------------------------ 15 // Directories for cache and font directory. 14 // Directories for cache and font directory. 16 15 // 17 16 // CACHE_DIR: … … 46 45 // using the cache. 47 46 // The directory must be the filesysystem name as seen by PHP 48 // and the 'http' version must be the same directory but as 49 // seen by the HTTP server relative to the 'htdocs' ddirectory. 47 // and the 'http' version must be the same directory but as 48 // seen by the HTTP server relative to the 'htdocs' ddirectory. 50 49 // If a relative path is specified it is taken to be relative from where 51 50 // the image script is executed. 52 // Note: The default setting is to create a subdirectory in the 51 // Note: The default setting is to create a subdirectory in the 53 52 // directory from where the image script is executed and store all files 54 53 // there. As ususal this directory must be writeable by the PHP process. 55 DEFINE("CSIMCACHE_DIR","csimcache/"); 54 55 DEFINE("CSIMCACHE_DIR","csimcache/"); 56 56 DEFINE("CSIMCACHE_HTTP_DIR","csimcache/"); 57 57 … … 69 69 70 70 // If you are setting this config to true the conversion of greek characters 71 // will assume that the input text is windows 1251 71 // will assume that the input text is windows 1251 72 72 DEFINE("GREEK_FROM_WINDOWS",false); 73 73 … … 104 104 // where $locale_char_set is a GLOBAL (string) variable 105 105 // from the application including JpGraph. 106 // 106 // 107 107 DEFINE('LANGUAGE_CHARSET', null); 108 108 … … 114 114 115 115 // Assume that Japanese text have been entered in EUC-JP encoding. 116 // If this define is true then conversion from EUC-JP to UTF8 is done 116 // If this define is true then conversion from EUC-JP to UTF8 is done 117 117 // automatically in the library using the mbstring module in PHP. 118 118 DEFINE('ASSUME_EUCJP_ENCODING',false); … … 134 134 135 135 // Should the cache be used at all? By setting this to false no 136 // files will be generated in the cache directory. 136 // files will be generated in the cache directory. 137 137 // The difference from READ_CACHE being that setting READ_CACHE to 138 138 // false will still create the image in the cache directory … … 141 141 DEFINE("USE_CACHE",false); 142 142 143 // Should we try to find an image in the cache before generating it? 143 // Should we try to find an image in the cache before generating it? 144 144 // Set this define to false to bypass the reading of the cache and always 145 // regenerate the image. Note that even if reading the cache is 145 // regenerate the image. Note that even if reading the cache is 146 146 // disabled the cached will still be updated with the newly generated 147 147 // image. Set also "USE_CACHE" below. … … 169 169 // the closest match? If you plan on using background images or 170 170 // gradient fills it might be a good idea to enable this. 171 // If not you will otherwise get an error saying that the color palette is 172 // exhausted. The drawback of using approximations is that the colors 173 // might not be exactly what you specified. 174 // Note1: This does only apply to paletted images, not truecolor 171 // If not you will otherwise get an error saying that the color palette is 172 // exhausted. The drawback of using approximations is that the colors 173 // might not be exactly what you specified. 174 // Note1: This does only apply to paletted images, not truecolor 175 175 // images since they don't have the limitations of maximum number 176 176 // of colors. … … 198 198 // specified group since otherwise it is impossible for Apache 199 199 // to set the specified group. 200 DEFINE("CACHE_FILE_GROUP","www admin");200 DEFINE("CACHE_FILE_GROUP","www-data"); 201 201 202 202 // What permissions should the cached file have … … 205 205 206 206 // Decide if we should use the bresenham circle algorithm or the 207 // built in Arc(). Bresenham gives better visual apperance of circles 207 // built in Arc(). Bresenham gives better visual apperance of circles 208 208 // but is more CPU intensive and slower then the built in Arc() function 209 209 // in GD. Turned off by default for speed plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph.php
r1517 r2817 4 4 // Description: PHP Graph Plotting library. Base module. 5 5 // Created: 2001-01-08 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // 9 // Copyright (c) Aditus Consulting. All rights reserved.8 // Copyright 2006 (c) Aditus Consulting. All rights reserved. 10 9 //======================================================================== 11 10 12 11 require_once('jpg-config.inc.php'); 12 require_once 'jpgraph_gradient.php'; 13 require_once 'jpgraph_errhandler.inc.php'; 13 14 14 15 // Version info 15 DEFINE('JPG_VERSION','2. 1');16 DEFINE('JPG_VERSION','2.2.1'); 16 17 17 18 // Minimum required PHP version 18 19 DEFINE('MIN_PHPVERSION','5.1.0'); 19 20 // For internal use only21 DEFINE("_JPG_DEBUG",false);22 DEFINE("_FORCE_IMGTOFILE",false);23 DEFINE("_FORCE_IMGDIR",'/tmp/jpgimg/');24 25 20 26 21 // Should the image be a truecolor image? … … 229 224 DEFINE('LINESTYLE_SOLID',4); 230 225 231 // 232 // Get hold of gradient class (In Version 2.x) 233 // 234 require_once 'jpgraph_gradient.php'; 235 236 GLOBAL $__jpg_err_locale ; 237 $__jpg_err_locale = DEFAULT_ERR_LOCALE; 238 239 class ErrMsgText { 240 private $lt=NULL; 241 function ErrMsgText() { 242 GLOBAL $__jpg_err_locale; 243 $file = 'lang/'.$__jpg_err_locale.'.inc.php'; 244 245 // If the chosen locale doesn't exist try english 246 if( !file_exists(dirname(__FILE__).'/'.$file) ) { 247 $__jpg_err_locale = 'en'; 248 } 249 250 $file = 'lang/'.$__jpg_err_locale.'.inc.php'; 251 if( !file_exists(dirname(__FILE__).'/'.$file) ) { 252 die('Internal error: Chosen locale file for error messages does not exist.'); 253 } 254 require_once($file); 255 $this->lt = $_jpg_messages; 256 } 257 258 function Get($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { 259 GLOBAL $__jpg_err_locale; 260 if( !isset($this->lt[$errnbr]) ) { 261 return 'Internal error: The specified error message ('.$errnbr.') does not exist in the chosen locale ('.$__jpg_err_locale.')'; 262 } 263 $ea = $this->lt[$errnbr]; 264 $j=0; 265 if( $a1 !== null ) { 266 $argv[$j++] = $a1; 267 if( $a2 !== null ) { 268 $argv[$j++] = $a2; 269 if( $a3 !== null ) { 270 $argv[$j++] = $a3; 271 if( $a4 !== null ) { 272 $argv[$j++] = $a4; 273 if( $a5 !== null ) { 274 $argv[$j++] = $a5; 275 } 276 } 277 } 278 } 279 } 280 $numargs = $j; 281 if( $ea[1] != $numargs ) { 282 // Error message argument count do not match. 283 // Just return the error message without arguments. 284 return $ea[0]; 285 } 286 switch( $numargs ) { 287 case 1: 288 $msg = sprintf($ea[0],$argv[0]); 289 break; 290 case 2: 291 $msg = sprintf($ea[0],$argv[0],$argv[1]); 292 break; 293 case 3: 294 $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2]); 295 break; 296 case 4: 297 $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3]); 298 break; 299 case 5: 300 $msg = sprintf($ea[0],$argv[0],$argv[1],$argv[2],$argv[3],$argv[4]); 301 break; 302 case 0: 303 default: 304 $msg = sprintf($ea[0]); 305 break; 306 } 307 return $msg; 308 } 309 } 310 311 // 312 // A wrapper class that is used to access the specified error object 313 // (to hide the global error parameter and avoid having a GLOBAL directive 314 // in all methods. 315 // 316 class JpGraphError { 317 private static $__jpg_err; 318 public static function Install($aErrObject) { 319 self::$__jpg_err = new $aErrObject; 320 } 321 public static function Raise($aMsg,$aHalt=true){ 322 self::$__jpg_err->Raise($aMsg,$aHalt); 323 } 324 public static function SetErrLocale($aLoc) { 325 GLOBAL $__jpg_err_locale ; 326 $__jpg_err_locale = $aLoc; 327 } 328 public static function RaiseL($errnbr,$a1=null,$a2=null,$a3=null,$a4=null,$a5=null) { 329 $t = new ErrMsgText(); 330 $msg = $t->Get($errnbr,$a1,$a2,$a3,$a4,$a5); 331 self::$__jpg_err->Raise($msg); 332 } 333 } 334 335 // 336 // ... and install the default error handler 337 // 338 if( USE_IMAGE_ERROR_HANDLER ) { 339 JpGraphError::Install("JpGraphErrObjectImg"); 340 } 341 else { 342 JpGraphError::Install("JpGraphErrObject"); 343 } 226 // For internal use only 227 DEFINE("_JPG_DEBUG",false); 228 DEFINE("_FORCE_IMGTOFILE",false); 229 DEFINE("_FORCE_IMGDIR",'/tmp/jpgimg/'); 344 230 345 231 function CheckPHPVersion($aMinVersion) … … 359 245 360 246 // 247 // Make sure PHP version is high enough 248 // 249 if( !CheckPHPVersion(MIN_PHPVERSION) ) { 250 JpGraphError::RaiseL(13,PHP_VERSION,MIN_PHPVERSION); 251 } 252 253 254 // 361 255 // Make GD sanity check 362 256 // … … 364 258 JpGraphError::RaiseL(25001); 365 259 //("This PHP installation is not configured with the GD library. Please recompile PHP with GD support to run JpGraph. (Neither function imagetypes() nor imagecreatefromstring() does exist)"); 366 }367 368 //369 // Make sure PHP version is high enough370 //371 if( !CheckPHPVersion(MIN_PHPVERSION) ) {372 JpGraphError::RaiseL(13,PHP_VERSION,MIN_PHPVERSION);373 }374 375 //376 // First of all set up a default error handler377 //378 379 //=============================================================380 // The default trivial text error handler.381 //=============================================================382 class JpGraphErrObject {383 384 protected $iTitle = "JpGraph Error";385 protected $iDest = false;386 387 388 function JpGraphErrObject() {389 // Empty. Reserved for future use390 }391 392 function SetTitle($aTitle) {393 $this->iTitle = $aTitle;394 }395 396 function SetStrokeDest($aDest) {397 $this->iDest = $aDest;398 }399 400 // If aHalt is true then execution can't continue. Typical used for fatal errors401 function Raise($aMsg,$aHalt=true) {402 $aMsg = $this->iTitle.' '.$aMsg;403 if ($this->iDest) {404 $f = @fopen($this->iDest,'a');405 if( $f ) {406 @fwrite($f,$aMsg);407 @fclose($f);408 }409 }410 else {411 echo $aMsg;412 }413 if( $aHalt )414 die();415 }416 }417 418 //==============================================================419 // An image based error handler420 //==============================================================421 class JpGraphErrObjectImg extends JpGraphErrObject {422 423 function Raise($aMsg,$aHalt=true) {424 $img_iconerror =425 'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAMAAAC7IEhfAAAAaV'.426 'BMVEX//////2Xy8mLl5V/Z2VvMzFi/v1WyslKlpU+ZmUyMjEh/'.427 'f0VyckJlZT9YWDxMTDjAwMDy8sLl5bnY2K/MzKW/v5yyspKlpY'.428 'iYmH+MjHY/PzV/f2xycmJlZVlZWU9MTEXY2Ms/PzwyMjLFTjea'.429 'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'.430 'IAAAsSAdLdfvwAAAAHdElNRQfTBgISOCqusfs5AAABLUlEQVR4'.431 '2tWV3XKCMBBGWfkranCIVClKLd/7P2Q3QsgCxjDTq+6FE2cPH+'.432 'xJ0Ogn2lQbsT+Wrs+buAZAV4W5T6Bs0YXBBwpKgEuIu+JERAX6'.433 'wM2rHjmDdEITmsQEEmWADgZm6rAjhXsoMGY9B/NZBwJzBvn+e3'.434 'wHntCAJdGu9SviwIwoZVDxPB9+Rc0TSEbQr0j3SA1gwdSn6Db0'.435 '6Tm1KfV6yzWGQO7zdpvyKLKBDmRFjzeB3LYgK7r6A/noDAfjtS'.436 'IXaIzbJSv6WgUebTMV4EoRB8a2mQiQjgtF91HdKDKZ1gtFtQjk'.437 'YcWaR5OKOhkYt+ZsTFdJRfPAApOpQYJTNHvCRSJR6SJngQadfc'.438 'vd69OLMddVOPCGVnmrFD8bVYd3JXfxXPtLR/+mtv59/ALWiiMx'.439 'qL72fwAAAABJRU5ErkJggg==' ;440 441 if( function_exists("imagetypes") )442 $supported = imagetypes();443 else444 $supported = 0;445 446 if( !function_exists('imagecreatefromstring') )447 $supported = 0;448 449 if( ob_get_length() || headers_sent() || !($supported & IMG_PNG) ) {450 // Special case for headers already sent or that the installation doesn't support451 // the PNG format (which the error icon is encoded in).452 // Dont return an image since it can't be displayed453 die($this->iTitle.' '.$aMsg);454 }455 456 $aMsg = wordwrap($aMsg,55);457 $lines = substr_count($aMsg,"\n");458 459 // Create the error icon GD460 $erricon = Image::CreateFromString(base64_decode($img_iconerror));461 462 // Create an image that contains the error text.463 $w=400;464 $h=100 + 15*max(0,$lines-3);465 466 $img = new Image($w,$h);467 468 469 // Drop shadow470 $img->SetColor("gray");471 $img->FilledRectangle(5,5,$w-1,$h-1,10);472 $img->SetColor("gray:0.7");473 $img->FilledRectangle(5,5,$w-3,$h-3,10);474 475 // Window background476 $img->SetColor("lightblue");477 $img->FilledRectangle(1,1,$w-5,$h-5);478 $img->CopyCanvasH($img->img,$erricon,5,30,0,0,40,40);479 480 // Window border481 $img->SetColor("black");482 $img->Rectangle(1,1,$w-5,$h-5);483 $img->Rectangle(0,0,$w-4,$h-4);484 485 // Window top row486 $img->SetColor("darkred");487 for($y=3; $y < 18; $y += 2 )488 $img->Line(1,$y,$w-6,$y);489 490 // "White shadow"491 $img->SetColor("white");492 493 // Left window edge494 $img->Line(2,2,2,$h-5);495 $img->Line(2,2,$w-6,2);496 497 // "Gray button shadow"498 $img->SetColor("darkgray");499 500 // Gray window shadow501 $img->Line(2,$h-6,$w-5,$h-6);502 $img->Line(3,$h-7,$w-5,$h-7);503 504 // Window title505 $m = floor($w/2-5);506 $l = 100;507 $img->SetColor("lightgray:1.3");508 $img->FilledRectangle($m-$l,2,$m+$l,16);509 510 // Stroke text511 $img->SetColor("darkred");512 $img->SetFont(FF_FONT2,FS_BOLD);513 $img->StrokeText($m-50,15,$this->iTitle);514 $img->SetColor("black");515 $img->SetFont(FF_FONT1,FS_NORMAL);516 $txt = new Text($aMsg,52,25);517 $txt->Align("left","top");518 $txt->Stroke($img);519 if ($this->iDest) {520 $img->Stream($this->iDest);521 } else {522 $img->Headers();523 $img->Stream();524 }525 if( $aHalt )526 die();527 }528 260 } 529 261 … … 572 304 if( !empty($_SERVER['QUERY_STRING']) ) { 573 305 $q = @$_SERVER['QUERY_STRING']; 574 $fname .= ' ?'.preg_replace("/\W/", "_", $q).'.'.$img_format;306 $fname .= '_'.preg_replace("/\W/", "_", $q).'.'.$img_format; 575 307 } 576 308 else { … … 734 466 735 467 $pLocale = setlocale(LC_TIME, 0); // get current locale for LC_TIME 736 $res = @setlocale(LC_TIME, $aLocale); 468 469 if (is_array($aLocale)) { 470 foreach ($aLocale as $loc) { 471 $res = @setlocale(LC_TIME, $loc); 472 if ( $res ) { 473 $aLocale = $loc; 474 break; 475 } 476 } 477 } 478 else { 479 $res = @setlocale(LC_TIME, $aLocale); 480 } 481 737 482 if ( ! $res ){ 738 483 JpGraphError::RaiseL(25007,$aLocale); … … 2638 2383 $this->FillMarginArea(); 2639 2384 $this->StrokeFrame(); 2640 $this->FillPlotArea(); 2641 $this->img->CopyMerge($bkgimg, 2642 $this->img->left_margin,$this->img->top_margin, 2643 0,0,$this->img->plotwidth+1,$this->img->plotheight, 2644 $bw,$bh,$this->background_image_mix); 2385 // Special case to hande 90 degree rotated graph corectly 2386 if( $aa == 90 ) { 2387 $this->img->SetAngle(90); 2388 $this->FillPlotArea(); 2389 $aa = $this->img->SetAngle(0); 2390 $adj = ($this->img->height - $this->img->width)/2; 2391 $this->img->CopyMerge($bkgimg, 2392 $this->img->bottom_margin-$adj,$this->img->left_margin+$adj, 2393 0,0, 2394 $this->img->plotheight+1,$this->img->plotwidth, 2395 $bw,$bh,$this->background_image_mix); 2396 2397 } 2398 else { 2399 $this->FillPlotArea(); 2400 $this->img->CopyMerge($bkgimg, 2401 $this->img->left_margin,$this->img->top_margin, 2402 0,0,$this->img->plotwidth+1,$this->img->plotheight, 2403 $bw,$bh,$this->background_image_mix); 2404 } 2645 2405 break; 2646 2406 case BGIMG_FILLFRAME: // Fill the whole area from upper left corner, resize to just fit … … 4526 4286 private $text_label_start=0; 4527 4287 private $iManualTickPos = NULL, $iManualMinTickPos = NULL, $iManualTickLabels = NULL; 4288 private $iAdjustForDST = false; // If a date falls within the DST period add one hour to the diaplyed time 4528 4289 4529 4290 //--------------- … … 4657 4418 $label = (float)$aScale->GetMinVal()+$this->text_label_start+$this->label_offset; 4658 4419 $start_abs=$aScale->scale_factor*$this->text_label_start; 4659 $nbrmajticks= ceil(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1;4420 $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; 4660 4421 4661 4422 $x = $aScale->scale_abs[0]+$start_abs+$this->xlabel_offset*$min_step_abs; … … 4683 4444 // of the minor ticks. In order to avoid any rounding issues the major ticks are 4684 4445 // defined as every "step" minor ticks and not calculated separately 4685 $nbrmajticks= ceil(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1;4446 $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; 4686 4447 while( round($abs_pos) <= $limit ) { 4687 4448 $this->ticks_pos[] = round($abs_pos); … … 4699 4460 } 4700 4461 elseif( $aScale->type == "y" ) { 4701 $nbrmajticks= floor(($aScale->GetMaxVal()-$aScale->GetMinVal())/$this->major_step)+1;4462 $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal())/$this->major_step)+1; 4702 4463 while( round($abs_pos) >= $limit ) { 4703 4464 $this->ticks_pos[$i] = round($abs_pos); … … 4717 4478 } 4718 4479 4480 function AdjustForDST($aFlg=true) { 4481 $this->iAdjustForDST = $aFlg; 4482 } 4483 4484 4719 4485 function _doLabelFormat($aVal,$aIdx,$aNbrTicks) { 4720 4486 … … 4737 4503 if( $this->label_usedateformat ) { 4738 4504 // Adjust the value to take daylight savings into account 4739 if (date("I",$aVal)==1 ) // DST4505 if (date("I",$aVal)==1 && $this->iAdjustForDST ) // DST 4740 4506 $aVal+=3600; 4741 4507 … … 4750 4516 if( $this->label_dateformatstr !== '' ) { 4751 4517 // Adjust the value to take daylight savings into account 4752 if (date("I",$aVal)==1 ) // DST4518 if (date("I",$aVal)==1 && $this->iAdjustForDST ) // DST 4753 4519 $aVal+=3600; 4754 4520 … … 4810 4576 $yu = $aPos - $this->direction*$this->GetMajTickAbsSize(); 4811 4577 $xr = $aPos + $this->direction*$this->GetMajTickAbsSize(); 4812 $nbrmajticks= ceil(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1;4578 $nbrmajticks=round(($aScale->GetMaxVal()-$aScale->GetMinVal()-$this->text_label_start )/$this->major_step)+1; 4813 4579 $n = count($this->maj_ticks_pos); 4814 4580 for($i=0; $i < $n ; ++$i ) { … … 6137 5903 } 6138 5904 6139 function GetWidth($aImg=null) {5905 static function GetWidth($aImg=null) { 6140 5906 if( $aImg === null ) 6141 5907 $aImg = $this->img; … … 6143 5909 } 6144 5910 6145 function GetHeight($aImg=null) {5911 static function GetHeight($aImg=null) { 6146 5912 if( $aImg === null ) 6147 5913 $aImg = $this->img; … … 6149 5915 } 6150 5916 6151 function CreateFromString($aStr) {5917 static function CreateFromString($aStr) { 6152 5918 $img = imagecreatefromstring($aStr); 6153 5919 if( $img === false ) { … … 7493 7259 // used 7494 7260 GLOBAL $gJpgBrandTiming; 7495 7261 7496 7262 if( $gJpgBrandTiming ) { 7497 7263 global $tim; … … 8137 7903 $n = count($aDatax); 8138 7904 for($i=0; $i < $n; ++$i ) { 8139 if( is_string($aDatax[$i]) ) {7905 if( !is_numeric($aDatax[$i]) ) { 8140 7906 JpGraphError::RaiseL(25070); 8141 7907 } plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_antispam-digits.php
r1517 r2817 4 4 // Description: Genarate anti-spam challenge 5 5 // Created: 2004-10-07 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_antispam.php
r1002 r2817 4 4 // Description: Genarate anti-spam challenge 5 5 // Created: 2004-10-07 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_bar.php
r1517 r2817 4 4 // Description: Bar plot extension for JpGraph 5 5 // Created: 2001-01-08 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // … … 316 315 317 316 // If value is NULL, or 0 then don't draw a bar at all 318 if ($this->coords[0][$i] === null || 319 $this->coords[0][$i] === '' || 320 $this->coords[0][$i] === 0 ) continue; 317 if ($this->coords[0][$i] === null || $this->coords[0][$i] === '' ) 318 continue; 321 319 322 320 if( $exist_x ) $x=$this->coords[1][$i]; plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_canvas.php
r1517 r2817 4 4 // Description: Canvas drawing extension for JpGraph 5 5 // Created: 2001-01-08 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_canvtools.php
r1002 r2817 4 4 // Description: Some utilities for text and shape drawing on a canvas 5 5 // Created: 2002-08-23 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_date.php
r1517 r2817 4 4 // Description: Classes to handle Date scaling 5 5 // Created: 2005-05-02 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // … … 381 380 } 382 381 382 function AdjustForDST($aFlg=true) { 383 $this->ticks->AdjustForDST($aFlg); 384 } 385 386 383 387 function SetDateAlign($aStartAlign,$aEndAlign=false) { 384 388 if( $aEndAlign === false ) { plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_error.php
r1002 r2817 4 4 // Description: Error plot extension for JpGraph 5 5 // Created: 2001-01-08 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_flags.php
r1002 r2817 4 4 // Description: Class Jpfile. Handles plotmarks 5 5 // Created: 2003-06-28 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_gantt.php
r1517 r2817 4 4 // Description: JpGraph Gantt plot extension 5 5 // Created: 2001-11-12 6 // Author: Johan Persson (johanp@aditus.nu)7 6 // Ver: $Id$ 8 7 // … … 3262 3261 if( ! empty($this->title->csimalt[$i]) ) { 3263 3262 $tmp = $this->title->csimalt[$i]; 3264 $this->csimarea .= " title=\"$tmp\" ";3263 $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; 3265 3264 } 3266 $this->csimarea .= " alt=\"$tmp\"/>\n";3265 $this->csimarea .= " />\n"; 3267 3266 } 3268 3267 } … … 3299 3298 if( $this->csimalt != '' ) { 3300 3299 $tmp = $this->csimalt; 3301 $this->csimarea .= " title=\"$tmp\" ";3302 } 3303 $this->csimarea .= " alt=\"$tmp\"/>\n";3300 $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; 3301 } 3302 $this->csimarea .= " />\n"; 3304 3303 } 3305 3304 … … 3317 3316 // Make sure that the progess bar doesn't extend over the end date 3318 3317 if( $xtp+$len-1 > $xb ) 3319 $len = $xb - $xtp + 1;3318 $len = $xb - $xtp ; 3320 3319 3321 3320 if( $xtp < $xt ) … … 3422 3421 if( ! empty($this->title->csimalt[$i]) ) { 3423 3422 $tmp = $this->title->csimalt[$i]; 3424 $this->csimarea .= " title=\"$tmp\" ";3423 $this->csimarea .= " title=\"$tmp\" alt=\"$tmp\" "; 3425 3424 } 3426 $this->csimarea .= " alt=\"$tmp\"/>\n";3425 $this->csimarea .= " />\n"; 3427 3426 } 3428 3427 } plugins/sfJpGraphPlugin/lib/jpgraph/jpgraph_gb2312.php
r1002 r2817 4 4 // Description: PHP4 Graph Plotting library. Chinese font conversions