Diff for /loncom/interface/londocs.pm between versions 1.722 and 1.723

version 1.722, 2025/01/07 21:01:37 version 1.723, 2025/02/03 22:52:36
Line 2526  sub print_paste_buffer { Line 2526  sub print_paste_buffer {
                     &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix});                      &LONCAPA::map::qtescape($env{'docs.markedcopy_title_'.$suffix});
             } else {              } else {
                 my $icon = &Apache::loncommon::icon($extension);                  my $icon = &Apache::loncommon::icon($extension);
                   my $icontext;
                   if ($extension eq 'sequence') {
                       $icontext = &mt('folder icon');
                   } elsif ($extension eq 'page') {
                       $icontext = &mt('composite page icon');
                   } else {
                       $icontext = &mt('file icon');
                   }
                   $icontext = &HTML::Entities::encode($icontext);
                 if ($extension eq 'sequence' &&                  if ($extension eq 'sequence' &&
                     $url =~ m{/default_\d+\.sequence$}x) {                      $url =~ m{/default_\d+\.sequence$}x) {
                     $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));                      $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
Line 2535  sub print_paste_buffer { Line 2544  sub print_paste_buffer {
                 if ($title eq '') {                  if ($title eq '') {
                     ($title) = ($url =~ m{/([^/]+)$});                      ($title) = ($url =~ m{/([^/]+)$});
                 }                  }
                 $buffer = '<img src="'.$icon.'" alt="" class="LC_icon" />'.                  $buffer = '<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" />'.
                           ': '.                            ': '.
                           &Apache::loncommon::parse_supplemental_title(                            &Apache::loncommon::parse_supplemental_title(
                              &LONCAPA::map::qtescape($title));                               &LONCAPA::map::qtescape($title));
Line 4971  sub editor { Line 4980  sub editor {
             if (!$allowed) {              if (!$allowed) {
                 $helpitem = 'Supplemental_Navigation';                  $helpitem = 'Supplemental_Navigation';
             }              }
             $toolslink = '<table><tr><td>'              $toolslink = '<div class="LC_navtools">'
                          .'<div class="LC_navtools">'
                        .&Apache::loncommon::help_open_menu('Navigation Screen',                         .&Apache::loncommon::help_open_menu('Navigation Screen',
                                                            $helpitem,undef,'RAT')                                                             $helpitem,undef,'RAT')
                        .'</td><td class="LC_middle">'.&mt('Tools:').'</td>'                         .'</div><div class="LC_navtools">'.&mt('Tools:').'</div>'
                        .'<td align="left"><ul id="LC_toolbar">'                         .'<div class="LC_navtools">'."\n".'<ul id="LC_toolbar">' 
                        .'<li><a href="/adm/coursedocs?forcesupplement=1&amp;command=editsupp" '                         .'<li><a href="/adm/coursedocs?forcesupplement=1&amp;command=editsupp" '
                        .'id="LC_content_toolbar_edittoplevel" '                         .'id="LC_content_toolbar_edittoplevel" '
                        .'class="LC_toolbarItem" '                         .'class="LC_toolbarItem" '
                        .'title="'.&mt('Supplemental Content Editor').'">'                         .'title="'.&mt('Supplemental Content Editor').'">'
                        .'</a></li></ul></td></tr></table><br />';                         .'</a></li></ul></div></div>'."\n"
                          .'<div style="padding:0;clear:both;margin:0;border:0"></div><br />'."\n";
         }          }
         if ($shown) {          if ($shown) {
             if ($allowed) {              if ($allowed) {
Line 5483  ENDCOPY Line 5494  ENDCOPY
     $copylink=(<<ENDCOPY);      $copylink=(<<ENDCOPY);
 <form name="$formname" method="post" action="/adm/coursedocs">  <form name="$formname" method="post" action="/adm/coursedocs">
 $form_common  $form_common
 <input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a>  <label><input type="checkbox" name="copy" id="copy_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','copy');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_copy">$lt{'cp'}</a></label>
 $form_end  $form_end
 ENDCOPY  ENDCOPY
             if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) {              if (($ishash) && (ref($filtersref->{'cancopy'}) eq 'ARRAY')) {
Line 5501  ENDCUT Line 5512  ENDCUT
 <form name="$formname" method="post" action="/adm/coursedocs">  <form name="$formname" method="post" action="/adm/coursedocs">
 $form_common  $form_common
 <input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" />  <input type="hidden" name="skip_$orderidx" id="skip_cut_$orderidx" value="$skip_confirm" />
 <input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a>  <label><input type="checkbox" name="cut" id="cut_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','cut');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_cut">$lt{'ct'}</a></label>
 $form_end  $form_end
 ENDCUT  ENDCUT
             if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) {              if (($ishash) && (ref($filtersref->{'cancut'}) eq 'ARRAY')) {
Line 5520  ENDREM Line 5531  ENDREM
 $form_common  $form_common
 <input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" />  <input type="hidden" name="skip_$orderidx" id="skip_remove_$orderidx" value="$skip_confirm" />
 <input type="hidden" name="confirm_rem_$orderidx" id="confirm_removal_$orderidx" value="$confirm_removal" />  <input type="hidden" name="confirm_rem_$orderidx" id="confirm_removal_$orderidx" value="$confirm_removal" />
 <input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a>  <label><input type="checkbox" name="remove" id="remove_$orderidx" value="$orderidx" onclick="javascript:singleCheck(this,'$orderidx','remove');" class="LC_hidden" $disabled /><a href="$js" class="LC_docs_remove">$lt{'rm'}</a></label>
 $form_end  $form_end
 ENDREM  ENDREM
             if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) {              if (($ishash) && (ref($filtersref->{'canremove'}) eq 'ARRAY')) {
Line 5565  $copylink Line 5576  $copylink
 </td>  </td>
 END  END
     }      }
       my $icontext;
 # Figure out what kind of a resource this is  # Figure out what kind of a resource this is
     my ($extension)=($url=~/\.(\w+)$/);      my ($extension)=($url=~/\.(\w+)$/);
       if ($extension eq 'sequence') {
           $icontext = &mt('folder icon');
       } elsif ($extension eq 'page') {
           $icontext = &mt('composite page icon');
       } else {
           $icontext = &mt('file icon');
       }
       $icontext = &HTML::Entities::encode($icontext);
     my $uploaded=($url=~/^\/*uploaded\//);      my $uploaded=($url=~/^\/*uploaded\//);
     my $icon=&Apache::loncommon::icon($url);      my $icon=&Apache::loncommon::icon($url);
     my $isfolder;      my $isfolder;
Line 5908  $form_end; Line 5928  $form_end;
             }              }
         }          }
         if ($nolink) {          if ($nolink) {
             $line .= '<img src="'.$icon.'" alt="" class="LC_icon" /></a>';              $line .= '<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" /></a>';
         } else {          } else {
             $line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>';              $line.='<a href="'.$url.'"><img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" /></a>';
         }          }
     } elsif ($url) {      } elsif ($url) {
        if ($anchor ne '') {         if ($anchor ne '') {
Line 5940  $form_end; Line 5960  $form_end;
            }             }
        }         }
        if ($nolink) {         if ($nolink) {
            $line.='<img src="'.$icon.'" alt="" class="LC_icon" />';             $line.='<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" />';
        } elsif ($nomodal) {         } elsif ($nomodal) {
            $line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'.             $line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'.
                   '<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>';                    '<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" border="0" /></a>';
        } else {         } else {
            $line.=&Apache::loncommon::modal_link($link,             $line.=&Apache::loncommon::modal_link($link,
                                                  '<img src="'.$icon.'" alt="" class="LC_icon" />',600,500);                                                   '<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" />',600,500);
        }         }
     } else {      } else {
        $line.='<img src="'.$icon.'" alt="" class="LC_icon" />';         $line.='<img src="'.$icon.'" alt="'.$icontext.'" class="LC_icon" />';
     }      }
     $line.='</span></td><td'.$tdwidth.'>';      $line.='</span></td><td'.$tdwidth.'>';
     if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {      if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
Line 7591  sub handler { Line 7611  sub handler {
     my $quotainfo = '<p>'.&mt('Currently using [_1] of the [_2] available.',      my $quotainfo = '<p>'.&mt('Currently using [_1] of the [_2] available.',
                               $percent.'%',$quota.' MB').'</p>';                                $percent.'%',$quota.' MB').'</p>';
   
  my $fileupload=(<<FIUP);  
         $quotainfo  
  $lt{'file'}:<br />  
 FIUP  
  my $checkbox=(<<CHBO);   my $checkbox=(<<CHBO);
  <!-- <label>$lt{'parse'}?   <!-- <label>$lt{'parse'}?
  <input type="checkbox" name="parserflag" />   <input type="checkbox" name="parserflag" />
Line 7613  CHBO Line 7629  CHBO
         <form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport">          <form name="uploadims" action="/adm/imsimportdocs" method="post" enctype="multipart/form-data" target="IMSimport">
         <fieldset id="uploadimsform" style="display: none;">          <fieldset id="uploadimsform" style="display: none;">
         <legend>$lt{'imsf'}</legend>          <legend>$lt{'imsf'}</legend>
         $fileupload          $quotainfo
         <input type="file" name="uploaddoc" id="uploaddocims" class="LC_flUpload LC_uploaddoc" size="40" $disabled />          <label>$lt{'file'}:<br />
           <input type="file" name="uploaddoc" id="uploaddocims" class="LC_flUpload LC_uploaddoc" size="40" $disabled /></label>
         <input type="hidden" id="LC_free_space_ims" value="$free_space" />          <input type="hidden" id="LC_free_space_ims" value="$free_space" />
         <br />          <br />
         <p>          <p>
Line 7641  IMSFORM Line 7658  IMSFORM
         <fieldset id="uploaddocform" style="display: none;">          <fieldset id="uploaddocform" style="display: none;">
         <legend>$lt{'upfi'}</legend>          <legend>$lt{'upfi'}</legend>
  <input type="hidden" name="active" value="aa" />   <input type="hidden" name="active" value="aa" />
     $fileupload          $quotainfo
         <input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled />          <label>$lt{'file'}:<br />
           <input type="file" name="uploaddoc" class="LC_flUpload" size="40" $disabled /></label>
         <input type="hidden" id="LC_free_space" value="$free_space" />          <input type="hidden" id="LC_free_space" value="$free_space" />
  <br />   <br />
           <label>
  $lt{'title'}:<br />   $lt{'title'}:<br />
  <input type="text" size="60" name="comment" $disabled />   <input type="text" size="60" name="comment" $disabled /></label>
  $pathitem   $pathitem
  <input type="hidden" name="cmd" value="upload_default" />   <input type="hidden" name="cmd" value="upload_default" />
  <br />   <br />
Line 7672  FUFORM Line 7691  FUFORM
         <fieldset id="importmapform" style="display: none;">          <fieldset id="importmapform" style="display: none;">
         <legend>$lt{'impm'}</legend>          <legend>$lt{'impm'}</legend>
  <input type="hidden" name="active" value="bb" />   <input type="hidden" name="active" value="bb" />
         $lt{'copm'}<br />          <label>$lt{'copm'}<br />
         <span class="LC_nobreak">          <span class="LC_nobreak">
         <input type="text" name="importmap" size="40" value=""           <input type="text" name="importmap" size="40" value="" 
         onfocus="this.blur();$mapimportjs" $disabled />          onfocus="this.blur();$mapimportjs" $disabled />
         &nbsp;<a href="$mapimportjs">$lt{'selm'}</a></span><br />          &nbsp;<a href="$mapimportjs">$lt{'selm'}</a></span></label><br />
         <input type="submit" name="loadmap" value="$lt{'load'}" $disabled />          <input type="submit" name="loadmap" value="$lt{'load'}" $disabled />
         </fieldset>          </fieldset>
         </form>          </form>
Line 7717  SEDFFORM Line 7736  SEDFFORM
         <div id="importcrsrescontent" style="display: none;">          <div id="importcrsrescontent" style="display: none;">
         <input type="hidden" name="active" value="bb" />          <input type="hidden" name="active" value="bb" />
         $pickfile          $pickfile
         <p>          <p><label>
         $lt{'title'}: <input type="text" name="crsrestitle" value="" $disabled />          $lt{'title'}: <input type="text" name="crsrestitle" value="" $disabled />
         </p>          </label></p>
         <input type="hidden" name="importdetail" value="" />          <input type="hidden" name="importdetail" value="" />
         <input type="submit" name="crsres" value="$lt{'impo'}" $disabled /><br />          <input type="submit" name="crsres" value="$lt{'impo'}" $disabled /><br />
         </div>          </div>
Line 7982  NWEBFORM Line 8001  NWEBFORM
             $is_home{'course'} = 1;              $is_home{'course'} = 1;
         }          }
         $rolehomes .= '<input type="hidden" id="rolehome_course" name="rolehome_course" value="'.$crshome.'" />'."\n";          $rolehomes .= '<input type="hidden" id="rolehome_course" name="rolehome_course" value="'.$crshome.'" />'."\n";
         my $pickdir = $lt{'loca'}.          my $pickdir = '<label>'.$lt{'loca'}.
                    '<select name="authorrole" onchange="populateDirSelects(this.form,'."'authorrole','authorpath'".',1,1,0);">'."\n".                     '<select name="authorrole" onchange="populateDirSelects(this.form,'."'authorrole','authorpath'".',1,1,0);">'."\n".
                    '<option value="" selected="selected">'.&mt('Select').'</option>'."\n";                     '<option value="" selected="selected">'.&mt('Select').'</option>'."\n";
         if ($env{'user.author'}) {          if ($env{'user.author'}) {
Line 8003  NWEBFORM Line 8022  NWEBFORM
         if ($checkcrsres) {          if ($checkcrsres) {
             $pickdir .= '<option value="course">'.&mt('Course Resource').'</option>'."\n";              $pickdir .= '<option value="course">'.&mt('Course Resource').'</option>'."\n";
         }          }
         $pickdir .= '</select><br />'."\n".          $pickdir .= '</select></label><br />'."\n".
                     $lt{'dire'}.                      '<label>'.$lt{'dire'}.
                     '<select name="authorpath" onchange="toggleCrsResTitle();">'.                      '<select name="authorpath" onchange="toggleCrsResTitle();">'.
                     '<option value=""></option>'.                      '<option value=""></option>'.
                     '</select><br />'."\n";                      '</select></label><br />'."\n";
         my %seltemplate_menus;          my %seltemplate_menus;
         my @files = &Apache::lonhomework::get_template_list('problem');          my @files = &Apache::lonhomework::get_template_list('problem');
         my @noexamplelink = ('blank.problem','blank.library','script.library');          my @noexamplelink = ('blank.problem','blank.library','script.library');
Line 8040  NWEBFORM Line 8059  NWEBFORM
             }              }
         }          }
   
         my $templates = $lt{'cate'}.' '.          my ($templates,$haslabel);
                         &Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'tmpl'}.' ',          if ($lt{'cate'} ne '') {
                                                                 $defcategory,'tempcategory','template',              $templates = '<label>';
                                                                 \%seltemplate_menus,\@catorder,              $haslabel = 1;
                                                                 "resize_scrollbox('contentscroll','1','0');",          }
                                                                 "toggleExampleText();",'template').'<br />';          $templates .= $lt{'cate'}.' '.
                         &Apache::loncommon::linked_select_forms('courseresform','<br />'.$lt{'tmpl'}.' ',
                                                                 $defcategory,'tempcategory','template',
                                                                 \%seltemplate_menus,\@catorder,
                                                                 "resize_scrollbox('contentscroll','1','0');",
                                                                 "toggleExampleText();",'template',$haslabel).'<br />';
         my $templatepreview =  '<a href="#" target="sample" onclick="javascript:getExample(600,420,\'yes\',true);  return false;">'.          my $templatepreview =  '<a href="#" target="sample" onclick="javascript:getExample(600,420,\'yes\',true);  return false;">'.
                                '<span id="newresexample">'.&mt('Example').'</span></a>';                                 '<span id="newresexample">'.&mt('Example').'</span></a>';
         my $crsresform;          my $crsresform;
Line 8066  NWEBFORM Line 8090  NWEBFORM
         <label><input type="radio" name="newsubdir" value="0" onclick="toggleNewsubdir(this.form);" checked="checked" $disabled />No</label>          <label><input type="radio" name="newsubdir" value="0" onclick="toggleNewsubdir(this.form);" checked="checked" $disabled />No</label>
         &nbsp;          &nbsp;
         <label><input type="radio" name="newsubdir" value="1" onclick="toggleNewsubdir(this.form);" $disabled />Yes</label>          <label><input type="radio" name="newsubdir" value="1" onclick="toggleNewsubdir(this.form);" $disabled />Yes</label>
         </span><span id="newsubdir"></span>          </span><label for="newsubdirname"><span id="newsubdir"></span></label>
         <input type="hidden" name="newsubdirname" id="newsubdirname" value="" autocomplete="off" />          <input type="hidden" name="newsubdirname" id="newsubdirname" value="" autocomplete="off" />
         </p>          </p>
         </div>          </div>
         $lt{'fnam'}          <label>$lt{'fnam'}
         <input type="text" size="20" name="newresourcename" autocomplete="off" $disabled />          <input type="text" size="20" name="newresourcename" autocomplete="off" $disabled /></label>
         <div id="newresource" style="display:none">          <div id="newresource" style="display:none">
         <p>          <p>
         $lt{'addp'}          $lt{'addp'}
Line 8079  NWEBFORM Line 8103  NWEBFORM
         $lt{'no'}</label>&nbsp;&nbsp;          $lt{'no'}</label>&nbsp;&nbsp;
         <label><input type="radio" name="newresourceadd" value="1" onclick="toggleNewInCourse(this.form);" $disabled />          <label><input type="radio" name="newresourceadd" value="1" onclick="toggleNewInCourse(this.form);" $disabled />
         $lt{'yes'}</label>          $lt{'yes'}</label>
         <span id="newrestitle"></span>          <label for="newresourcetitle"><span id="newrestitle"></span></label>
         <input type="hidden" size="20" name="newresourcetitle" id="newresourcetitle" autocomplete="off" $disabled />          <input type="hidden" size="20" name="newresourcetitle" id="newresourcetitle" autocomplete="off" $disabled />
         </p>          </p>
         </div>          </div>
Line 8274  unless ($container eq 'page') { Line 8298  unless ($container eq 'page') {
         <fieldset id="uploadsuppdocform" style="display: none;">          <fieldset id="uploadsuppdocform" style="display: none;">
         <legend>$lt{'upfi'}</legend>          <legend>$lt{'upfi'}</legend>
  <input type="hidden" name="active" value="ee" />   <input type="hidden" name="active" value="ee" />
  $fileupload   $quotainfo
         <input type="file" name="uploaddoc" id="uploaddocsupp" class="LC_flUpload LC_uploaddoc" size="40" $disabled />          <label>$lt{'file'}:<br />
           <input type="file" name="uploaddoc" id="uploaddocsupp" class="LC_flUpload LC_uploaddoc" size="40" $disabled /></label>
         <input type="hidden" id="LC_free_space_supp" value="$free_space" />          <input type="hidden" id="LC_free_space_supp" value="$free_space" />
  <br />   <br />
  <br />   <br />
Line 8283  unless ($container eq 'page') { Line 8308  unless ($container eq 'page') {
  $checkbox   $checkbox
  </span>   </span>
  <br /><br />   <br /><br />
  $lt{'comment'}:<br />   <label>$lt{'comment'}:<br />
  <textarea cols="50" rows="4" name="comment"></textarea>   <textarea cols="50" rows="4" name="comment"></textarea></label>
  <br />   <br />
  $pathitem   $pathitem
  <input type="hidden" name="cmd" value="upload_supplemental" />   <input type="hidden" name="cmd" value="upload_supplemental" />

Removed from v.1.722  
changed lines
  Added in v.1.723


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