Diff for /loncom/interface/groupsort.pm between versions 1.36 and 1.37

version 1.36, 2005/06/10 16:56:08 version 1.37, 2005/06/10 20:43:10
Line 227  sub readfromfile { Line 227  sub readfromfile {
     &Apache::loncommon::plainname($2,$3).', '.      &Apache::loncommon::plainname($2,$3).', '.
     &Apache::lonlocal::locallocaltime($1);      &Apache::lonlocal::locallocaltime($1);
     }      }
       $name=~s/\&colon\;/\:/g;
     $$thash{$url}=$name;      $$thash{$url}=$name;
                     $$shash{$url}=$n;                      $$shash{$url}=$n;
                     $n++;                      $n++;
Line 253  sub handler { Line 254  sub handler {
   
 # finish_import looks different for graphical or "simple" RAT  # finish_import looks different for graphical or "simple" RAT
     my $finishimport='';      my $finishimport='';
       my $begincondition='';
       my $endcondition='';
       if ($env{'form.readfile'}) {
           $begincondition='if (eval("document.forms.groupsort.include"+num+".checked")) {';
    $endcondition='}';
       }
     if ($env{'form.mode'} eq 'simple' || $env{'form.mode'} eq '') {      if ($env{'form.mode'} eq 'simple' || $env{'form.mode'} eq '') {
         $finishimport=(<<ENDSMP);          $finishimport=(<<ENDSMP);
 function finish_import() {  function finish_import() {
     opener.document.forms.simpleedit.importdetail.value='';      opener.document.forms.simpleedit.importdetail.value='';
     for (var num=0; num<document.forms.groupsort.fnum.value; num++) {      for (var num=0; num<document.forms.groupsort.fnum.value; num++) {
    $begincondition
  opener.document.forms.simpleedit.importdetail.value+='&'+   opener.document.forms.simpleedit.importdetail.value+='&'+
               escape(eval("document.forms.groupsort.title"+num+".value"))+'='+                escape(eval("document.forms.groupsort.title"+num+".value"))+'='+
       escape(eval("document.forms.groupsort.filelink"+num+".value"));        escape(eval("document.forms.groupsort.filelink"+num+".value"));
    $endcondition
     }      }
     opener.document.forms.simpleedit.submit();      opener.document.forms.simpleedit.submit();
     self.close();      self.close();
Line 271  ENDSMP Line 280  ENDSMP
 function finish_import() {  function finish_import() {
     var linkflag=false;      var linkflag=false;
     for (var num=0; num<document.forms.groupsort.fnum.value; num++) {      for (var num=0; num<document.forms.groupsort.fnum.value; num++) {
    $begincondition
  insertRowInLastRow();   insertRowInLastRow();
  placeResourceInLastRow(   placeResourceInLastRow(
        eval("document.forms.groupsort.title"+num+".value"),         eval("document.forms.groupsort.title"+num+".value"),
Line 278  function finish_import() { Line 288  function finish_import() {
        linkflag         linkflag
  );   );
         linkflag=true;          linkflag=true;
    $endcondition
     }      }
     opener.editmode=0;      opener.editmode=0;
     opener.notclear=0;      opener.notclear=0;
Line 349  END Line 360  END
  'ca' => 'Cancel',   'ca' => 'Cancel',
  'co' => 'Change Order',   'co' => 'Change Order',
  'ti' => 'Title',   'ti' => 'Title',
  'pa' => 'Path'   'pa' => 'Path',
                   'in' => 'Include'
  );   );
  $r->print(&Apache::loncommon::bodytag('Sort Imported Resources'));   $r->print(&Apache::loncommon::bodytag('Sort Imported Resources'));
  $r->print(<<END);   $r->print(<<END);
Line 387  END Line 399  END
 END  END
         $r->print("<table border='0'><tr><td bgcolor='#eeeeee'>");          $r->print("<table border='0'><tr><td bgcolor='#eeeeee'>");
  $r->print("<table border=0><tr>\n");   $r->print("<table border=0><tr>\n");
  $r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'co'}</b></td>\n");   if ($env{'form.readfile'}) { 
       $r->print("<td bgcolor='$titleclr'><b>$lt{'in'}</b></td>\n");
    } else { 
       $r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'co'}</b></td>\n"); 
    }
  $r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'ti'}</b></td>\n");   $r->print("<td colspan='2' bgcolor='$titleclr'><b>$lt{'ti'}</b></td>\n");
  $r->print("<td bgcolor='$titleclr'><b>$lt{'pa'}</b></td></tr>\n");   $r->print("<td bgcolor='$titleclr'><b>$lt{'pa'}</b></td></tr>\n");
     } else {      } else {
Line 407  END Line 423  END
  my $iconname=&Apache::loncommon::icon($key);   my $iconname=&Apache::loncommon::icon($key);
  if ($clen > 1) {   if ($clen > 1) {
     $r->print("<tr><td bgcolor='$fileclr'>");      $r->print("<tr><td bgcolor='$fileclr'>");
     $r->print(&movers($clen,$ctr));              if ($env{'form.readfile'}) {
    $r->print(&checkbox($ctr-1));
       } else {
    $r->print(&movers($clen,$ctr));
       }
  }   }
  $r->print(&hidden($ctr-1,$thash{$key},$key));   $r->print(&hidden($ctr-1,$thash{$key},$key));
  if ($clen > 1) {   if ($clen > 1) {
     $r->print("</td><td bgcolor='$fileclr'>");      $r->print("</td>");
     $r->print(&select_box($clen,$ctr));              unless ($env{'form.readfile'}) {
     $r->print("</td><td bgcolor='$fileclr'>");   $r->print("<td bgcolor='$fileclr'>".
     &select_box($clen,$ctr).
     "</td>");
       }
       $r->print("<td bgcolor='$fileclr'>");
     $r->print("<img src='$iconname' />");      $r->print("<img src='$iconname' />");
     $r->print("</td><td bgcolor='$fileclr'>");      $r->print("</td><td bgcolor='$fileclr'>");
     $r->print("$thash{$key}$nhash{$key}</td><td bgcolor='$fileclr'>\n");      $r->print("$thash{$key}$nhash{$key}</td><td bgcolor='$fileclr'>\n");
Line 484  sub select_box { Line 508  sub select_box {
     return $string;      return $string;
 }  }
   
   # ------------------------------------------------------------------- Checkbox
   
   sub checkbox {
       my $sel=shift;
       return "<label><input type='checkbox' name='include$sel'".
          ($env{"form.include$sel"}?' checked="checked"':'').
          ' />'.&mt('Include').'</label>';
   }
   
 1;  1;
   
 __END__  __END__

Removed from v.1.36  
changed lines
  Added in v.1.37


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