Diff for /loncom/interface/loncommon.pm between versions 1.948 and 1.949

version 1.948, 2010/03/08 14:51:14 version 1.949, 2010/03/10 21:25:49
Line 1202  ENDOUTPUT Line 1202  ENDOUTPUT
 sub help_open_menu {  sub help_open_menu {
     my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text)       my ($topic,$component_help,$faq,$bug,$stayOnPage,$width,$height,$text) 
  = @_;       = @_;    
     $stayOnPage = 0 if (not defined $stayOnPage);      $stayOnPage = 1;
     # only use pop-up help (stayOnPage == 0)  
     # if environment.remote is on (using remote control UI)  
     if ($env{'environment.remote'} eq 'off' ) {  
         $stayOnPage=1;  
     }  
     my $output;      my $output;
     if ($component_help) {      if ($component_help) {
  if (!$text) {   if (!$text) {
Line 1228  sub help_open_menu { Line 1223  sub help_open_menu {
 sub top_nav_help {  sub top_nav_help {
     my ($text) = @_;      my ($text) = @_;
     $text = &mt($text);      $text = &mt($text);
     my $stay_on_page =       my $stay_on_page = 1;
  ($env{'environment.remote'} eq 'off' );  
     my $link = ($stay_on_page) ? "javascript:helpMenu('display')"      my $link = ($stay_on_page) ? "javascript:helpMenu('display')"
                      : "javascript:helpMenu('open')";                       : "javascript:helpMenu('open')";
     my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);      my $banner_link = &update_help_link(undef,undef,undef,undef,$stay_on_page);
Line 1244  END Line 1239  END
   
 sub help_menu_js {  sub help_menu_js {
     my ($text) = @_;      my ($text) = @_;
       my $stayOnPage = 1;
     my $stayOnPage =   
  ($env{'environment.remote'} eq 'off' );  
   
     my $width = 620;      my $width = 620;
     my $height = 600;      my $height = 600;
     my $helptopic=&general_help();      my $helptopic=&general_help();
Line 1304  sub help_open_bug { Line 1296  sub help_open_bug {
     unless ($env{'user.adv'}) { return ''; }      unless ($env{'user.adv'}) { return ''; }
     unless ($Apache::lonnet::perlvar{'BugzillaHost'}) { return ''; }      unless ($Apache::lonnet::perlvar{'BugzillaHost'}) { return ''; }
     $text = "" if (not defined $text);      $text = "" if (not defined $text);
     $stayOnPage = 0 if (not defined $stayOnPage);  
     if ($env{'environment.remote'} eq 'off' ) {  
  $stayOnPage=1;   $stayOnPage=1;
     }  
     $width = 600 if (not defined $width);      $width = 600 if (not defined $width);
     $height = 600 if (not defined $height);      $height = 600 if (not defined $height);
   
Line 1348  sub help_open_faq { Line 1337  sub help_open_faq {
     unless ($env{'user.adv'}) { return ''; }      unless ($env{'user.adv'}) { return ''; }
     unless ($Apache::lonnet::perlvar{'FAQHost'}) { return ''; }      unless ($Apache::lonnet::perlvar{'FAQHost'}) { return ''; }
     $text = "" if (not defined $text);      $text = "" if (not defined $text);
     $stayOnPage = 0 if (not defined $stayOnPage);  
     if ($env{'environment.remote'} eq 'off' ) {  
  $stayOnPage=1;   $stayOnPage=1;
     }  
     $width = 350 if (not defined $width);      $width = 350 if (not defined $width);
     $height = 400 if (not defined $height);      $height = 400 if (not defined $height);
   
Line 4550  Inputs: Line 4536  Inputs:
   
 =item * $bgcolor, used to override the bgcolor on a webpage to a specific value  =item * $bgcolor, used to override the bgcolor on a webpage to a specific value
   
 =item * $no_inline_link, if true and in remote mode, don't show the   #RC =item * $no_inline_link, if true and in remote mode, don't show the 
          'Switch To Inline Menu' link  #RC          'Switch To Inline Menu' link
   #RC 
 =item * $args, optional argument valid values are  =item * $args, optional argument valid values are
             no_auto_mt_title -> prevents &mt()ing the title arg              no_auto_mt_title -> prevents &mt()ing the title arg
             inherit_jsmath -> when creating popup window in a page,              inherit_jsmath -> when creating popup window in a page,
Line 4642  sub bodytag { Line 4628  sub bodytag {
     $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;      $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
     &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);      &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
   
     if ($env{'environment.remote'} eq 'off') {  
         # No Remote          # No Remote
         if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') {           if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { 
             return $bodytag;               return $bodytag; 
Line 4698  sub bodytag { Line 4683  sub bodytag {
         }          }
   
         return $bodytag;          return $bodytag;
     }  
   
 #  
 # Top frame rendering, Remote is up  
 #  
   
     my $imgsrc = $img;  
     if ($img =~ /^\/adm/) {  
         $imgsrc = &lonhttpdurl($img);  
     }  
     my $upperleft='<img src="'.$imgsrc.'" alt="'.$function.'" />';  
   
     # Explicit link to get inline menu  
     my $menu= ($no_inline_link?''  
        :'<a href="/adm/remote?action=collapse" target="_top">'.&mt('Switch to Inline Menu Mode').'</a>');  
   
     if ($dc_info) {  
         $dc_info = qq|<span class="LC_cusr_subheading">($dc_info)</span>|;  
     }  
   
     $bodytag .= qq|<div id="LC_nav_bar">$name $role</div>  
             <ol class="LC_primary_menu LC_right">  
                 <li>$menu</li>  
             </ol><div id="LC_realm"> $realm $dc_info</div>| unless $env{'form.inhibitmenu'};  
     return(<<ENDBODY);  
 $bodytag  
 <table id="LC_title_bar" class="LC_with_remote">  
 <tr><td>$upperleft</td>  
     <td>$messages&nbsp;</td>  
 </tr>  
 <tr><td>$titleinfo $dc_info $menu</td>  
 </tr>  
 </table>  
 ENDBODY  
 }  }
   
 sub dc_courseid_toggle {  sub dc_courseid_toggle {
Line 5111  td.LC_table_cell_checkbox { Line 5062  td.LC_table_cell_checkbox {
   padding: 0;    padding: 0;
 }  }
   
 /* Preliminary fix to hide breadcrumbs inside remote control window */  
 #LC_remote #LC_breadcrumbs {  
   display:none;  
 }  
   
 #LC_head_subbox {  #LC_head_subbox {
   clear:both;    clear:both;
   background: #F8F8F8; /* $sidebg; */    background: #F8F8F8; /* $sidebg; */
Line 6106  ol.LC_primary_menu { Line 6052  ol.LC_primary_menu {
   margin: 0;    margin: 0;
 }  }
   
 span.LC_new_message{  
   font-weight:bold;  
   color: darkred;  
 }  
   
 ol#LC_PathBreadcrumbs {  ol#LC_PathBreadcrumbs {
   margin: 0;    margin: 0;
 }  }
Line 6131  ol.LC_primary_menu a { Line 6072  ol.LC_primary_menu a {
   text-decoration: none;    text-decoration: none;
 }  }
   
   ol.LC_primary_menu a.LC_new_message {
     font-weight:bold;
     color: darkred;
   }
   
 ul#LC_secondary_menu {  ul#LC_secondary_menu {
   clear: both;    clear: both;
   color: $fontmenu;    color: $fontmenu;
Line 6764  $args - additional optional args support Line 6710  $args - additional optional args support
              skip_phases    -> hash ref of                skip_phases    -> hash ref of 
                                     head -> skip the <html><head> generation                                      head -> skip the <html><head> generation
                                     body -> skip all <body> generation                                      body -> skip all <body> generation
              no_inline_link -> if true and in remote mode, don't show the   #RC             no_inline_link -> if true and in remote mode, don't show the 
                                     'Switch To Inline Menu' link  #RC                                    'Switch To Inline Menu' link
              no_auto_mt_title -> prevent &mt()ing the title arg               no_auto_mt_title -> prevent &mt()ing the title arg
              inherit_jsmath -> when creating popup window in a page,               inherit_jsmath -> when creating popup window in a page,
                                     should it have jsmath forced on by the                                      should it have jsmath forced on by the
Line 6831  sub start_page { Line 6777  sub start_page {
     return $result if $args->{'only_body'};      return $result if $args->{'only_body'};
   
     #Breadcrumbs for Construction Space provided by &bodytag.       #Breadcrumbs for Construction Space provided by &bodytag. 
     if (($env{'environment.remote'} eq 'off') && ($env{'request.state'} eq 'construct')) {      if (
           $env{'request.state'} eq 'construct') {
         return $result;          return $result;
     }      }
     
Line 10690  sub init_user_environment { Line 10637  sub init_user_environment {
     my %userenv = &Apache::lonnet::dump('environment',$domain,$username);      my %userenv = &Apache::lonnet::dump('environment',$domain,$username);
     my ($tmp) = keys(%userenv);      my ($tmp) = keys(%userenv);
     if ($tmp !~ /^(con_lost|error|no_such_host)/i) {      if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
  # default remote control to off  
  if ($userenv{'remote'} ne 'on') { $userenv{'remote'} = 'off'; }  
     } else {      } else {
  undef(%userenv);   undef(%userenv);
     }      }
     if (($userenv{'interface'}) && (!$form->{'interface'})) {      if (($userenv{'interface'}) && (!$form->{'interface'})) {
  $form->{'interface'}=$userenv{'interface'};   $form->{'interface'}=$userenv{'interface'};
     }      }
     $env{'environment.remote'}=$userenv{'remote'};  
     if ($userenv{'texengine'} eq 'ttm') { $clientmathml=1; }      if ($userenv{'texengine'} eq 'ttm') { $clientmathml=1; }
   
 # --------------- Do not trust query string to be put directly into environment  # --------------- Do not trust query string to be put directly into environment
Line 10730  sub init_user_environment { Line 10674  sub init_user_environment {
     $initial_env{"browser.localres"}   = $form->{'localres'};      $initial_env{"browser.localres"}   = $form->{'localres'};
         }          }
   
  if ($public) {  
     $initial_env{"environment.remote"} = "off";  
  }  
  if ($form->{'interface'}) {   if ($form->{'interface'}) {
     $form->{'interface'}=~s/\W//gs;      $form->{'interface'}=~s/\W//gs;
     $initial_env{"browser.interface"} = $form->{'interface'};      $initial_env{"browser.interface"} = $form->{'interface'};

Removed from v.1.948  
changed lines
  Added in v.1.949


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>