Diff for /loncom/interface/londocs.pm between versions 1.370 and 1.377

version 1.370, 2009/06/08 18:04:45 version 1.377, 2009/07/10 17:05:05
Line 262  sub dumpcourse { Line 262  sub dumpcourse {
   
 sub exportbutton {  sub exportbutton {
     my $type = &Apache::loncommon::course_type();      my $type = &Apache::loncommon::course_type();
     return '<input type="submit" name="exportcourse" value="'.      return '<input type="submit" name="exportcourse"'
             &mt('Export '.$type.' to IMS').'" />'.            .' value="'.&mt('IMS Export').'"'
             .' title="'.&mt('Export '.$type.' to IMS Package').'" />'.
     &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />';      &Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />';
 }  }
   
Line 277  sub exportcourse { Line 278  sub exportcourse {
     my $numdisc = keys(%discussiontime);      my $numdisc = keys(%discussiontime);
     my $navmap = Apache::lonnavmaps::navmap->new();      my $navmap = Apache::lonnavmaps::navmap->new();
     if (!defined($navmap)) {      if (!defined($navmap)) {
         $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package').          $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package').
                   '<h2>IMS Export Failed</h2>'.                    '<h2>'.&mt('IMS Export Failed').'</h2>'.
                   '<div class="LC_error">'.                    '<div class="LC_error">'.
                   &mt('Unable to retrieve information about course contents').                    &mt('Unable to retrieve information about course contents').
                   '</div><a href="/adm/coursedocs">'.&mt('Return to Course Editor').'</a>');                    '</div><a href="/adm/coursedocs">'.&mt('Return to Course Editor').'</a>');
Line 298  sub exportcourse { Line 299  sub exportcourse {
         my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');          my @exportitems = &Apache::loncommon::get_env_multiple('form.archive');
         my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');          my @discussions = &Apache::loncommon::get_env_multiple('form.discussion');
         if (@exportitems == 0 && @discussions == 0) {          if (@exportitems == 0 && @discussions == 0) {
             $outcome = '<br />As you did not select any content items or discussions for export, an IMS package has not been created.  Please <a href="javascript:history.go(-1)">go back</a> to select either content items or discussions for export';              $outcome = 
                   '<p class="LC_warning">'
                  .&mt('As you did not select any content items or discussions'
                      .' for export, an IMS package has not been created.')
                  .'</p>'
                  .'<p>'
                  .&mt('Please [_1]go back[_2] to select either content items'
                      .' or discussions for export.'
                          ,'<a href="javascript:history.go(-1)">'
                          ,'</a>')
                  .'</p>';
         } else {          } else {
             my $now = time;              my $now = time;
             my %symbs;              my %symbs;
Line 321  sub exportcourse { Line 332  sub exportcourse {
                 open(OUTPUT, "zip -r $imszip *  2> /dev/null |");                  open(OUTPUT, "zip -r $imszip *  2> /dev/null |");
                 close(OUTPUT);                  close(OUTPUT);
                 chdir $cwd;                  chdir $cwd;
                 $outcome .= '<p>'  
                            .&mt('Download the zip file from [_1]IMS '.lc($type).' archive[_2]'  
                                ,'<a href="'.$imszipfile.'">','</a>')  
                            .'</p>';  
                 if ($copyresult) {                  if ($copyresult) {
                     $outcome .= '<p class="LC_error">'                      $outcome .= '<p class="LC_error">'
                                .&mt('The following errors occurred during export - [_1]'                                 .&mt('The following errors occurred during export - [_1]'
                                    ,$copyresult)                                     ,$copyresult)
                                .'</p>';                                 .'</p>';
                 }                  }
                   $outcome .= '<p>'
                              .&mt('[_1]Your IMS package[_2] is ready for download.'
                                  ,'<a href="'.$imszipfile.'">','</a>')
                              .'</p>';
             } else {              } else {
                 $outcome = '<br />'.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').'<br />';                  $outcome = '<p class="LC_error">'
                             .&mt('Unfortunately you will not be able to retrieve'
                                 .' an IMS archive of this posts at this time,'
                                 .' because there was a problem creating a'
                                 .' manifest file.')
                             .'</p>'
                             .'<p><a href="javascript:history.go(-1)">'
                             .&mt('Go Back')
                             .'</a></p>';
             }              }
         }          }
         $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'));          $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package'));
  $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package'));   $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export'));
         $r->print($outcome);          $r->print($outcome);
         $r->print(&Apache::loncommon::end_page());          $r->print(&Apache::loncommon::end_page());
     } else {      } else {
Line 489  function containerCheck(item) { Line 508  function containerCheck(item) {
 // ]]>  // ]]>
 </script>  </script>
         |;          |;
  $r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package',   $r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package',
  $scripttag));   $scripttag));
  $r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package'));   $r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export'));
  $r->print($display.   $r->print($display.
                   '<p><input type="hidden" name="finishexport" value="1" />'.                    '<p><input type="hidden" name="finishexport" value="1" />'.
                   '<input type="submit" name="exportcourse" value="'.                    '<input type="submit" name="exportcourse" value="'.
                   &mt('Export '.$type.' DOCS').'" /></p></form>');                    &mt('Export').'" /></p></form>');
     }      }
 }  }
   
Line 1790  sub entryline { Line 1809  sub entryline {
      ne '')) {       ne '')) {
     $selectbox=      $selectbox=
  '<input type="hidden" name="currentpos" value="'.$incindex.'" />'.   '<input type="hidden" name="currentpos" value="'.$incindex.'" />'.
  '<select name="newpos" onChange="this.form.submit()">';   '<select name="newpos" onchange="this.form.submit()">';
     for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) {      for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) {
  if ($i==$incindex) {   if ($i==$incindex) {
     $selectbox.='<option value="" selected="selected">('.$i.')</option>';      $selectbox.='<option value="" selected="selected">('.$i.')</option>';
Line 1972  END Line 1991  END
                                               'parameter_randomorder'))[0]=~/^yes$/i);                                                'parameter_randomorder'))[0]=~/^yes$/i);
  $url.='folderpath='.&escape($folderpath).$cpinfo;   $url.='folderpath='.&escape($folderpath).$cpinfo;
  $parameterset='<label>'.&mt('Randomly Pick: ').   $parameterset='<label>'.&mt('Randomly Pick: ').
     '<input type="text" size="4" onChange="this.form.changeparms.value='."'randompick'".';this.form.submit()" name="randompick_'.$orderidx.'" value="'.      '<input type="text" size="4" onchange="this.form.changeparms.value='."'randompick'".';this.form.submit()" name="randompick_'.$orderidx.'" value="'.
     (&LONCAPA::map::getparameter($orderidx,      (&LONCAPA::map::getparameter($orderidx,
                                               'parameter_randompick'))[0].                                                'parameter_randompick'))[0].
                                               '" />'.                                                '" />'.
Line 2502  sub changewarning { Line 2521  sub changewarning {
  $message='Changes will become active for your current session after [_1], or the next time you log in.';   $message='Changes will become active for your current session after [_1], or the next time you log in.';
     }      }
     $r->print("\n\n".      $r->print("\n\n".
 '<script type="text/javascript">'.  '<script type="text/javascript">'."\n".
 '// <![CDATA['.  '// <![CDATA['."\n".
 'function reinit(tf) { tf.submit();'.$postexec.' }'.  'function reinit(tf) { tf.submit();'.$postexec.' }'."\n".
 '// ]]>'.  '// ]]>'."\n".
 '</script>'."\n".  '</script>'."\n".
 '<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'.  '<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'.
 '<input type="hidden" name="orgurl" value="'.$url.  '<input type="hidden" name="orgurl" value="'.$url.
 '" /><input type="hidden" name="selectrole" value="1" /><h3><span class="LC_warning">'.  '" /><input type="hidden" name="selectrole" value="1" /><p class="LC_warning">'.
 &mt($message,' <input type="hidden" name="'.  &mt($message,' <input type="hidden" name="'.
     $env{'request.role'}.'" value="1" /><input type="button" value="'.      $env{'request.role'}.'" value="1" /><input type="button" value="'.
     &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />').      &mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />').
 $help{'Caching'}.'</span></h3></form>'."\n\n");  $help{'Caching'}.'</p></form>'."\n\n");
 }  }
   
   
Line 2583  sub handler { Line 2602  sub handler {
       &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');        &init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space');
       &dumpcourse($r);        &dumpcourse($r);
   } elsif ($allowed && $env{'form.exportcourse'}) {    } elsif ($allowed && $env{'form.exportcourse'}) {
       &init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS');        &init_breadcrumbs('exportcourse','IMS Export');
       &exportcourse($r);        &exportcourse($r);
   } else {    } else {
 # is this a standard course?  # is this a standard course?
Line 2670  sub handler { Line 2689  sub handler {
     }      }
 # -------------------------------------------------------------------- Body tag  # -------------------------------------------------------------------- Body tag
     $script = '<script type="text/javascript">'."\n"      $script = '<script type="text/javascript">'."\n"
               .'// <![CDATA['                .'// <![CDATA['."\n"
               .$script                .$script."\n"
               .'// ]]>'                .'// ]]>'."\n"
               ."\n".'</script>';                .'</script>'."\n";
     my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];      my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}];
     $r->print(&Apache::loncommon::start_page("$type Documents", $script,      $r->print(&Apache::loncommon::start_page("$type Documents", $script,
     {'force_register' => $showdoc,      {'force_register' => $showdoc,
Line 2773  sub handler { Line 2792  sub handler {
                 'uplm' => 'Upload a new main '.lc($type).' document',                  'uplm' => 'Upload a new main '.lc($type).' document',
                 'upls' => 'Upload a new supplemental '.lc($type).' document',                  'upls' => 'Upload a new supplemental '.lc($type).' document',
                 'impp' => 'Import a document',                  'impp' => 'Import a document',
                 'pubd' => 'Published Documents',  
  'copm' => 'All documents out of a published map into this folder',   'copm' => 'All documents out of a published map into this folder',
                 'upld' => 'Upload Document',                  'upld' => 'Upload Document',
                 'srch' => 'Search',                  'srch' => 'Search',
Line 2796  sub handler { Line 2814  sub handler {
                 'grpo' => 'Group Portfolio',                  'grpo' => 'Group Portfolio',
                 'rost' => 'Course Roster',                  'rost' => 'Course Roster',
  'abou' => 'Personal Information Page for a User',   'abou' => 'Personal Information Page for a User',
                 'imsf' => 'Import IMS package',                  'imsf' => 'IMS Import',
                   'imsl' => 'Import IMS package',
                 'file' =>  'File',                  'file' =>  'File',
                 'title' => 'Title',                  'title' => 'Title',
                 'comment' => 'Comment',                  'comment' => 'Comment',
Line 2805  sub handler { Line 2824  sub handler {
  'pm' => 'Published Map',   'pm' => 'Published Map',
  'sd' => 'Special Document',   'sd' => 'Special Document',
  'mo' => 'More Options',   'mo' => 'More Options',
  'hao' => 'Hide all Options'  
   );    );
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
  my $fileupload=(<<FIUP);   my $fileupload=(<<FIUP);
Line 2824  CHBO Line 2842  CHBO
   
  my $fileuploadform=(<<FUFORM);   my $fileuploadform=(<<FUFORM);
  <form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data">   <form name="uploaddocument" action="/adm/coursedocs" method="post" enctype="multipart/form-data">
    <input type="hidden" name="active" value="aa" />
  $fileupload   $fileupload
  <br />   <br />
  $lt{'title'}:<br />   $lt{'title'}:<br />
Line 2845  FUFORM Line 2864  FUFORM
   
  my $simpleeditdefaultform=(<<SEDFFORM);   my $simpleeditdefaultform=(<<SEDFFORM);
  <form action="/adm/coursedocs" method="post" name="simpleeditdefault">   <form action="/adm/coursedocs" method="post" name="simpleeditdefault">
  $lt{'pubd'}<br />   <input type="hidden" name="active" value="bb" />
  $uploadtag   $uploadtag
  <input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />   <input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />
  <br />   <br />
Line 2923  HIDDENFORM Line 2942  HIDDENFORM
    $activeClass = 0;     $activeClass = 0;
  }   }
     }      }
     $r->print('<li '.$active.'onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');      $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>');
     $active = '';      $active = '';
     if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {      if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) {
         if($activeClass == 1){          if($activeClass == 1){
            $active = 'class="active"';             $active = 'class="active"';
         }          }
     }      }
     $r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');      $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
     $r->print('</ul><div class="LC_Box" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');      $r->print('</ul>'
                .'<div class="LC_Box" style="clear:both;margin:0;">'
                .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
        my $savefolderpath;         my $savefolderpath;
        my $active = 'style="display: none;"';         my $active = 'style="display: none;"';
Line 2939  HIDDENFORM Line 2960  HIDDENFORM
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
        }         }
        $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>');         $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>');
         $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',  
                      &mt('Editing the Table of Contents for your '.$type)));  
        my $folder=$env{'form.folder'};         my $folder=$env{'form.folder'};
        if ($folder eq '' || $folder=~/^supplemental/) {         if ($folder eq '' || $folder=~/^supplemental/) {
            $folder='default';             $folder='default';
Line 2951  HIDDENFORM Line 2970  HIDDENFORM
        }         }
        my $postexec='';         my $postexec='';
        if ($folder eq 'default') {         if ($folder eq 'default') {
            $r->print('<script type="text/javascript">'             $r->print('<script type="text/javascript">'."\n"
                     .'// <![CDATA['                      .'// <![CDATA['."\n"
                     .'this.window.name="loncapaclient";'                      .'this.window.name="loncapaclient";'."\n"
                     .'// ]]>'                      .'// ]]>'."\n"
                     .'</script>'                      .'</script>'."\n"
        );         );
        } else {         } else {
            #$postexec='self.close();';             #$postexec='self.close();';
Line 2981  RFORM Line 3000  RFORM
  my $imspform=(<<IMSPFORM);   my $imspform=(<<IMSPFORM);
  <form action="/adm/imsimportdocs" method="post" name="ims">   <form action="/adm/imsimportdocs" method="post" name="ims">
  <input type="hidden" name="folder" value="$folder" />   <input type="hidden" name="folder" value="$folder" />
  <input name="imsimport" type="button" value="$lt{'imsf'}" onclick="javascript:makeims();" />   <input name="imsimport" type="button" value="$lt{'imsf'}" title="$lt{imsl}"  onclick="javascript:makeims();" />
  </form>   </form>
 IMSPFORM  IMSPFORM
   
  my $newnavform=(<<NNFORM);   my $newnavform=(<<NNFORM);
  <form action="/adm/coursedocs" method="post" name="newnav">   <form action="/adm/coursedocs" method="post" name="newnav">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="$lt{'navc'}=/adm/navmaps" />   value="$lt{'navc'}=/adm/navmaps" />
Line 2998  IMSPFORM Line 3018  IMSPFORM
 NNFORM  NNFORM
  my $newsmppageform=(<<NSPFORM);   my $newsmppageform=(<<NSPFORM);
  <form action="/adm/coursedocs" method="post" name="newsmppg">   <form action="/adm/coursedocs" method="post" name="newsmppg">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3009  NSPFORM Line 3030  NSPFORM
   
  my $newsmpproblemform=(<<NSPROBFORM);   my $newsmpproblemform=(<<NSPROBFORM);
  <form action="/adm/coursedocs" method="post" name="newsmpproblem">   <form action="/adm/coursedocs" method="post" name="newsmpproblem">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3021  NSPROBFORM Line 3043  NSPROBFORM
   
  my $newdropboxform=(<<NDBFORM);   my $newdropboxform=(<<NDBFORM);
  <form action="/adm/coursedocs" method="post" name="newdropbox">   <form action="/adm/coursedocs" method="post" name="newdropbox">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3032  NDBFORM Line 3055  NDBFORM
   
  my $newexuploadform=(<<NEXUFORM);   my $newexuploadform=(<<NEXUFORM);
  <form action="/adm/coursedocs" method="post" name="newexamupload">   <form action="/adm/coursedocs" method="post" name="newexamupload">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3044  NEXUFORM Line 3068  NEXUFORM
   
  my $newbulform=(<<NBFORM);   my $newbulform=(<<NBFORM);
  <form action="/adm/coursedocs" method="post" name="newbul">   <form action="/adm/coursedocs" method="post" name="newbul">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3056  NBFORM Line 3081  NBFORM
   
  my $newaboutmeform=(<<NAMFORM);   my $newaboutmeform=(<<NAMFORM);
  <form action="/adm/coursedocs" method="post" name="newaboutme">   <form action="/adm/coursedocs" method="post" name="newaboutme">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="$plainname=/adm/$udom/$uname/aboutme" />   value="$plainname=/adm/$udom/$uname/aboutme" />
Line 3068  NAMFORM Line 3094  NAMFORM
   
  my $newaboutsomeoneform=(<<NASOFORM);   my $newaboutsomeoneform=(<<NASOFORM);
  <form action="/adm/coursedocs" method="post" name="newaboutsomeone">   <form action="/adm/coursedocs" method="post" name="newaboutsomeone">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3080  NASOFORM Line 3107  NASOFORM
   
  my $newrosterform=(<<NROSTFORM);   my $newrosterform=(<<NROSTFORM);
  <form action="/adm/coursedocs" method="post" name="newroster">   <form action="/adm/coursedocs" method="post" name="newroster">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="$lt{'rost'}=/adm/viewclasslist" />   value="$lt{'rost'}=/adm/viewclasslist" />
Line 3100  my $newfolderform; Line 3128  my $newfolderform;
  <form action="/adm/coursedocs" method="post" name="newpage">   <form action="/adm/coursedocs" method="post" name="newpage">
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
    <input type="hidden" name="active" value="cc" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
  <input name="newpage" type="button"   <input name="newpage" type="button"
  onclick="javascript:makenewpage(this.form,'$pageseq');"   onclick="javascript:makenewpage(this.form,'$pageseq');"
Line 3112  NPFORM Line 3141  NPFORM
  <form action="/adm/coursedocs" method="post" name="newfolder">   <form action="/adm/coursedocs" method="post" name="newfolder">
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
    <input type="hidden" name="active" value="aa" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
  <input name="newfolder" type="button"   <input name="newfolder" type="button"
  onclick="javascript:makenewfolder(this.form,'$folderseq');"   onclick="javascript:makenewfolder(this.form,'$folderseq');"
Line 3122  NFFORM Line 3152  NFFORM
   
  my $newsylform=(<<NSYLFORM);   my $newsylform=(<<NSYLFORM);
  <form action="/adm/coursedocs" method="post" name="newsyl">   <form action="/adm/coursedocs" method="post" name="newsyl">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />   value="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />
Line 3134  NSYLFORM Line 3165  NSYLFORM
   
  my $newgroupfileform=(<<NGFFORM);   my $newgroupfileform=(<<NGFFORM);
  <form action="/adm/coursedocs" method="post" name="newgroupfiles">   <form action="/adm/coursedocs" method="post" name="newgroupfiles">
    <input type="hidden" name="active" value="cc" />
  $uploadtag   $uploadtag
  <input type="hidden" name="importdetail"   <input type="hidden" name="importdetail"
  value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />   value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
Line 3157  if($env{'form.pagepath'}) { Line 3189  if($env{'form.pagepath'}) {
   
 my %orderhash = (  my %orderhash = (
                 'aa' => ['Upload Document',$fileuploadform.'<br />'.$newfolderform],                  'aa' => ['Upload Document',$fileuploadform.'<br />'.$newfolderform],
                 'bb' => ['Published Documents',$simpleeditdefaultform],                  'bb' => ['Published Resources',$simpleeditdefaultform],
                 'cc' => ['Special Documents',$specialdocumentsform],                  'cc' => ['Special Documents',$specialdocumentsform],
  'dd' => ['Tools',$extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)],   'dd' => ['Tools',$extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
                 'zz' => ['Hide all Options'],                  'zz' => ['Hide'],
                 );                  );
 my $tid='1';  my $tid='1';
 my $varcd = 'Main Course Documents';  my $varcd = 'Main Course Documents';
Line 3175  $r->print(&generate_edit_table($tid,$var Line 3207  $r->print(&generate_edit_table($tid,$var
        }         }
   
        &changewarning($r,'');         &changewarning($r,'');
    $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
                        &mt('Editing the Table of Contents for your '.$type)));
 $r->print('</div>');  $r->print('</div>');
        if ($env{'form.pagepath'}) {         if ($env{'form.pagepath'}) {
        }         }
Line 3183  $r->print('</div>'); Line 3217  $r->print('</div>');
        if($activeClass == 1){         if($activeClass == 1){
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
        }         }
        $r->print('<div class="LC_ContentBox" id="Supplemental Course Documents" '.$active.'>');         $r->print('<div class="LC_ContentBox" id="supplCourseDocuments" '.$active.'>');
        my $folder=$env{'form.folder'};         my $folder=$env{'form.folder'};
        unless ($folder=~/^supplemental/) {         unless ($folder=~/^supplemental/) {
    $folder='supplemental';     $folder='supplemental';
Line 3205  $r->print('</div>'); Line 3239  $r->print('</div>');
   
  my $supupdocform=(<<SUPDOCFORM);   my $supupdocform=(<<SUPDOCFORM);
  <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">   <form action="/adm/coursedocs" method="post" enctype="multipart/form-data">
    <input type="hidden" name="active" value="ee" />
  $fileupload   $fileupload
  <br />   <br />
  <br />   <br />
Line 3227  SUPDOCFORM Line 3262  SUPDOCFORM
   
  my $supnewfolderform=(<<SNFFORM);   my $supnewfolderform=(<<SNFFORM);
  <form action="/adm/coursedocs" method="post" name="supnewfolder">   <form action="/adm/coursedocs" method="post" name="supnewfolder">
    <input type="hidden" name="active" value="ee" />
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3240  SNFFORM Line 3276  SNFFORM
   
  my $supnewextform=(<<SNEFORM);   my $supnewextform=(<<SNEFORM);
  <form action="/adm/coursedocs" method="post" name="supnewext">   <form action="/adm/coursedocs" method="post" name="supnewext">
    <input type="hidden" name="active" value="ff" />
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail" value="" />   <input type="hidden" name="importdetail" value="" />
  <span class="LC_nobreak">   <span class="LC_nobreak">
Line 3252  SNEFORM Line 3289  SNEFORM
   
  my $supnewsylform=(<<SNSFORM);   my $supnewsylform=(<<SNSFORM);
  <form action="/adm/coursedocs" method="post" name="supnewsyl">   <form action="/adm/coursedocs" method="post" name="supnewsyl">
    <input type="hidden" name="active" value="ff" />
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="Syllabus=/public/$coursedom/$coursenum/syllabus" />   value="Syllabus=/public/$coursedom/$coursenum/syllabus" />
Line 3264  SNSFORM Line 3302  SNSFORM
   
  my $supnewaboutmeform=(<<SNAMFORM);   my $supnewaboutmeform=(<<SNAMFORM);
  <form action="/adm/coursedocs" method="post" name="subnewaboutme">   <form action="/adm/coursedocs" method="post" name="subnewaboutme">
    <input type="hidden" name="active" value="ff" />
  <input type="hidden" name="folderpath" value="$path" />   <input type="hidden" name="folderpath" value="$path" />
  <input type="hidden" name="importdetail"    <input type="hidden" name="importdetail" 
  value="$plainname=/adm/$udom/$uname/aboutme" />   value="$plainname=/adm/$udom/$uname/aboutme" />
Line 3279  SNAMFORM Line 3318  SNAMFORM
 my %suporderhash = (  my %suporderhash = (
                 'ee' => ['Upload Document',$supupdocform.'<br />'.$supnewfolderform],                  'ee' => ['Upload Document',$supupdocform.'<br />'.$supnewfolderform],
                 'ff' => ['Special Documents',$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform],                  'ff' => ['Special Documents',$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform],
                 'zz' => ['Hide all Options'],                  'zz' => ['Hide'],
                 );                  );
   
 my $tid='2';  my $tid='2';
Line 3347  sub generate_edit_table { Line 3386  sub generate_edit_table {
     my ($tid,$varcd,$orderhash_ref) = @_;      my ($tid,$varcd,$orderhash_ref) = @_;
     my %orderhash = %{$orderhash_ref};      my %orderhash = %{$orderhash_ref};
     my $form;      my $form;
       my $activetab;
       my $active;
       if($env{'form.active'} ne ''){
           $activetab = $env{'form.active'};
       }
     $form = '<div class="LC_Box"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';      $form = '<div class="LC_Box"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';
     $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';      $form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">';
     foreach my $name (sort(keys(%orderhash))){      foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){          if($name eq 'zz'){
             $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" class="active">'.&mt(${$orderhash{$name}}[0]).'</li></span>';              if($activetab ne ''){
                  $active = 'class="right"';
               }else{
                  $active = 'class="right active"';
               }
               $form .= '<li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li>';
         }else{          }else{
             $form .= '<li onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';              if($activetab eq '' || $activetab ne $name){
                  $active = '';
               }elsif($activetab eq $name){
                  $active = 'class="active"';
               }
               $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
         }          }
     }      }
     $form .= '</ul>';      $form .= '</ul>';
     $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">';      $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">';
     foreach my $field (keys(%orderhash)){      foreach my $field (keys(%orderhash)){
  if($field ne 'zz'){   if($field ne 'zz'){
            $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" style="display: none;">'.${$orderhash{$field}}[1].'</div>';          if($activetab eq '' || $activetab ne $field){
                   $active = 'style="display: none;"';
           }elsif($activetab eq $field){
                   $active = 'style="display:block;"';
           }
              $form .= '<div id="'.$field.$tid.'"'
                      .' class="LC_ContentBox" '.$active.'>'.${$orderhash{$field}}[1]
                      .'</div>';
         }          }
     }      }
     $form .= '</div></div>';      $form .= '</div></div>';
Line 3574  function unselectInactive(nav) { Line 3634  function unselectInactive(nav) {
 currentNav = document.getElementById(nav);  currentNav = document.getElementById(nav);
 currentLis = currentNav.getElementsByTagName('LI');  currentLis = currentNav.getElementsByTagName('LI');
 for (i = 0; i < currentLis.length; i++) {  for (i = 0; i < currentLis.length; i++) {
  currentLis[i].className = 'i';   if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){
    currentLis[i].className = 'right';
    }else{
    currentLis[i].className = 'i';
    }
 }  }
 }  }
   
 function hideAll(current, nav, data) {  function hideAll(current, nav, data) {
 unselectInactive(nav);  unselectInactive(nav);
 current.className = 'active';  if(current.className == 'right'){
    current.className = 'right active'
    }else{
    current.className = 'active';
   }
 currentData = document.getElementById(data);  currentData = document.getElementById(data);
 currentDivs = currentData.getElementsByTagName('DIV');  currentDivs = currentData.getElementsByTagName('DIV');
 for (i = 0; i < currentDivs.length; i++) {  for (i = 0; i < currentDivs.length; i++) {
Line 3590  for (i = 0; i < currentDivs.length; i++) Line 3658  for (i = 0; i < currentDivs.length; i++)
 }  }
 }  }
   
   function openTabs(pageId) {
    tabnav = document.getElementById(pageId).getElementsByTagName('UL');
    if(tabnav.length > 0 ){
    currentNav = document.getElementById(tabnav[0].id);
    currentLis = currentNav.getElementsByTagName('LI');
    for(i = 0; i< currentLis.length; i++){
    if(currentLis[i].className == 'active') {
    funcString = currentLis[i].onclick.toString();
    tab = funcString.split('"');
    currentData = document.getElementById(tab[1]);
           currentData.style.display = 'block';
    }
    }
    }
   }
   
 function showPage(current, pageId, nav, data) {  function showPage(current, pageId, nav, data) {
  hideAll(current, nav, data);   hideAll(current, nav, data);
    openTabs(pageId);
  unselectInactive(nav);   unselectInactive(nav);
  current.className = 'active';   current.className = 'active';
  currentData = document.getElementById(pageId);   currentData = document.getElementById(pageId);

Removed from v.1.370  
changed lines
  Added in v.1.377


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