[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Mon Nov 7 13:21:17 EST 2011


raeburn		Mon Nov  7 18:21:17 2011 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm 
  Log:
  - use lonDocRoot perlvar in place of static string: '/home/httpd/html'.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.158 loncom/interface/domainprefs.pm:1.159
--- loncom/interface/domainprefs.pm:1.158	Sun Oct 30 22:19:15 2011
+++ loncom/interface/domainprefs.pm	Mon Nov  7 18:21:17 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.158 2011/10/30 22:19:15 raeburn Exp $
+# $Id: domainprefs.pm,v 1.159 2011/11/07 18:21:17 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1058,6 +1058,7 @@
 sub display_color_options {
     my ($dom,$confname,$phase,$role,$itemcount,$choices,$is_custom,$defaults,$designs,
         $images,$bgs,$links,$alt_text,$rowtotal,$logintext) = @_;
+    my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'};
     my $css_class = $itemcount%2?' class="LC_odd_row"':'';
     my $datatable = '<tr'.$css_class.'>'.
         '<td>'.$choices->{'font'}.'</td>';
@@ -1135,11 +1136,11 @@
                 $showfile = $imgfile;
                 my $imgdir = $1;
                 my $filename = $2;
-                if (-e "/home/httpd/html/$imgdir/tn-".$filename) {
+                if (-e "$londocroot/$imgdir/tn-".$filename) {
                     $showfile = "/$imgdir/tn-".$filename;
                 } else {
-                    my $input = "/home/httpd/html".$imgfile;
-                    my $output = '/home/httpd/html/'.$imgdir.'/tn-'.$filename;
+                    my $input = $londocroot.$imgfile;
+                    my $output = "$londocroot/$imgdir/tn-".$filename;
                     if (!-e $output) {
                         my ($width,$height) = &thumb_dimensions();
                         my ($fullwidth,$fullheight) = &check_dimensions($input);
@@ -1147,7 +1148,7 @@
                             if ($fullwidth > $width && $fullheight > $height) { 
                                 my $size = $width.'x'.$height;
                                 system("convert -sample $size $input $output");
-                                $showfile = '/'.$imgdir.'/tn-'.$filename;
+                                $showfile = "/$imgdir/tn-".$filename;
                             }
                         }
                     }




More information about the LON-CAPA-cvs mailing list