[system] / trunk / pg / macros / dangerousMacros.pl Repository:
ViewVC logotype

Diff of /trunk/pg/macros/dangerousMacros.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 5406 Revision 5407
120 120
121 $templateDirectory = eval('$main::envir{templateDirectory}'); 121 $templateDirectory = eval('$main::envir{templateDirectory}');
122 $scriptDirectory = eval('$main::envir{scriptDirectory}'); 122 $scriptDirectory = eval('$main::envir{scriptDirectory}');
123 $externalTTHPath = eval('$main::envir{externalTTHPath}'); 123 $externalTTHPath = eval('$main::envir{externalTTHPath}');
124 $pwd = $templateDirectory.$pwd unless substr($pwd,0,1) eq '/'; 124 $pwd = $templateDirectory.$pwd unless substr($pwd,0,1) eq '/';
125 $pwd =~ s!/tmpEdit/!/!;
125 warn "dangerousmacros initialized" if $debugON; 126 warn "dangerousmacros initialized" if $debugON;
126 warn eval(q! "dangerousmacros.pl externalTTHPath is ".$main::externalTTHPath;!) if $debugON; 127 warn eval(q! "dangerousmacros.pl externalTTHPath is ".$main::externalTTHPath;!) if $debugON;
127 warn eval(q! "dangerousmacros.pl: The envir variable $main::{envir} is".join(" ",%main::envir)!) if $debugON; 128 warn eval(q! "dangerousmacros.pl: The envir variable $main::{envir} is".join(" ",%main::envir)!) if $debugON;
128} 129}
129 130
889 my $externalGif2EpsPath = $envir->{externalGif2EpsPath}; 890 my $externalGif2EpsPath = $envir->{externalGif2EpsPath};
890 my $externalPng2EpsPath = $envir->{externalPng2EpsPath}; 891 my $externalPng2EpsPath = $envir->{externalPng2EpsPath};
891 892
892 my $aux_file_path = shift @_; 893 my $aux_file_path = shift @_;
893 warn "Empty string used as input into the function alias" unless $aux_file_path; 894 warn "Empty string used as input into the function alias" unless $aux_file_path;
895 #
896 # Find auxiliary files even when the main file is in tempates/tmpEdit
897 #
898 $fileName =~ s!(^|/)tmpEdit/!\1!;
894 899
895 # problem specific data 900 # problem specific data
896 warn "The path to the current problem file template is not defined." unless $fileName; 901 warn "The path to the current problem file template is not defined." unless $fileName;
897 warn "The current studentLogin is not defined " unless $studentLogin; 902 warn "The current studentLogin is not defined " unless $studentLogin;
898 warn "The current problem set number is not defined" if $setNumber eq ""; # allow for sets equal to 0 903 warn "The current problem set number is not defined" if $setNumber eq ""; # allow for sets equal to 0
1021 # Make file names work in Library Browser when the images in several 1026 # Make file names work in Library Browser when the images in several
1022 # files have the same names. 1027 # files have the same names.
1023 my $libFix = ""; 1028 my $libFix = "";
1024 if ($setNumber eq "Undefined_Set") { 1029 if ($setNumber eq "Undefined_Set") {
1025 $libFix = $fileName; 1030 $libFix = $fileName;
1026 $libFix =~ s!.*/!!; $libFix =~ s!\.[^.]*$!!; 1031 $libFix =~ s!.*/!!; $libFix =~ s!\.pg(\..*)?$!!;
1027 $libFix =~ s![^a-zA-Z0-9._-]!!g; 1032 $libFix =~ s![^a-zA-Z0-9._-]!!g;
1028 $libFix .= '-'; 1033 $libFix .= '-';
1029 } 1034 }
1030 1035
1031 my $link = "gif/$setNumber-prob$probNum-$libFix$aux_file_path.$ext"; 1036 my $link = "gif/$setNumber-prob$probNum-$libFix$aux_file_path.$ext";

Legend:
Removed from v.5406  
changed lines
  Added in v.5407

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9