… | |
… | |
375 | my $graph = shift; |
375 | my $graph = shift; |
376 | my $extension = ($WWPlot::use_png) ? '.png' : '.gif'; |
376 | my $extension = ($WWPlot::use_png) ? '.png' : '.gif'; |
377 | my $fileName = $graph->imageName . $extension; |
377 | my $fileName = $graph->imageName . $extension; |
378 | my $filePath = convertPath("gif/$fileName"); |
378 | my $filePath = convertPath("gif/$fileName"); |
379 | $filePath = &surePathToTmpFile( $filePath ); |
379 | $filePath = &surePathToTmpFile( $filePath ); |
|
|
380 | my $refreshCachedImages = PG_restricted_eval(q!$refreshCachedImages!); |
380 | # Check to see if we already have this graph, or if we have to make it |
381 | # Check to see if we already have this graph, or if we have to make it |
381 | if( not -e $filePath # does it exist? |
382 | if( not -e $filePath # does it exist? |
382 | or ((stat "$templateDirectory"."$main::envir{fileName}")[9] > (stat $filePath)[9]) # source has changed |
383 | or ((stat "$templateDirectory"."$main::envir{fileName}")[9] > (stat $filePath)[9]) # source has changed |
383 | or $graph->imageName =~ /Undefined_Set/) { # problems from SetMaker and its ilk should always be redone |
384 | or $graph->imageName =~ /Undefined_Set/ # problems from SetMaker and its ilk should always be redone |
|
|
385 | or $refreshCachedImages |
|
|
386 | ) { |
384 | #createFile($filePath, $main::tmp_file_permission, $main::numericalGroupID); |
387 | #createFile($filePath, $main::tmp_file_permission, $main::numericalGroupID); |
385 | local(*OUTPUT); # create local file handle so it won't overwrite other open files. |
388 | local(*OUTPUT); # create local file handle so it won't overwrite other open files. |
386 | open(OUTPUT, ">$filePath")||warn ("$0","Can't open $filePath<BR>",""); |
389 | open(OUTPUT, ">$filePath")||warn ("$0","Can't open $filePath<BR>",""); |
387 | chmod( 0777, $filePath); |
390 | chmod( 0777, $filePath); |
388 | print OUTPUT $graph->draw|| warn("$0","Can't print graph to $filePath<BR>",""); |
391 | print OUTPUT $graph->draw|| warn("$0","Can't print graph to $filePath<BR>",""); |