Diff for /loncom/homework/structuretags.pm between versions 1.440 and 1.447

version 1.440, 2009/03/18 13:46:26 version 1.447, 2009/05/28 12:39:17
Line 203  sub page_start { Line 203  sub page_start {
  }   }
     }      }
   
       my $pageheader = '';
     if (defined($found{'body'})) {      if (defined($found{'body'})) {
  $body_args{'skip_phases'}{'body'}=1;   $body_args{'skip_phases'}{'body'}=1;
     } elsif (!defined($found{'body'})       } elsif (!defined($found{'body'}) 
Line 211  sub page_start { Line 212  sub page_start {
     if ($env{'environment.remote'} ne 'off') {      if ($env{'environment.remote'} ne 'off') {
  $body_args{'only_body'}  = 1;   $body_args{'only_body'}  = 1;
     }      }
           $pageheader = &Apache::lonhtmlcommon::breadcrumbs() # FIXME add breadcrumbs
                        .&Apache::loncommon::head_subbox(
                   &Apache::loncommon::CSTR_pageheader());
  }   }
     } elsif (!defined($found{'body'})) {      } elsif (!defined($found{'body'})) {
  my %add_entries;   my %add_entries;
Line 222  sub page_start { Line 226  sub page_start {
   
  my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,   my $bgcolor=&Apache::lonxml::get_param('bgcolor',$parstack,
        $safeeval);         $safeeval);
         if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }          if ($bgcolor eq '' ) { $bgcolor = '#FFFFFF'; }
   
  $body_args{'bgcolor'}        = $bgcolor;          $body_args{'bgcolor'}        = $bgcolor;
  $body_args{'no_title'}       = 1;          # $body_args{'no_title'}       = 1;
  $body_args{'force_register'} = 1;          $body_args{'force_register'} = 1;
  $body_args{'add_entries'}    = \%add_entries;          $body_args{'add_entries'}    = \%add_entries;
  if ($env{'environment.remote'} eq 'off'          if ($env{'environment.remote'} eq 'off'
     && $env{'request.state'} eq   'construct') {              && $env{'request.state'} eq   'construct') {
     $body_args{'only_body'}  = 1;              $body_args{'only_body'}  = 1;
  }          }
     }      }
     $body_args{'no_auto_mt_title'} = 1;      $body_args{'no_auto_mt_title'} = 1;
     my $page_start = &Apache::loncommon::start_page($name,$extra_head,      my $page_start = &Apache::loncommon::start_page($name,$extra_head,
     \%body_args);      \%body_args);
       $page_start .= $pageheader;
     if (!defined($found{'body'})       if (!defined($found{'body'}) 
  && $env{'request.state'} ne 'construct'   && $env{'request.state'} ne 'construct'
  && ($target eq 'web' || $target eq 'webgrade')) {   && ($target eq 'web' || $target eq 'webgrade')) {
Line 522  $show_all Line 526  $show_all
   
     $result.='      $result.='
    </div>     </div>
    <div class="LC_edit_problem_header_edit_row">';     <hr class="LC_edit_problem_divide" />
      <div>';
     $result.='<input type="hidden" name="problemmode" value="view" />';      $result.='<input type="hidden" name="problemmode" value="view" />';
     $result .= '<input type="button" name="submitmode" accesskey="e" value="'.&mt('Edit').'" '.      $result .= '<input type="button" name="submitmode" accesskey="e" value="'.&mt('Edit').'" '.
                'onclick="javascript:setmode(this.form,'."'edit'".')" />';                 'onclick="javascript:setmode(this.form,'."'edit'".')" />';
Line 530  $show_all Line 535  $show_all
                'onclick="javascript:setmode(this.form,'."'editxml'".')" />';                 'onclick="javascript:setmode(this.form,'."'editxml'".')" />';
     $result.='      $result.='
    </div>     </div>
      <hr class="LC_edit_problem_divide" />
    '.&Apache::lonxml::message_location().'     '.&Apache::lonxml::message_location().'
 </div>';  </div>';
     return $result;      return $result;
Line 677  sub checkout_msg { Line 683  sub checkout_msg {
 <font color="red">  <font color="red">
 <p>$lt{'warning'}</p>  <p>$lt{'warning'}</p>
 </font>  </font>
 <form name="checkout" method="POST" action="$uri">  <form name="checkout" method="post" action="$uri">
 <input type="hidden" name="doescheckout" value="yes" />  <input type="hidden" name="doescheckout" value="yes" />
 <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />  <input type="button" name="checkoutbutton" value="$lt{'checkout'}" onClick="javascript:if (confirm('$lt{'checkout?'}')) { document.checkout.submit(); }" />
 </form>  </form>
Line 711  sub firstaccess_msg { Line 717  sub firstaccess_msg {
     my $buttontext = &mt('Show Resource');      my $buttontext = &mt('Show Resource');
     my $timertext = &mt('Start Timer?');      my $timertext = &mt('Start Timer?');
     $result .= (<<ENDCHECKOUT);      $result .= (<<ENDCHECKOUT);
 <form name="markaccess" method="POST" action="$uri">  <form name="markaccess" method="post" action="$uri">
 <input type="hidden" name="markaccess" value="yes" />  <input type="hidden" name="markaccess" value="yes" />
 <input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />  <input type="button" name="accessbutton" value="$buttontext" onClick="javascript:if (confirm('$timertext')) { document.markaccess.submit(); }" />
 </form>  </form>
Line 939  sub start_problem { Line 945  sub start_problem {
  my $msg;   my $msg;
  if ($status eq 'UNAVAILABLE') {   if ($status eq 'UNAVAILABLE') {
     $msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>';      $msg.='<h1>'.&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'</h1>';
                   } elsif ($status eq 'NOT_IN_A_SLOT') {
                       $msg.='<h1>'.&mt('You are not currently signed up to work at this time and/or place.').'</h1>';
  } elsif ($status ne 'NOT_YET_VIEWED') {   } elsif ($status ne 'NOT_YET_VIEWED') {
     $msg.='<h1>'.&mt('Not open to be viewed').'</h1>';      $msg.='<h1>'.&mt('Not open to be viewed').'</h1>';
  }   }
Line 949  sub start_problem { Line 957  sub start_problem {
  } elsif ($status eq 'NOT_YET_VIEWED') {   } elsif ($status eq 'NOT_YET_VIEWED') {
     $msg.=&firstaccess_msg($accessmsg,$symb);      $msg.=&firstaccess_msg($accessmsg,$symb);
  } elsif ($status eq 'NOT_IN_A_SLOT') {   } elsif ($status eq 'NOT_IN_A_SLOT') {
     $msg.=&Apache::bridgetask::add_request_another_attempt_button("Sign up for time to work.");      $msg.=&Apache::bridgetask::add_request_another_attempt_button("Sign up for time to work");
  }   }
  $result.=$msg.'<br />';   $result.=$msg.'<br />';
     } elsif ($target eq 'tex') {      } elsif ($target eq 'tex') {
  my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''   my $startminipage = ($env{'form.problem_split'}=~/yes/i)? ''
                     : '\begin{minipage}{\textwidth}';                      : '\begin{minipage}{\textwidth}';
  $result.='\begin{document}\noindent \vskip 1 mm '.   $result.='\noindent \vskip 1 mm '.
     $startminipage.'\vskip 0 mm';      $startminipage.'\vskip 0 mm';
  if ($status eq 'UNAVAILABLE') {   if ($status eq 'UNAVAILABLE') {
     $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';      $result.=&mt('Unable to determine if this resource is open due to network problems. Please try again later.').'\vskip 0 mm ';
Line 1056  sub end_problem { Line 1064  sub end_problem {
     $allow_print_points=0;      $allow_print_points=0;
  }   }
  my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header');   my $name_of_resourse= &Apache::lonxml::latex_special_symbols(&get_resource_name($parstack,$safeeval),'header');
  my $begin_doc='\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent ';   my $begin_doc=' \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$env{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent ';
  my $toc_line='\vskip 1 mm\noindent '.$startminipage.   my $toc_line='\vskip 1 mm\noindent '.$startminipage.
     '\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';      '\addcontentsline{toc}{subsection}{'.$name_of_resourse.'}';
   
Line 2032  sub start_simpleeditbutton { Line 2040  sub start_simpleeditbutton {
         my $url=$env{'request.noversionuri'};          my $url=$env{'request.noversionuri'};
         $url=~s/\?.*$//;          $url=~s/\?.*$//;
  my ($symb) = &Apache::lonnet::whichuser();   my ($symb) = &Apache::lonnet::whichuser();
  $result='<table width="100%" bgcolor="#FFFFAA" border="2"><tr><td>'.  #       Warning make more sense and is more important on edit screen
                 '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a> - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.').  #       $result='<p class="LC_warning">'
 &Apache::loncommon::help_open_topic('Caching').'</td></tr></table><br />';  #              .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.')
   #              .&Apache::loncommon::help_open_topic('Caching')
   #              .'</p>';
           $result.=&Apache::lontemplate::start_functionslist()
                   .&Apache::lontemplate::item_functionslist(
                        '<a href="'.$url.'/smpedit?symb='.&escape($symb).'">'.&mt('Edit').'</a>')
                   .&Apache::lontemplate::end_functionslist();
   
     }      }
     return $result;      return $result;
 }  }

Removed from v.1.440  
changed lines
  Added in v.1.447


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