Diff for /loncom/interface/loncourserespicker.pm between versions 1.16 and 1.20

version 1.16, 2024/04/16 15:35:23 version 1.20, 2024/12/20 12:25:13
Line 33  loncourserespicker - Utilities to choose Line 33  loncourserespicker - Utilities to choose
   
 =head1 SYNOPSIS  =head1 SYNOPSIS
   
 loncourserespicker provides an interface for selecting which folders and/or  loncourserespicker provides either (1) an interface for selecting which 
 resources are to be either:  folders and/or resources are to be selected for a specific action, one of: 
   
 (a) exported to an IMS Content Package  (a) export to an IMS Content Package
 (b) subject to access blocking for the duriation of an exam/quiz.  (b) be subject to access blocking for the duration of an exam/quiz.
 (c) dumped to an Authoring Space  (c) dump to an Authoring Space
 (d) receive shortened URLs to be used when deep-linking into a course  (d) receive shortened URLs to be used when deep-linking into a course
   
   or (2) an interface for selecting a single folder or resource for which 
   existing passback credentials can be used to send scores to another Course
   Management System (CMS).
   
 =head1 DESCRIPTION  =head1 DESCRIPTION
   
 This module provides routines to generate a hierarchical display of folders  This module provides routines to generate a hierarchical display of folders
 and resources in a course which can be selected for specific actions.  and resources in a course which can be selected for specific actions. In 
   all except one use case all items in the course are shown. The case where
 The choice of items is copied back to the main window from which the pop-up  only a filtered list is shown is passback of scores, and filtering limits
 window used to display the Course Contents was opened.  folders and resources to those items for which passback credentials exist,
   (and their parent folders).
   
   When the display is shown in a pop-up window, The choice of items will be
   copied back to the main window from which the pop-up window used to display
   the Course Contents was opened.
   
 =head1 OVERVIEW  =head1 OVERVIEW
   
 The main subroutine: &create_picker() will display the hierarchy of folders,  In the cases where multiple items may be selected the main subroutine:
 sub-folders, and resources in the Main Content area.  Items can be selected  &create_picker() will display the hierarchy of folders, sub-folders, and
 using checkboxes, and/or a "Check All" button.  Selection of a folder  resources in the Main Content area. Items can be selected using checkboxes,
 causes the contents of the folder to also be selected automatically. The  and/or a "Check All" button.  Selection of a folder causes the contents of
 propagation of check status is recursive into sub-folders.  Likewise, if an  the folder to also be selected automatically. The propagation of check
 item deep in a nested set of folders and sub-folders is unchecked, the   status is recursive into sub-folders.  Likewise, if an item deep in a nested
 uncheck will propagate up through the hierarchy causing any folders at  set of folders  and sub-folders is unchecked, the uncheck will propagate up
 a higher level to become unchecked.  through the hierarchy causing any folders at a higher level to become
   unchecked.
   
   In the case where only a single item may be selected the main subroutine:
   &create_picker() will display the hierarchy of folders and sub-folders for
   only those items for which passback credentials exist,
   
 There is a submit button, which will be named differently according to the   There is a submit button, which will be named differently according to the 
 context in which resource/folder selection is being made.  context in which resource/folder selection is being made.
   
 The three contexts currently supported are: IMS export, selection of  The five contexts currently supported are: IMS export, selection of
 content to be subject to access restructions for the duration of an  content to be subject to access restructions for the duration of an
 exam, and selection of items for dumping to an Authoring Space.  exam, selection of items for dumping to an Authoring Space, display or 
   creation of shortened URLs for deep-linking, and selection of a single
   item for apssback of grades to another CMS.
   
 =head1 INTERNAL SUBROUTINES  =head1 INTERNAL SUBROUTINES
   
 =item &create_picker()  =item &create_picker()
   
 Created HTML mark up to display contents of course with checkboxes to  In the cases where multiple items may be selected ...
   
   Creates HTML markup to display contents of course with checkboxes to
 select items.  Checking a folder causes recursive checking of items  select items.  Checking a folder causes recursive checking of items
 within the folder. Unchecking a resource causing unchecking of folders  within the folder. Unchecking a resource causing unchecking of folders
 containing the item back up to the top level.  containing the item back up to the top level.
   
 Inputs: 11.  In the case where only a single item may be selected ...
   
   Creates HTML markup to display filtered contents of course with radio
   buttons to select an item.
   
   Inputs: 13.
    - $navmap  -- Reference to LON-CAPA navmap object      - $navmap  -- Reference to LON-CAPA navmap object 
                 (encapsulates information about resources in the course).                   (encapsulates information about resources in the course). 
   
Line 112  Inputs: 11. Line 135  Inputs: 11.
    - $tiny -- Reference to hash: keys are symbs of course items for which     - $tiny -- Reference to hash: keys are symbs of course items for which
               shortened URLs have already been created.                shortened URLs have already been created.
   
      - $passback -- Reference to hash: keys are symbs of course items for
                     which passback credentials exist. For each symb the
                     hash value is itself a hash of deeplink launch items
                     for that symb with inner hash key set to: 
                     $linkuri\0$linkprotector\0$scope, and corresponding 
                     value of 1.
   
    - $readonly -- if true, no "check all" or "uncheck all" buttons will     - $readonly -- if true, no "check all" or "uncheck all" buttons will
                   be displayed, and checkboxes will be disabled, if this                     be displayed, and checkboxes will be disabled, if this 
                   is for an exam block or for shortened URL creation.                    is for an exam block or for shortened URL creation,
                     and radio buttons will be disabled, if this is for
                     passback of scores to another CMS, 
   
   
 Output: $output is the HTML mark-up for display/selection of content  Output: $output is the HTML mark-up for display/selection of content
         items in the pop-up window.          items, either in a pop-up window, or in the main window, 
           depending on context.
   
 =item &respicker_javascript()  =item &respicker_javascript()
   
 Creates javascript functions for checking/unchecking all items, and  Creates javascript functions for checking/unchecking all items, and
 for recursive checking triggered by checking a folder, or recursive  for recursive checking triggered by checking a folder, or recursive
 (upeards) unchecking of an item within a folder.   (upwards) unchecking of an item within a folder. 
   
 Inputs: 7.   Inputs: 9.
    - $startcount -- Starting offset of form element numbering for items       - $startcount -- Starting offset of form element numbering for items  
   
    - $numcount -- Total numer of folders and resources in course.     - $numcount -- Total number of folders and resources in course.
   
    - $context -- Context in which resources are being displayed     - $context -- Context in which resources are being displayed
                  (imsexport, examblock or dumpdocs).                    (imsexport, examblock, dumpdocs, shorturls, or
                     crsauthored). 
   
    - $formname --  Name of form.     - $formname --  Name of form.
   
Line 142  Inputs: 7. Line 176  Inputs: 7.
   
    - $checked_maps -- Reference to array of folders currently checked.     - $checked_maps -- Reference to array of folders currently checked.
   
      - $numhome -- Number of possible Authoring Spaces on this server 
                    (context is dumpdocs or crsauthored).
    
      - $chkname -- Name of checkboxes used to indicate selection of folder
                    or resource.
   
 Output: 1. Javascript (within <script></script> tags.  Output: 1. Javascript (within <script></script> tags.
   
   
Line 153  no object instantiated. Line 193  no object instantiated.
 Inputs: 2.  Inputs: 2.
    - $crstype -- Container type: Course or Community     - $crstype -- Container type: Course or Community
   
    - $context -- Context: imsexport, examblock or dumpdocs     - $context -- Context: imsexport, examblock, dumpdocs, shorturls
                             or passback.
   
   
 =item &clean()  =item &clean()
Line 170  a course, where keys are numbers (starti Line 211  a course, where keys are numbers (starti
 map url, or symb, for an iteration through the course, as seen by  map url, or symb, for an iteration through the course, as seen by
 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 elements during dumping of selected course
     content to Authoring Space.      content to Authoring Space.
   (c) processing of checked checkboxes for creation of shortened URLs for
       deep-linking to course content.
   
 Inputs: 7   Inputs: 7 
   
Line 185  Inputs: 7 Line 228  Inputs: 7
       $title_ref - reference to hash containing titles for items in        $title_ref - reference to hash containing titles for items in
                    course                     course
   
       $context - examblock or dumpdocs        $context - examblock, dumpdocs or shorturls
   
       $cdom - course's domain        $cdom - course's domain
   
       $cnum - courseID         $cnum - courseID
   
 Outputs: None  Outputs: None
   
Line 216  use LONCAPA qw(:DEFAULT :match); Line 259  use LONCAPA qw(:DEFAULT :match);
   
 sub create_picker {  sub create_picker {
     my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,      my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,
         $numhome,$uploadedfiles,$tiny,$readonly) = @_;          $numhome,$uploadedfiles,$tiny,$passback,$readonly) = @_;
     return unless (ref($navmap));      return unless (ref($navmap));
     my ($it,$output,$numdisc,%discussiontime,%currmaps,%currresources,%files,      my ($it,$output,$numdisc,%discussiontime,%currmaps,%currresources,%files,
         %shorturls,$chkname);          %shorturls,%shownmaps,%shownsymbs,%recursed,%retrieved,%pb,$chkname);
     $chkname = 'archive';      $chkname = 'archive';
     if ($context eq 'shorturls') {      if ($context eq 'shorturls') {
         $chkname = 'addtiny';          $chkname = 'addtiny';
       } elsif ($context eq 'passback') {
           $chkname = 'passback';
     }      }
     $it = $navmap->getIterator(undef,undef,undef,1,undef,undef);      $it = $navmap->getIterator(undef,undef,undef,1,undef,undef);
     if (ref($blockedmaps) eq 'HASH') {      if (ref($blockedmaps) eq 'HASH') {
Line 234  sub create_picker { Line 279  sub create_picker {
         %files = %{$uploadedfiles};          %files = %{$uploadedfiles};
     } elsif (ref($tiny) eq 'HASH') {      } elsif (ref($tiny) eq 'HASH') {
         %shorturls = %{$tiny};           %shorturls = %{$tiny}; 
       } elsif ($context eq 'passback') {
           if (ref($passback) eq 'HASH') {
               %pb = %{$passback};
               foreach my $symb (keys(%pb)) {
                   my ($map,$id,$url) = &Apache::lonnet::decode_symb($symb);
                   my @recurseup;
                   if ($url =~ /\.(page|sequence)$/) {
                       @recurseup = $navmap->recurseup_maps($url);
                       $shownmaps{&Apache::lonnet::clutter($url)} = 1;
                       if (ref($pb{$symb}) eq 'HASH') {
                           foreach my $entry (keys(%{$pb{$symb}})) {
                               my $scope = (split("\0",$entry))[-1];
                               if (($scope eq 'map') || ($scope eq 'rec')) {
                                   my @contents;
                                   if ($scope eq 'map') {
                                       unless ($retrieved{$url} || $recursed{$url}) {
                                           @contents = $navmap->retrieveResources($url,sub { $_[0]->is_gradable() },0);
                                           $retrieved{$url} = 1;
                                       }
                                   } elsif ($scope eq 'rec') {
                                       unless ($recursed{$url}) {
                                           @contents = $navmap->retrieveResources($url,sub { $_[0]->is_gradable() },1,0,1);
                                           my @subfolders = $navmap->retrieveResources($url,sub { $_[0]->is_map() },1,0,1);
                                           if (@subfolders) {
                                               map { $shownmaps{$_->src()} = 1; } @subfolders;
                                           }
                                           $recursed{$url} = 1;
                                       }
                                   }
                                   if (@contents) {
                                       map { $shownsymbs{$_->symb()} = 1; } @contents;
                                   }
                               }
                           }
                       }
                   } else {
                       @recurseup = $navmap->recurseup_maps($map);
                       $shownmaps{&Apache::lonnet::clutter($map)} = 1;
                       $shownsymbs{$symb} = 1;
                   }
                   if (@recurseup) {
                       map { $shownmaps{&Apache::lonnet::clutter($_)} = 1; } @recurseup;
                   }
               }
           }
     }      }
     my @checked_maps;      my @checked_maps;
     my $curRes;      my $curRes;
Line 253  sub create_picker { Line 343  sub create_picker {
     my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};      my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $crsprefix = &propath($cdom,$cnum).'/userfiles/';      my $crsprefix = &propath($cdom,$cnum).'/userfiles/';
   
     my ($info,$display,$onsubmit,$togglebuttons,$disabled);      my ($info,$display,$onsubmit,$togglebuttons,$disabled,$action);
     if ($context eq 'examblock') {      if ($context eq 'examblock') {
         my $maps_elem = 'docs_maps_'.$block;          my $maps_elem = 'docs_maps_'.$block;
         my $res_elem = 'docs_resources_'.$block;          my $res_elem = 'docs_resources_'.$block;
Line 276  sub create_picker { Line 366  sub create_picker {
     } elsif ($context eq 'imsexport') {      } elsif ($context eq 'imsexport') {
         $info = &mt('Choose which items you wish to export from your '.$crstype.'.');          $info = &mt('Choose which items you wish to export from your '.$crstype.'.');
         $startcount = 5;          $startcount = 5;
       } elsif ($context eq 'passback') {
           $action = '/adm/grades';
           $info = '<p>'.
                   &mt('Select link-protected launch item for which scores should be sent to launcher CMS, then push Next [_1].',
                       '&rarr;').
                   '</p><br />';
           if ($readonly) {
               $disabled = ' disabled="disabled"';
           }
     }      }
     if ($disabled) {      if ($disabled) {
         $togglebuttons = '<br />';          $togglebuttons = '<br />';
     } else {      } elsif ($context ne 'passback') {
         $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.          $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.
                          'onclick="javascript:checkAll(document.'.$formname.'.'.$chkname.')" />'.                           'onclick="javascript:checkAll(document.'.$formname.'.'.$chkname.')" />'.
                          '&nbsp;&nbsp;<input type="button" value="'.&mt('uncheck all').'"'.                           '&nbsp;&nbsp;<input type="button" value="'.&mt('uncheck all').'"'.
                          ' onclick="javascript:uncheckAll(document.'.$formname.'.'.$chkname.')" />';                           ' onclick="javascript:uncheckAll(document.'.$formname.'.'.$chkname.')" />';
     }      }
     $display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n";      $display = '<form name="'.$formname.'" action="'.$action.'" method="post"'.$onsubmit.'>'."\n";
     if ($context eq 'imsexport') {      if ($context eq 'imsexport') {
         $display .= $info.          $display .= $info.
                     '<div class="LC_columnSection">'."\n".                      '<div class="LC_columnSection">'."\n".
Line 306  sub create_picker { Line 405  sub create_picker {
                 '</fieldset>';                  '</fieldset>';
         }          }
         $display .= '</div>';          $display .= '</div>';
     } elsif (($context eq 'examblock') || ($context eq 'shorturls')) {      } elsif (($context eq 'examblock') || ($context eq 'shorturls') || ($context eq 'passback')) {
         $display .= $info.$togglebuttons;          $display .= $info.$togglebuttons;
     } elsif ($context eq 'dumpdocs') {      } elsif ($context eq 'dumpdocs') {
         $display .= $preamble.          $display .= $preamble.
Line 333  sub create_picker { Line 432  sub create_picker {
     } elsif ($context eq 'shorturls') {      } elsif ($context eq 'shorturls') {
         $display .= '<th colspan="2">'.&mt('Tiny URL').'</th>'.          $display .= '<th colspan="2">'.&mt('Tiny URL').'</th>'.
                     '<th>'.&mt("Title in $crstype").'</th>';                      '<th>'.&mt("Title in $crstype").'</th>';
       } elsif ($context eq 'passback') {
           $display .= '<th>'.&mt("Title in $crstype").'</th>'.
                       '<th>'.&mt('Tiny URL Deep-link').'</th>'.
                       '<th>'.&mt('Launcher').'</th>'.
                       '<th  style="padding-left: 6px; padding-right: 6px">'.&mt('Score Type').'</th>'.
                       '<th style="padding-left: 6px; padding-right: 6px">'.&mt('Select').'</th>';
     }      }
     $display .= &Apache::loncommon::end_data_table_header_row();      $display .= &Apache::loncommon::end_data_table_header_row();
     while ($curRes = $it->next()) {      while ($curRes = $it->next()) {
Line 358  sub create_picker { Line 463  sub create_picker {
                 }                  }
             }              }
             $count ++;              $count ++;
             my ($currelem,$mapurl,$is_map);              my ($currelem,$mapurl,$is_map,$showitem);
             if ($context eq 'imsexport') {              if ($context eq 'imsexport') {
                 $currelem = $count+$boards+$startcount;                  $currelem = $count+$boards+$startcount;
             } else {              } else {
                 $currelem = $count+$startcount;                  $currelem = $count+$startcount;
             }              }
             $display .= &Apache::loncommon::start_data_table_row()."\n";  
             if (($curRes->is_sequence()) || ($curRes->is_page())) {              if (($curRes->is_sequence()) || ($curRes->is_page())) {
                 $lastcontainer = $currelem;                  $lastcontainer = $currelem;
                 $mapurl = (&Apache::lonnet::decode_symb($symb))[2];                  $mapurl = (&Apache::lonnet::decode_symb($symb))[2];
                 $is_map = 1;                  $is_map = 1;
             }              }
               if ($context eq 'passback') {
                   if (($curRes->is_sequence()) || ($curRes->is_page())) {
                       next unless ($shownmaps{$curRes->src});
                   } else {
                       next unless ($shownsymbs{$symb});
                   }
               } else {
                   $display .= &Apache::loncommon::start_data_table_row()."\n";
               }
             if ($context eq 'shorturls') {              if ($context eq 'shorturls') {
                 if ($shorturls{$symb}) {                  if ($shorturls{$symb}) {
                     $display .= '<td>&nbsp;</td><td align="right"><b>'."/tiny/$cdom/$shorturls{$symb}".'</b></td>'."\n";                      $display .= '<td>&nbsp;</td><td align="right"><b>'."/tiny/$cdom/$shorturls{$symb}".'</b></td>'."\n";
Line 378  sub create_picker { Line 491  sub create_picker {
                                 'value="'.$count.'"'.$disabled.' />'.&mt('Add').'</label></td>'.                                  'value="'.$count.'"'.$disabled.' />'.&mt('Add').'</label></td>'.
                                 '<td>&nbsp;</td>'."\n";                                  '<td>&nbsp;</td>'."\n";
                 }                  }
             } else {              } elsif ($context ne 'passback') {
                 $display .= '<td><input type="checkbox" name="'.$chkname.'" value="'.$count.'" ';                  $display .= '<td><input type="checkbox" name="'.$chkname.'" value="'.$count.'" ';
                 if ($is_map) {                  if ($is_map) {
                     $display .= 'onclick="javascript:checkFolder(document.'.$formname.','."'$currelem'".')" ';                      $display .= 'onclick="javascript:checkFolder(document.'.$formname.','."'$currelem'".')" ';
Line 388  sub create_picker { Line 501  sub create_picker {
                     }                      }
                 } else {                  } else {
                     if ($curRes->is_problem()) {                      if ($curRes->is_problem()) {
                        $numprobs ++;                          $numprobs ++;
                     }                      }
                     $display .= 'onclick="javascript:checkResource(document.'.$formname.','."'$currelem'".')" ';                      $display .= 'onclick="javascript:checkResource(document.'.$formname.','."'$currelem'".')" ';
                     if ($currresources{$symb}) {                      if ($currresources{$symb}) {
Line 403  sub create_picker { Line 516  sub create_picker {
                 $display .= '<td valign="top">';                  $display .= '<td valign="top">';
             }              }
             for (my $i=0; $i<$depth; $i++) {              for (my $i=0; $i<$depth; $i++) {
                 $display .= "$whitespace\n";                  $showitem .= "$whitespace\n";
             }              }
             my $icon = 'src="'.$location.'/unknown.gif" alt=""';              my $icon = 'src="'.$location.'/unknown.gif" alt=""';
             if ($curRes->is_sequence()) {              if ($curRes->is_sequence()) {
Line 417  sub create_picker { Line 530  sub create_picker {
             } elsif ($curRes->src ne '') {              } elsif ($curRes->src ne '') {
                 $icon = 'src="'.&Apache::loncommon::icon($curRes->src).'" alt=""';                  $icon = 'src="'.&Apache::loncommon::icon($curRes->src).'" alt=""';
             }              }
             $display .= '<img '.$icon.' />&nbsp;'."\n";              $showitem .= '<img '.$icon.' />&nbsp;'."\n";
             $children{$parent{$depth}} .= $currelem.':';              $children{$parent{$depth}} .= $currelem.':';
             if ($context eq 'examblock') {              if ($context eq 'examblock') {
                 if ($parent{$depth} > 1) {                  if ($parent{$depth} > 1) {
Line 428  sub create_picker { Line 541  sub create_picker {
                     }                      }
                 }                  }
             }              }
             $display .= '&nbsp;'.$curRes->title().$whitespace.'</td>'."\n";              $showitem .= '&nbsp;'.$curRes->title().$whitespace;
               if ($context eq 'passback') {
                   if ((exists($pb{$symb})) && (ref($pb{$symb}) eq 'HASH')) {
                       my $numlinks = scalar(keys(%{$pb{$symb}}));
                       my $count = 0;
                       foreach my $launcher (sort(keys(%{$pb{$symb}}))) {
                           if ($count == 0) {
                               $display .= &Apache::loncommon::start_data_table_row()."\n";
                               if ($numlinks > 1) {
                                   $display .= '<td rowspan="'.$numlinks.'">'.$showitem.'</td>';
                               } else {
                                   $display .= '<td style="vertical-align: baseline">'.$showitem.'</td>';
                               }
                           } else {
                               $display .= &Apache::loncommon::end_data_table_row().
                                           &Apache::loncommon::start_data_table_row()."\n";
                           }
                           my ($linkuri,$linkprotector,$scope) = split("\0",$launcher);
                           my ($ltinum,$ltitype) = ($linkprotector =~ /^(\d+)(c|d)$/);
                           my ($appname,$setter);
                           if ($ltitype eq 'c') {
                               my %lti = &Apache::lonnet::get_course_lti($cnum,$cdom,'provider');
                               if (ref($lti{$ltinum}) eq 'HASH') {
                                   $appname = $lti{$ltinum}{'name'};
                                   if ($appname) {
                                       $setter = ' (defined in course)';
                                   }
                               }
                           } elsif ($ltitype eq 'd') {
                               my %lti = &Apache::lonnet::get_domain_lti($cdom,'linkprot');
                               if (ref($lti{$ltinum}) eq 'HASH') {
                                   $appname = $lti{$ltinum}{'name'};
                                   if ($appname) {
                                       $setter = ' (defined in domain)';
                                   }
                               }
                           }
                           my $shownscope;
                           if ($scope eq 'res') {
                               $shownscope = &mt('Resource');
                           } elsif ($scope eq 'map') {
                               $shownscope = &mt('Folder');
                           }  elsif ($scope eq 'rec') {
                               $shownscope = &mt('Folder + sub-folders');
                           }
                           $display .= '<td style="vertical-align: baseline"><span style="font-weight: bold;">'.$linkuri.'</span></td>'."\n".
                                       '<td style="vertical-align: baseline; padding-left: 6px; padding-right: 6px">'.$appname.$setter.'</td>'."\n".
                                       '<td style="vertical-align: baseline"><span style="font-style: italic;">'.$shownscope.'</span></td>'."\n".
                                       '<td align="right" style="vertical-align: baseline"><input type="radio" name="'.$chkname.'" '.
                                       'value="'.&escape($launcher).'"'.$disabled.' /></td>'."\n";
                           $count ++;
                       }
                   } else {
                       $display .= &Apache::loncommon::start_data_table_row()."\n".
                                   '<td colspan="5">'.$showitem.'</td>';
                   }
               } else {
                   $display .= $showitem.'</td>'."\n";
               }
             if ($context eq 'imsexport') {              if ($context eq 'imsexport') {
 # Existing discussion posts?  # Existing discussion posts?
                 if ($discussiontime{$ressymb} > 0) {                  if ($discussiontime{$ressymb} > 0) {
Line 516  sub create_picker { Line 686  sub create_picker {
                 '<input type="submit" name="shorturls" value="'.                  '<input type="submit" name="shorturls" value="'.
                 &mt('Create Tiny URL(s)').'" /></p>';                  &mt('Create Tiny URL(s)').'" /></p>';
         }          }
       } elsif ($context eq 'passback') {
           unless ($readonly) {
               $display .=
                   '<p>'.
                   '<input type="hidden" name="symb" value="'.&Apache::lonenc::check_encrypt($env{'form.symb'}).'" />'."\n".
                   '<input type="hidden" name="command" value="passback" />'.
                   '<input type="submit" name="picklauncher" value="'.
                   &mt('Next').' &rarr;" /></p>';
           }
     }      }
     $display .= '</form>';      $display .= '</form>';
     my $scripttag =       if ($context eq 'passback') {
           return $display;
       }
       my $scripttag =
         &respicker_javascript($startcount,$numcount,$context,$formname,\%children,          &respicker_javascript($startcount,$numcount,$context,$formname,\%children,
                               \%hierarchy,\@checked_maps,$numhome,$chkname);                                \%hierarchy,\@checked_maps,$numhome,$chkname);
     if (($context eq 'dumpdocs') || ($context eq 'shorturls')) {      if (($context eq 'dumpdocs') || ($context eq 'shorturls')) {
Line 830  sub get_navmap_object { Line 1012  sub get_navmap_object {
             $outcome .= '</a>';              $outcome .= '</a>';
             if ($context eq 'imsexport') {              if ($context eq 'imsexport') {
                 &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});                  &Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
             } else {              } elsif ($context eq 'dumpdocs') {
                 &Apache::lonnet::logthis('Copying to Authoring Space failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});                  &Apache::lonnet::logthis('Copying to Authoring Space failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
               } elsif ($context eq 'shorturls') {
                   &Apache::lonnet::logthis('Displaying and/or saving URL shortcuts failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'});
             }              }
         } elsif ($context eq 'examblock') {          } elsif ($context eq 'examblock') {
             $outcome .=  '<href="javascript:window.close();">'.&mt('Close window').'</a>';                       $outcome .=  '<href="javascript:window.close();">'.&mt('Close window').'</a>';         

Removed from v.1.16  
changed lines
  Added in v.1.20


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