[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonhelpmenu.pm lonnavmaps.pm

albertel lon-capa-cvs@mail.lon-capa.org
Wed, 29 Sep 2004 19:13:21 -0000


This is a MIME encoded message

--albertel1096485201
Content-Type: text/plain

albertel		Wed Sep 29 15:13:21 2004 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonnavmaps.pm lonhelpmenu.pm 
  Log:
  - updating navmaps and the help icons to use the lonhttpd daemon
  
  
--albertel1096485201
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20040929151321.txt"

Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.214 loncom/interface/loncommon.pm:1.215
--- loncom/interface/loncommon.pm:1.214	Fri Sep 24 18:07:34 2004
+++ loncom/interface/loncommon.pm	Wed Sep 29 15:13:20 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.214 2004/09/24 22:07:34 albertel Exp $
+# $Id: loncommon.pm,v 1.215 2004/09/29 19:13:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -611,8 +611,9 @@
 
     # Add the graphic
     my $title = &mt('Online Help');
+    my $helpicon=&lonhttpdurl("/adm/help/gif/smallHelp.gif");
     $template .= <<"ENDTEMPLATE";
- <a href="$link" title="$title"><image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Help: $topic)" /></a>
+ <a href="$link" title="$title"><image src="$helpicon" border="0" alt="(Help: $topic)" /></a>
 ENDTEMPLATE
     if ($text ne '') { $template.='</td></tr></table>' };
     return $template;
@@ -670,6 +671,7 @@
   "<table bgcolor='#773311' cellspacing='1' cellpadding='1' border='0'><tr>".
   "<td bgcolor='#886622'><a href=\"$link\"><font color='#FFFFFF' size='2'>$text</font></a>";
     }
+    my $helpicon=&lonhttpdurl("/adm/lonIcons/helpgateway.gif");
     $template .= <<"ENDTEMPLATE";
  <script>
 function helpMenu(caller) {
@@ -688,7 +690,7 @@
     }
 }
  </script>
- <a href="$link" title="$title"><image src="/adm/lonIcons/helpgateway.gif" border="0" alt="(Help Menu)" /></a>
+ <a href="$link" title="$title"><image src="$helpicon" border="0" alt="(Help Menu)" /></a>
 ENDTEMPLATE
     if ($component_help) {
 	if (!$text) {
@@ -743,8 +745,9 @@
 
     # Add the graphic
     my $title = &mt('Report a Bug');
+    my $bugicon=&lonhttpdurl("/adm/lonMisc/smallBug.gif");
     $template .= <<"ENDTEMPLATE";
- <a href="$link" title="$title"><image src="/adm/lonMisc/smallBug.gif" border="0" alt="(Bug: $topic)" /></a>
+ <a href="$link" title="$title"><image src="$bugicon" border="0" alt="(Bug: $topic)" /></a>
 ENDTEMPLATE
     if ($text ne '') { $template.='</td></tr></table>' };
     return $template;
@@ -787,8 +790,9 @@
 
     # Add the graphic
     my $title = &mt('View the FAQ');
+    my $faqicon=&lonhttpdurl("/adm/lonMisc/smallFAQ.gif");
     $template .= <<"ENDTEMPLATE";
- <a href="$link" title="$title"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(FAQ: $topic)" /></a>
+ <a href="$link" title="$title"><image src="$faqicon" border="0" alt="(FAQ: $topic)" /></a>
 ENDTEMPLATE
     if ($text ne '') { $template.='</td></tr></table>' };
     return $template;
@@ -2415,10 +2419,8 @@
     my $domain = &determinedomain(shift);    
      # See if there is a logo
     if (-e '/home/httpd/html/adm/lonDomLogos/'.$domain.'.gif') {
-	my $lonhttpdPort=$Apache::lonnet::perlvar{'lonhttpdPort'};
-	if (!defined($lonhttpdPort)) { $lonhttpdPort='8080'; }
-        return '<img src="http://'.$ENV{'HTTP_HOST'}.':'.$lonhttpdPort.
-	    '/adm/lonDomLogos/'.$domain.'.gif" alt="'.$domain.'" />';
+	my $logo=&lonhttpdurl("/adm/lonDomLogos/$domain.gif");
+        return '<img src="'.$logo.'" alt="'.$domain.'" />';
     } elsif(exists($Apache::lonnet::domaindescription{$domain})) {
         return $Apache::lonnet::domaindescription{$domain};
     } else {
@@ -3699,6 +3701,13 @@
     return $iconname;
 } 
 
+sub lonhttpdurl {
+    my ($url)=@_;
+    my $lonhttpd_port=$Apache::lonnet::perlvar{'lonhttpdPort'};
+    if (!defined($lonhttpd_port)) { $lonhttpd_port='8080'; }
+    return 'http://'.$ENV{'SERVER_NAME'}.':'.$lonhttpd_port.$url;
+}
+
 sub connection_aborted {
     my ($r)=@_;
     $r->print(" ");$r->rflush();
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.297 loncom/interface/lonnavmaps.pm:1.298
--- loncom/interface/lonnavmaps.pm:1.297	Tue Sep 21 16:44:16 2004
+++ loncom/interface/lonnavmaps.pm	Wed Sep 29 15:13:20 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.297 2004/09/21 20:44:16 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.298 2004/09/29 19:13:20 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1035,10 +1035,10 @@
 
     my $partLabel = "";
     my $newBranchText = "";
-    
+    my $location=&Apache::loncommon::lonhttpdurl("/adm/lonIcons");
     # If this is a new branch, label it so
     if ($params->{'isNewBranch'}) {
-        $newBranchText = "<img src='/adm/lonIcons/branch.gif' border='0' />";
+        $newBranchText = "<img src='$location/branch.gif' border='0' />";
     }
 
     # links to open and close the folder
@@ -1046,17 +1046,16 @@
     my $linkclose = "</a>";
 
     # Default icon: unknown page
-    my $icon = "<img src='/adm/lonIcons/unknown.gif' alt='' border='0' />";
+    my $icon = "<img src='$location/unknown.gif' alt='' border='0' />";
     
     if ($resource->is_problem()) {
         if ($part eq '0' || $params->{'condensed'}) {
-            $icon = '<img src="/adm/lonIcons/problem.gif" alt="" border="0" />';
+            $icon ='<img src="'.$location.'/problem.gif" alt="" border="0" />';
         } else {
             $icon = $params->{'indentString'};
         }
     } else {
-	$icon = "<img src='".&Apache::loncommon::icon($resource->src).
-	    "' alt='' border='0' />";
+	$icon = "<img src='".&Apache::loncommon::lonhttpdurl(&Apache::loncommon::icon($resource->src))."' alt='' border='0' />";
     }
 
     # Display the correct map icon to open or shut map
@@ -1071,7 +1070,7 @@
 
         if (!$params->{'resource_no_folder_link'}) {
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') . '.gif';
-            $icon = "<img src='/adm/lonIcons/$icon' alt='' border='0' />";
+            $icon = "<img src='$location/$icon' alt='' border='0' />";
 
             $linkopen = "<a href='" . $params->{'url'} . '?' . 
                 $params->{'queryString'} . '&filter=';
@@ -1088,7 +1087,7 @@
             # Don't allow users to manipulate folder
             $icon = "navmap.$folderType." . ($nowOpen ? 'closed' : 'open') .
                 '.nomanip.gif';
-            $icon = "<img src='/adm/lonIcons/$icon' alt='' border='0' />";
+            $icon = "<img src='$location/$icon' alt='' border='0' />";
 
             $linkopen = "";
             $linkclose = "";
@@ -1156,10 +1155,10 @@
     my $link = $params->{"resourceLink"};
     my $linkopen = "<a href='$link'>";
     my $linkclose = "</a>";
-
+    my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
     if ($resource->hasDiscussion()) {
         $discussionHTML = $linkopen .
-            '<img border="0" src="/adm/lonMisc/chat.gif" />' .
+            '<img border="0" src="'.$location.'/chat.gif" />' .
             $linkclose;
     }
     
@@ -1169,7 +1168,7 @@
             if ($_) {
                 $feedbackHTML .= '&nbsp;<a href="/adm/email?display='
                     . &Apache::lonnet::escape($_) . '">'
-                    . '<img src="/adm/lonMisc/feedback.gif" '
+                    . '<img src="'.$location.'/feedback.gif" '
                     . 'border="0" /></a>';
             }
         }
@@ -1184,7 +1183,7 @@
                 $errorcount++;
                 $errorHTML .= '&nbsp;<a href="/adm/email?display='
                     . &Apache::lonnet::escape($_) . '">'
-                    . '<img src="/adm/lonMisc/bomb.gif" '
+                    . '<img src="'.$location.'/bomb.gif" '
                     . 'border="0" /></a>';
             }
         }
@@ -1213,7 +1212,9 @@
         my $icon = $statusIconMap{$resource->simpleStatus($part)};
         my $alt = $iconAltTags{$icon};
         if ($icon) {
-            $result .= "<td width='30' valign='center' width='50' align='right'>$linkopen<img width='25' height='25' src='/adm/lonIcons/$icon' border='0' alt='$alt' />$linkclose</td>\n";
+	    my $location=
+		&Apache::loncommon::lonhttpdurl("/adm/lonIcons/$icon");
+            $result .= "<td width='30' valign='center' width='50' align='right'>$linkopen<img width='25' height='25' src='$location' border='0' alt='$alt' />$linkclose</td>\n";
         } else {
             $result .= "<td width='30'>&nbsp;</td>\n";
         }
@@ -1355,7 +1356,6 @@
     my $args = shift;
     &Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING});
     my $result = '';
-
     # Configure the renderer.
     my $cols = $args->{'cols'};
     if (!defined($cols)) {
@@ -1512,23 +1512,24 @@
     my $printKey = $args->{'printKey'};
     my $printCloseAll = $args->{'printCloseAll'};
     if (!defined($printCloseAll)) { $printCloseAll = 1; }
-    
+
     # Print key?
     if ($printKey) {
         $result .= '<table border="0" cellpadding="2" cellspacing="0">';
         my $date=localtime;
         $result.='<tr><td align="right" valign="bottom">Key:&nbsp;&nbsp;</td>';
+	my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
         if ($navmap->{LAST_CHECK}) {
             $result .= 
-                '<img src="/adm/lonMisc/chat.gif"> '.&mt('New discussion since').' '.
+                '<img src="'.$location.'/chat.gif"> '.&mt('New discussion since').' '.
                 strftime("%A, %b %e at %I:%M %P", localtime($navmap->{LAST_CHECK})).
                 '</td><td align="center" valign="bottom">&nbsp;&nbsp;'.
-                '<img src="/adm/lonMisc/feedback.gif"> '.&mt('New message (click to open)').'<p>'.
+                '<img src="'.$location.'/feedback.gif"> '.&mt('New message (click to open)').'<p>'.
                 '</td>'; 
         } else {
             $result .= '<td align="center" valign="bottom">&nbsp;&nbsp;'.
-                '<img src="/adm/lonMisc/chat.gif"> '.&mt('Discussions').'</td><td align="center" valign="bottom">'.
-                '&nbsp;&nbsp;<img src="/adm/lonMisc/feedback.gif"> '.&mt('New message (click to open)').
+                '<img src="'.$location.'/chat.gif"> '.&mt('Discussions').'</td><td align="center" valign="bottom">'.
+                '&nbsp;&nbsp;<img src="'.$location.'/feedback.gif"> '.&mt('New message (click to open)').
                 '</td>'; 
         }
 
@@ -1639,7 +1640,9 @@
     $args->{'indentLevel'} = 0;
     $args->{'isNewBranch'} = 0;
     $args->{'condensed'} = 0;    
-    $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='/adm/lonIcons/whitespace1.gif' width='25' height='1' alt='' border='0' />");
+    my $location=
+	&Apache::loncommon::lonhttpdurl("/adm/lonIcons/whitespace1.gif");
+    $args->{'indentString'} = setDefault($args->{'indentString'}, "<img src='$location' width='25' height='1' alt='' border='0' />");
     $args->{'displayedHereMarker'} = 0;
 
     # If we're suppressing empty sequences, look for them here. Use DFS for speed,
@@ -1979,6 +1982,7 @@
     $result .= '</select>&nbsp;<input type="button" name="chgnav"
                    value="Go" onClick="javascript:changeNavDisplay()" />
                 </nobr></form></td>'."\n";
+	
     return $result;
 }
 
Index: loncom/interface/lonhelpmenu.pm
diff -u loncom/interface/lonhelpmenu.pm:1.11 loncom/interface/lonhelpmenu.pm:1.12
--- loncom/interface/lonhelpmenu.pm:1.11	Mon Sep 13 09:31:52 2004
+++ loncom/interface/lonhelpmenu.pm	Wed Sep 29 15:13:20 2004
@@ -76,7 +76,7 @@
     my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink');
     my $pagecolor = &Apache::loncommon::designparm($function.'.pgbg');
     my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
-
+    my $location=&lonhttpdurl("/adm");
     if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {
         $tablecolor = '#CCCCFF';
     }
@@ -105,7 +105,7 @@
   <tr height="50">
    <td width='5'>&nbsp;</td>
    <td>
-    <fieldset><legend><img src="/adm/lonIcons/minilogo.gif" height='20' width='29' valign='bottom' />&nbsp;&nbsp;<b><font size="+1">LON-CAPA help/support</font></b></legend>
+    <fieldset><legend><img src="$location/lonIcons/minilogo.gif" height='20' width='29' valign='bottom' />&nbsp;&nbsp;<b><font size="+1">LON-CAPA help/support</font></b></legend>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
   <tr>
    <td>
@@ -123,34 +123,34 @@
             $r->print("
             <td align=\"center\">&nbsp;<b><a href=\"$component_url\" target=\"bodyframe\">");
         } elsif ($ENV{'user.adv'}) {
-            $r->print('<td align="center">&nbsp;<b><a href="/adm/help/nohelptopic.html" target="bodyframe">');
+            $r->print('<td align="center">&nbsp;<b><a href="$location/help/nohelptopic.html" target="bodyframe">');
         }
         $r->print('
-  <image src="/adm/help/gif/smallHelp.gif" border="0" alt="(Topic help)" valign="middle" />&nbsp;Topic help</a></b>&nbsp;</td>');
+  <image src="$location/help/gif/smallHelp.gif" border="0" alt="(Topic help)" valign="middle" />&nbsp;Topic help</a></b>&nbsp;</td>');
     }
     if ($requestmail =~ m/^[^\@]+\@[^\@]+$/) {
         $r->print('
-            <td align="center">&nbsp;<b><a href="/adm/support?origurl='.&Apache::lonnet::escape($origurl).'&function='.$function.'" target="bodyframe"><image src="/adm/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" />&nbsp;Ask helpdesk</a></b>&nbsp;</td>');
+            <td align="center">&nbsp;<b><a href="/adm/support?origurl='.&Apache::lonnet::escape($origurl).'&function='.$function.'" target="bodyframe"><image src="$location/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" />&nbsp;Ask helpdesk</a></b>&nbsp;</td>');
     }
     if ($faq && $ENV{'user.adv'}) {
         $r->print(<<END)
             <td align="center">
-             &nbsp;<b><a href="$faqbaseurl/fom/cache/$faq.html" target="bodyframe"><image src="/adm/lonMisc/smallFAQ.gif" border="0" alt="(FAQ)" valign="middle" />&nbsp;FAQ</a></b>&nbsp;
+             &nbsp;<b><a href="$faqbaseurl/fom/cache/$faq.html" target="bodyframe"><image src="$location/lonMisc/smallFAQ.gif" border="0" alt="(FAQ)" valign="middle" />&nbsp;FAQ</a></b>&nbsp;
             </td>
 END
     }
     if ($ENV{'user.adv'}) {
         $r->print(<<END)
-            <td align="center">&nbsp;<b><a href="$bugurl" target="bodyframe"><image src="/adm/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" />&nbsp;Report a bug</a>&nbsp;</b></td>
+            <td align="center">&nbsp;<b><a href="$bugurl" target="bodyframe"><image src="$location/lonMisc/smallBug.gif" border="0" alt="(Report a bug)" valign="middle" />&nbsp;Report a bug</a>&nbsp;</b></td>
 END
     }
     if ($stayOnPage) {
         $r->print(<<END);
-            <td align="center">&nbsp;<b><a href="$origurl" target="_top"><image src="/adm/lonIcons/move_up.gif" border="0" alt="(Return to last location)" valign="middle" />&nbsp;Return to last location</a></b>&nbsp;</td>
+            <td align="center">&nbsp;<b><a href="$origurl" target="_top"><image src="$location/lonIcons/move_up.gif" border="0" alt="(Return to last location)" valign="middle" />&nbsp;Return to last location</a></b>&nbsp;</td>
 END
     } else {
         $r->print(<<END);
-            <td align="center">&nbsp;<b><a href="javascript:window.close()" target="_top"><image src="/adm/lonIcons/closepage.gif" border="0" alt="(Close window)" valign="bottom" />&nbsp;Close</a></b>&nbsp;</td>
+            <td align="center">&nbsp;<b><a href="javascript:window.close()" target="_top"><image src="$location/lonIcons/closepage.gif" border="0" alt="(Close window)" valign="bottom" />&nbsp;Close</a></b>&nbsp;</td>
 END
     }
     $r->print(<<END);

--albertel1096485201--