Diff for /loncom/interface/loncourserespicker.pm between versions 1.8 and 1.11

version 1.8, 2013/11/13 01:40:07 version 1.11, 2014/01/08 17:18:11
Line 151  Inputs: 2. Line 151  Inputs: 2.
     
 Takes incoming title and replaces non-alphanumeric characters with underscore,  Takes incoming title and replaces non-alphanumeric characters with underscore,
 so title can be used as suggested file name (with appended extension) for file  so title can be used as suggested file name (with appended extension) for file
 copied from course to Authoring space.  copied from course to Authoring Space.
   
   
 =item &enumerate_course_contents()  =item &enumerate_course_contents()
Line 162  map url, or symb, for an iteration throu Line 162  map url, or symb, for an iteration throu
 a Course Coordinator. Used to generate numerical IDs to facilitate  a Course Coordinator. Used to generate numerical IDs to facilitate
 (a) storage of lists of maps or resources to be blocked during an exam,  (a) storage of lists of maps or resources to be blocked during an exam,
 (b) processing selected form element during dumping of selected course  (b) processing selected form element during dumping of selected course
     content to Authoring space.      content to Authoring Space.
   
 Inputs: 7   Inputs: 7 
   
Line 245  sub create_picker { Line 245  sub create_picker {
     }      }
     if ($context eq 'dumpdocs') {      if ($context eq 'dumpdocs') {
         $info = '<span class="LC_fontsize_medium">'.          $info = '<span class="LC_fontsize_medium">'.
                 &mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring space.').                  &mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring Space.').
                 '</span><br /><br />';                  '</span><br /><br />';
         $startcount = 3 + $numhome;          $startcount = 3 + $numhome;
         $onsubmit = ' onsubmit="return checkUnique(document.'.$formname.',document.'.$formname.'.archive);"';          $onsubmit = ' onsubmit="return checkUnique(document.'.$formname.',document.'.$formname.'.archive);"';
Line 466  sub create_picker { Line 466  sub create_picker {
     $display .= '</form>';      $display .= '</form>';
     my $scripttag =       my $scripttag = 
         &respicker_javascript($startcount,$numcount,$context,$formname,\%children,          &respicker_javascript($startcount,$numcount,$context,$formname,\%children,
                               \%hierarchy,\@checked_maps);                                \%hierarchy,\@checked_maps,$numhome);
     if ($context eq 'dumpdocs') {      if ($context eq 'dumpdocs') {
         return $scripttag.$display;           return $scripttag.$display; 
     }      }
Line 498  sub create_picker { Line 498  sub create_picker {
   
 sub respicker_javascript {  sub respicker_javascript {
     my ($startcount,$numitems,$context,$formname,$children,$hierarchy,      my ($startcount,$numitems,$context,$formname,$children,$hierarchy,
         $checked_maps) = @_;          $checked_maps,$numhome) = @_;
     return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH')      return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH')
                    && (ref($checked_maps) eq 'ARRAY'));                     && (ref($checked_maps) eq 'ARRAY'));
     my ($elem,$nested,$nameforelem);      my ($elem,$nested,$nameforelem);
Line 591  EXTRA Line 591  EXTRA
     } elsif ($context eq 'dumpdocs') {      } elsif ($context eq 'dumpdocs') {
         my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.');          my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.');
         my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.');          my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.');
           my $homemsg = &mt('An Authoring Space needs to be selected.');
         $scripttag .= <<"EXTRA";          $scripttag .= <<"EXTRA";
   
 function checkUnique(form,field) {  function checkUnique(form,field) {
     var duplicate = 0;      var duplicate = 0;
     var blank = 0;      var blank = 0;
       var numhome = '$numhome';
     if (field.length > 0) {      if (field.length > 0) {
         for (i=0; i<field.length; i++) {          for (i=0; i<field.length; i++) {
             if (field[i].checked) {              if (field[i].checked) {
Line 635  function checkUnique(form,field) { Line 637  function checkUnique(form,field) {
         alert('$dupmsg');          alert('$dupmsg');
         return false;          return false;
     }      }
       if (numhome > 1) {
           if (!form.authorspace.options[form.authorspace.selectedIndex].value) {
               alert('$homemsg');
               return false;
           }
       }
     return true;      return true;
 }  }
   
Line 730  sub get_navmap_object { Line 738  sub get_navmap_object {
                                                        undef,{'only_body' => 1,}).                                                         undef,{'only_body' => 1,}).
                       '<h2>'.&mt('Resource Display Failed').'</h2>';                          '<h2>'.&mt('Resource Display Failed').'</h2>';  
         } elsif ($context eq 'dumpdocs') {          } elsif ($context eq 'dumpdocs') {
             $outcome = '<h2>'.&mt('Copying to Authoring Space unavilable');              $outcome = '<h2>'.&mt('Copying to Authoring Space unavailable');
         }          }
         $outcome .= '<div class="LC_error">';          $outcome .= '<div class="LC_error">';
         if ($crstype eq 'Community') {          if ($crstype eq 'Community') {

Removed from v.1.8  
changed lines
  Added in v.1.11


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