Diff for /loncom/interface/londocs.pm between versions 1.371 and 1.380

version 1.371, 2009/06/09 18:42:42 version 1.380, 2009/07/14 12:27:52
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 1030  sub breadcrumbs { Line 1049  sub breadcrumbs {
     }      }
     $plain=~s/\&gt\;\s*$//;      $plain=~s/\&gt\;\s*$//;
     return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',      return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',
        'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);         undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
 }  }
   
 sub log_docs {  sub log_docs {
Line 1271  ENDPASTE Line 1290  ENDPASTE
  if ($extension eq 'sequence' &&   if ($extension eq 'sequence' &&
     $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {      $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
     $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));      $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
     $icon .= '/folder_closed.gif';      $icon .= '/navmap.folder.closed.gif';
  }   }
  $icon = '<img src="'.$icon.'" alt="" class="LC_icon" />';   $icon = '<img src="'.$icon.'" alt="" class="LC_icon" />';
  $r->print($icon.$type.': '.  &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})));   $r->print($icon.$type.': '.  &parse_supplemental_title(&LONCAPA::map::qtescape($env{'docs.markedcopy_title'})));
Line 1581  sub editor { Line 1600  sub editor {
     if ($is_random_order) {      if ($is_random_order) {
  $r->print('<p>'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'</p>');   $r->print('<p>'.&mt('Caution: this folder is set to randomly order its contents. Adding or removing resources from this folder will change the order of resources shown.').'</p>');
     }      }
     $r->print('<table class="LC_docs_editor">');      $r->print(&Apache::loncommon::start_data_table());
     foreach my $res (@LONCAPA::map::order) {      foreach my $res (@LONCAPA::map::order) {
  my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);   my ($name,$url)=split(/\:/,$LONCAPA::map::resources[$res]);
  $name=&LONCAPA::map::qtescape($name);   $name=&LONCAPA::map::qtescape($name);
Line 1594  sub editor { Line 1613  sub editor {
  $shown++;   $shown++;
     }      }
     unless ($shown) {      unless ($shown) {
  $r->print('<tr><td>'.&mt('Currently no documents.').'</td></tr>');   $r->print('<tr><td><p class="LC_info">'
                .&mt('Currently no documents.')
                .'</p></td></tr>');
     }      }
     $r->print("\n</table>\n");      $r->print(&Apache::loncommon::end_data_table());
     if ($allowed) {      if ($allowed) {
         &print_paste_buffer($r,$container);          &print_paste_buffer($r,$container);
     }      }
Line 1759  sub entryline { Line 1780  sub entryline {
     $renametitle=~s/\\/\\\\/g;      $renametitle=~s/\\/\\\\/g;
     $renametitle=~s/\&quot\;/\\\"/g;      $renametitle=~s/\&quot\;/\\\"/g;
     $renametitle=~s/ /%20/g;      $renametitle=~s/ /%20/g;
     my $line='<tr>';      my $line=&Apache::loncommon::start_data_table_row();
     my ($form_start,$form_end);      my ($form_start,$form_end);
 # Edit commands  # Edit commands
     my ($container, $type, $esc_path, $path, $symb);      my ($container, $type, $esc_path, $path, $symb);
Line 1790  sub entryline { Line 1811  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 1862  END Line 1883  END
         $form_end = '</form>';          $form_end = '</form>';
  $line.=(<<END);   $line.=(<<END);
 <td>  <td>
    <table class="LC_docs_entry_move">  <div class="LC_docs_entry_move">
       <tr>    <a href='/adm/coursedocs?cmd=up_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'>
          <td>      <img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" />
             <a href='/adm/coursedocs?cmd=up_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'><img src="${iconpath}move_up.gif" alt='$lt{'up'}' class="LC_icon" /></a>    </a>
          </td>  </div>
       </tr>  <div class="LC_docs_entry_move">
       <tr>    <a href='/adm/coursedocs?cmd=down_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'>
         <td>      <img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" />
            <a href='/adm/coursedocs?cmd=down_$index&amp;${type}path=$esc_path&amp;${type}symb=$symb$cpinfo'><img src="${iconpath}move_down.gif" alt='$lt{'dw'}' class="LC_icon" /></a>    </a>
         </td>  </div>
       </tr>  
     </table>  
 </td>  </td>
 <td>  <td>
    $form_start     $form_start
Line 1900  END Line 1919  END
     my $pagefile;      my $pagefile;
     if ($uploaded) {      if ($uploaded) {
  if ($extension eq 'sequence') {   if ($extension eq 'sequence') {
     $icon=$iconpath.'/folder_closed.gif';      $icon=$iconpath.'/navmap.folder.closed.gif';
     $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;      $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;
     $url='/adm/coursedocs?';      $url='/adm/coursedocs?';
     $folderarg=$1;      $folderarg=$1;
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 2007  END Line 2026  END
  undef($external);   undef($external);
     }      }
     $line.='      $line.='
   <td class="LC_docs_entry_icon">    <td>
     '.($url?'<a href="'.$url.'">':'').'<img src="'.$icon.'" alt="" class="LC_icon" />'.($url?'</a>':'').'      '.($url?'<a href="'.$url.'">':'').'<img src="'.$icon.'" alt="" class="LC_icon" />'.($url?'</a>':'').'
   </td>    </td>
   <td class="LC_docs_entry_title">    <td>
     '.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>').$external."      '.($url?"<a href=\"$url\">":'').$title.($url?'</a>':' <span class="LC_docs_reinit_warn">'.&mt('(re-initialize course to access)').'</span>').$external."
   </td>";    </td>";
     if (($allowed) && ($folder!~/^supplemental/)) {      if (($allowed) && ($folder!~/^supplemental/)) {
Line 2036  END Line 2055  END
   <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td>    <td class="LC_docs_entry_parameter">$form_start $parameterset $form_end</td>
 ENDPARMS  ENDPARMS
     }      }
     $line.="</tr>";      $line.=&Apache::loncommon::end_data_table_row();
     return $line;      return $line;
 }  }
   
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 2847  FUFORM Line 2865  FUFORM
  my $simpleeditdefaultform=(<<SEDFFORM);   my $simpleeditdefaultform=(<<SEDFFORM);
  <form action="/adm/coursedocs" method="post" name="simpleeditdefault">   <form action="/adm/coursedocs" method="post" name="simpleeditdefault">
  <input type="hidden" name="active" value="bb" />   <input type="hidden" name="active" value="bb" />
  $lt{'pubd'}<br />  
  $uploadtag   $uploadtag
  <input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />   <input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" />
  <br />   <br />
Line 2919  HIDDENFORM Line 2936  HIDDENFORM
     my $activeClass = 1;      my $activeClass = 1;
     my $active = '';      my $active = '';
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');      $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
     if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || ($env{'form.pagepath'}))) {      if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
         if($activeClass == 1){          if($activeClass == 1){
            $active = 'class="active"';             $active = 'class="active"';
    $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 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
   
Line 3170  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 3198  $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 3299  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 3377  sub generate_edit_table { Line 3396  sub generate_edit_table {
     foreach my $name (sort(keys(%orderhash))){      foreach my $name (sort(keys(%orderhash))){
         if($name eq 'zz'){          if($name eq 'zz'){
             if($activetab ne ''){              if($activetab ne ''){
                $active = '';                 $active = 'class="right"';
             }else{              }else{
                $active = 'class="active"';                 $active = 'class="right active"';
             }              }
             $form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li></span>';              $form .= '<li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" '.$active.'>'.&mt(${$orderhash{$name}}[0]).'</li>';
         }else{          }else{
             if($activetab eq '' || $activetab ne $name){              if($activetab eq '' || $activetab ne $name){
                $active = '';                 $active = '';
             }elsif($activetab eq $name){              }elsif($activetab eq $name){
                $active = 'class="active"';                 $active = 'class="active"';
             }              }
             $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';              $form .= '<li '.$active.' onclick="javascript:showPage(this, \''.$name.$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>';
         }          }
     }      }
     $form .= '</ul>';      $form .= '</ul>';
Line 3400  sub generate_edit_table { Line 3419  sub generate_edit_table {
         }elsif($activetab eq $field){          }elsif($activetab eq $field){
                 $active = 'style="display:block;"';                  $active = 'style="display:block;"';
         }          }
            $form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" '.$active.'">'.${$orderhash{$field}}[1].'</div>';             $form .= '<div id="'.$field.$tid.'"'
                      .' class="LC_ContentBox" '.$active.'>'.${$orderhash{$field}}[1]
                      .'</div>';
         }          }
     }      }
     $form .= '</div></div>';      $form .= '</div></div>';
Line 3613  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 3629  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.371  
changed lines
  Added in v.1.380


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