Diff for /loncom/interface/londocs.pm between versions 1.212 and 1.224

version 1.212, 2005/11/17 11:05:29 version 1.224, 2006/03/17 00:06:54
Line 140  sub clean { Line 140  sub clean {
 # -------------------------------------------------------- Actually dump course  # -------------------------------------------------------- Actually dump course
   
 sub dumpcourse {  sub dumpcourse {
     my $r=shift;      my ($r) = @_;
     my $html=&Apache::lonxml::xmlbegin();  
     $r->print($html.'<head><title>Dump DOCS</title></head>'.      $r->print(&Apache::loncommon::start_page('Dump Course DOCS to Construction Space').
         &Apache::loncommon::bodytag('Dump Course DOCS to Construction Space').  
       '<form name="dumpdoc" method="post">');        '<form name="dumpdoc" method="post">');
     my ($home,$other,%outhash)=&authorhosts();      my ($home,$other,%outhash)=&authorhosts();
     unless ($home) { return ''; }      unless ($home) { return ''; }
Line 308  sub exportcourse { Line 307  sub exportcourse {
                 $outcome = '<br />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 = '<br />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 />';
             }              }
         }          }
  my $html=&Apache::lonxml::xmlbegin();          $r->print(&Apache::loncommon::start_page('Export course to IMS content package'));
         $r->print($html.'<head><title>Export Course</title></head>'.  
             &Apache::loncommon::bodytag('Export course to IMS content package'));  
         $r->print($outcome);          $r->print($outcome);
         $r->print('</body></html>');          $r->print(&Apache::loncommon::end_page());
     } else {      } else {
         my $display;          my $display;
         $display = '<form name="exportdoc" method="post">'."\n";          $display = '<form name="exportdoc" method="post">'."\n";
Line 450  function containerCheck(item) { Line 447  function containerCheck(item) {
   
 </script>  </script>
         |;          |;
  my $html=&Apache::lonxml::xmlbegin();   $r->print(&Apache::loncommon::start_page('Export course to IMS content package',
         $r->print($html.'<head><title>Export Course</title>'.$scripttag.'</head>'.   $scripttag));
             &Apache::loncommon::bodytag('Export course to IMS content package'   $r->print($display.'</table>'.
 ));  
   
         $r->print($display.'</table>'.  
                   '<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 Course DOCS').'" /></p></form></body></html>');                    &mt('Export Course DOCS').'" /></p></form>'.
     &Apache::loncommon::end_page());
     }      }
 }  }
   
Line 1190  sub editor { Line 1185  sub editor {
  }   }
             }              }
 # Loading a complete map  # Loading a complete map
    if (($env{'form.importmap'}) && ($env{'form.loadmap'})) {     if ($env{'form.loadmap'}) {
        foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {                 if ($env{'form.importmap'}=~/\w/) {
    my ($title,$url,$ext,$type)=split(/\:/,$_);            foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$env{'form.importmap'}))) {
                    my $idx=&Apache::lonratedt::getresidx($url);        my ($title,$url,$ext,$type)=split(/\:/,$_);
                    $Apache::lonratedt::resources[$idx]=$_;                        my $idx=&Apache::lonratedt::getresidx($url);
                    $Apache::lonratedt::order                        $Apache::lonratedt::resources[$idx]=$_;
        [$#Apache::lonratedt::order+1]=$idx;                        $Apache::lonratedt::order
        }            [$#Apache::lonratedt::order+1]=$idx;
             }
 # Store the changed version  # Store the changed version
        ($errtext,$fatal)=&storemap($coursenum,$coursedom,             ($errtext,$fatal)=&storemap($coursenum,$coursedom,
    $folder.'.'.$container);     $folder.'.'.$container);
        if ($fatal) {            if ($fatal) {
    $r->print('<p><font color="red">'.$errtext.'</font></p>');        $r->print('<p><font color="red">'.$errtext.'</font></p>');
    return;        return;
        }            }
                  } else {
                      $r->print('<p><font color="red">'.&mt('No map selected.').'</font></p>');
                  }
            }             }
        }         }
 # ---------------------------------------------------------------- End commands  # ---------------------------------------------------------------- End commands
Line 1373  sub process_secondary_uploads { Line 1371  sub process_secondary_uploads {
     if (($folder eq 'default') || ($folder eq 'supplemental')) {      if (($folder eq 'default') || ($folder eq 'supplemental')) {
         $destination .= 'default/';          $destination .= 'default/';
     } elsif ($folder =~ /^(default|supplemental)_(\d+)$/) {      } elsif ($folder =~ /^(default|supplemental)_(\d+)$/) {
         $destination .=  $1.'/';          $destination .=  $2.'/';
     }      }
     $destination .= $newidx;      $destination .= $newidx;
     my ($url,$filename);      my ($url,$filename);
Line 1400  sub entryline { Line 1398  sub entryline {
     &Apache::loncommon::plainname($2,$3).': <br />'.      &Apache::loncommon::plainname($2,$3).': <br />'.
     $foldertitle;      $foldertitle;
     }      }
       $renametitle=~s/\\/\\\\/g;
     $renametitle=~s/\&quot\;/\\\"/g;      $renametitle=~s/\&quot\;/\\\"/g;
     my $line='<tr>';      my $line='<tr>';
 # Edit commands  # Edit commands
Line 1492  ENDCOPY Line 1491  ENDCOPY
 <font size="-2" color="#990000">$lt{'rm'}</font></a>  <font size="-2" color="#990000">$lt{'rm'}</font></a>
 <a href='javascript:cutres("$pagepath","$index","$renametitle","page","$pagesymb");'>  <a href='javascript:cutres("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#550044">$lt{'ct'}</font></a>  <font size="-2" color="#550044">$lt{'ct'}</font></a>
 <a href=:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>  <a href='javascript:changename("$pagepath","$index","$renametitle","page","$pagesymb");'>
 <font size="-2" color="#009900">$lt{'rn'}</font></a>  <font size="-2" color="#009900">$lt{'rn'}</font></a>
 $copylink  $copylink
 END  END
Line 1555  END Line 1554  END
     &Apache::lonnet::allowuploaded('/adm/coursedoc',$url);      &Apache::lonnet::allowuploaded('/adm/coursedoc',$url);
  }   }
     }      }
     $url=~s/^http\&colon\;\/\//\/adm\/wrapper\/ext\//;      $url=~s-^http(\&colon\;|:)//-/adm/wrapper/ext/-;
     if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) {      if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) {
  my $symb=&Apache::lonnet::symbclean(   my $symb=&Apache::lonnet::symbclean(
           &Apache::lonnet::declutter('uploaded/'.            &Apache::lonnet::declutter('uploaded/'.
Line 1588  END Line 1587  END
  }   }
     }      }
     my $parameterset='&nbsp;';      my $parameterset='&nbsp;';
     if ($isfolder) {      if ($isfolder || $extension eq 'sequence') {
  my $foldername=&Apache::lonnet::escape($foldertitle);   my $foldername=&Apache::lonnet::escape($foldertitle);
  my $folderpath=$env{'form.folderpath'};   my $folderpath=$env{'form.folderpath'};
  if ($folderpath) { $folderpath.='&' };   if ($folderpath) { $folderpath.='&' };
Line 1666  sub tiehash { Line 1665  sub tiehash {
 sub untiehash {  sub untiehash {
     if ($hashtied) { untie %hash; }      if ($hashtied) { untie %hash; }
     $hashtied=0;      $hashtied=0;
       return OK;
 }  }
   
 # --------------------------------------------------------------- check on this  # --------------------------------------------------------------- check on this
Line 1745  sub checkonthis { Line 1745  sub checkonthis {
 # ----------------------------------------------------------------- List Symbs  # ----------------------------------------------------------------- List Symbs
 #   # 
 sub list_symbs {  sub list_symbs {
    my $r=shift;       my ($r) = @_;
    my $html=&Apache::lonxml::xmlbegin();  
    $r->print($html.'<head><title>Symb List</title></head>'.      $r->print(&Apache::loncommon::start_page('Symb List'));
               &Apache::loncommon::bodytag('Symb List'));      my $navmap = Apache::lonnavmaps::navmap->new();
    my $navmap = Apache::lonnavmaps::navmap->new();      $r->print("<pre>\n");
    $r->print("<pre>\n");      foreach my $res ($navmap->retrieveResources()) {
    foreach my $res ($navmap->retrieveResources()) {   $r->print($res->compTitle()."\t".$res->symb()."\n");
        $r->print($res->compTitle()."\t".$res->symb()."\n");      }
    }      $r->print("\n</pre>\n");
    $r->print("\n</pre>\n");      $r->print('<a href="/adm/coursedocs">'.&mt('Return to DOCS').'</a>');
    $r->print('<a href="/adm/coursedocs">'.&mt('Return to DOCS').'</a>');  
 }  }
   
   
Line 1763  sub list_symbs { Line 1762  sub list_symbs {
 # -------------------------------------------------------------- Verify Content  # -------------------------------------------------------------- Verify Content
 #   # 
 sub verifycontent {  sub verifycontent {
    my $r=shift;       my ($r) = @_;
    my $loaderror=&Apache::lonnet::overloaderror($r);     my $loaderror=&Apache::lonnet::overloaderror($r);
    if ($loaderror) { return $loaderror; }     if ($loaderror) { return $loaderror; }
    my $html=&Apache::lonxml::xmlbegin();     $r->print(&Apache::loncommon::start_page('Verify Course Documents'));
    $r->print($html.'<head><title>Verify Content</title></head>'.  
               &Apache::loncommon::bodytag('Verify Course Documents'));  
    $hashtied=0;     $hashtied=0;
    undef %alreadyseen;     undef %alreadyseen;
    %alreadyseen=();     %alreadyseen=();
Line 1801  sub devalidateversioncache { Line 1798  sub devalidateversioncache {
 }  }
   
 sub checkversions {  sub checkversions {
     my $r=shift;      my ($r) = @_;
     my $html=&Apache::lonxml::xmlbegin();      $r->print(&Apache::loncommon::start_page('Check Course Document Versions'));
     $r->print($html.'<head><title>Check Versions</title></head>'.  
               &Apache::loncommon::bodytag('Check Course Document Versions'));  
     my $header='';      my $header='';
     my $startsel='';      my $startsel='';
     my $monthsel='';      my $monthsel='';
Line 2149  sub handler { Line 2144  sub handler {
     my $containertag;      my $containertag;
     my $uploadtag;      my $uploadtag;
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
     ['folderpath','pagepath','pagesymb','markedcopy_url','markedcopy_title']);      ['folderpath','pagepath',
        'pagesymb','markedcopy_url',
        'markedcopy_title']);
     if ($env{'form.folderpath'}) {      if ($env{'form.folderpath'}) {
  my (@folderpath)=split('&',$env{'form.folderpath'});   my (@folderpath)=split('&',$env{'form.folderpath'});
  $env{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));   $env{'form.foldername'}=&Apache::lonnet::unescape(pop(@folderpath));
Line 2181  sub handler { Line 2178  sub handler {
     } else { # got called in sequence from course      } else { # got called in sequence from course
        $allowed=0;         $allowed=0;
        $script='</script>'.&Apache::lonmenu::registerurl(1,undef).'<script>';         $script='</script>'.&Apache::lonmenu::registerurl(1,undef).'<script>';
        $events='onLoad="'.&Apache::lonmenu::loadevents.         $events='onLoad="'.&Apache::lonmenu::loadevents().
            '" onUnload="'.&Apache::lonmenu::unloadevents.'"';             '" onUnload="'.&Apache::lonmenu::unloadevents().'"';
     }      }
   
 # get course data  # get course data
Line 2200  sub handler { Line 2197  sub handler {
   
     $iconpath = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL') . "/");      $iconpath = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL') . "/");
   
     my $now=time;      if ($allowed) {
    $script .= &editing_js($udom,$uname);
 # print screen  
        my $html=&Apache::lonxml::xmlbegin();  
     $r->print(<<ENDDOCUMENT);  
 $html  
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 <script>  
 $script  
 </script>  
 ENDDOCUMENT  
    if ($allowed) {  
     $r->print(<<ENDNEWSCRIPT);  
 <script>  
 function makenewfolder(targetform,folderseq) {  
     var foldername=prompt('Name of New Folder','New Folder');  
     if (foldername) {  
  targetform.importdetail.value=foldername+"="+folderseq;  
         targetform.submit();  
     }  
 }  
   
 function makenewpage(targetform,folderseq) {  
     var pagename=prompt('Name of New Page','New Page');  
     if (pagename) {  
         targetform.importdetail.value=pagename+"="+folderseq;  
         targetform.submit();  
     }  
 }  
   
 function makenewext(targetname) {  
     this.document.forms.extimport.useform.value=targetname;  
     window.open('/adm/rat/extpickframe.html');  
 }  
   
 function makeexamupload() {  
    var title=prompt('Listed Title for the Uploaded Score');  
    if (title) {   
     this.document.forms.newexamupload.importdetail.value=  
  title+'=/res/lib/templates/examupload.problem';  
     this.document.forms.newexamupload.submit();  
    }  
 }  
   
 function makesmppage() {  
    var title=prompt('Listed Title for the Page');  
    if (title) {   
     this.document.forms.newsmppg.importdetail.value=  
  title+'=/adm/$udom/$uname/$now/smppg';  
     this.document.forms.newsmppg.submit();  
    }  
 }  
   
 function makesmpproblem() {  
    var title=prompt('Listed Title for the Problem');  
    if (title) {   
     this.document.forms.newsmpproblem.importdetail.value=  
  title+'=/res/lib/templates/simpleproblem.problem';  
     this.document.forms.newsmpproblem.submit();  
    }  
 }  
   
 function makebulboard() {  
    var title=prompt('Listed Title for the Bulletin Board');  
    if (title) {  
     this.document.forms.newbul.importdetail.value=  
  title+'=/adm/$udom/$uname/$now/bulletinboard';  
     this.document.forms.newbul.submit();  
    }  
 }  
   
 function makeabout() {  
    var user=prompt("Enter user\@domain for User's 'About Me' Page");  
    if (user) {  
        var comp=new Array();  
        comp=user.split('\@');  
        if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) {  
    if ((comp[0]) && (comp[1])) {  
        this.document.forms.newaboutsomeone.importdetail.value=  
    'About '+user+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';  
        this.document.forms.newaboutsomeone.submit();  
    } else {  
                alert("Not a valid user\@domain");  
            }  
        } else {  
            alert("Please enter both user and domain in the format user\@domain");   
        }  
    }  
 }  
   
 function makeims() {  
     var caller = document.forms.ims.folder.value;  
     var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one";  
     newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes");  
     newWindow.location.href = newlocation;  
 }  
   
   
 function finishpick() {  
     var title=this.document.forms.extimport.title.value;  
     var url=this.document.forms.extimport.url.value;  
     var form=this.document.forms.extimport.useform.value;  
     eval  
      ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+  
     '";this.document.forms.'+form+'.submit();');  
 }  
   
 function changename(folderpath,index,oldtitle,container,pagesymb) {  
     var title=prompt('New Title',oldtitle);  
     if (title) {  
  this.document.forms.renameform.title.value=title;  
  this.document.forms.renameform.cmd.value='rename_'+index;  
         if (container == 'sequence') {  
     this.document.forms.renameform.folderpath.value=folderpath;  
         }  
         if (container == 'page') {  
             this.document.forms.renameform.pagepath.value=folderpath;  
             this.document.forms.renameform.pagesymb.value=pagesymb;  
         }  
         this.document.forms.renameform.submit();  
     }  
 }  
   
 function removeres(folderpath,index,oldtitle,container,pagesymb) {  
     if (confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {  
  this.document.forms.renameform.cmd.value='del_'+index;  
         if (container == 'sequence') {  
             this.document.forms.renameform.folderpath.value=folderpath;  
         }  
         if (container == 'page') {  
             this.document.forms.renameform.pagepath.value=folderpath;  
             this.document.forms.renameform.pagesymb.value=pagesymb;  
         }  
         this.document.forms.renameform.submit();  
     }  
 }  
   
 function cutres(folderpath,index,oldtitle,container,pagesymb) {  
     if (confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible!\\nGrades remain inaccessible if resource is pasted into another folder.\\nCut "'+oldtitle+'"?')) {  
  this.document.forms.renameform.cmd.value='cut_'+index;  
  this.document.forms.renameform.markcopy.value=index;  
         if (container == 'sequence') {  
             this.document.forms.renameform.folderpath.value=folderpath;  
         }  
         if (container == 'page') {  
             this.document.forms.renameform.pagepath.value=folderpath;  
             this.document.forms.renameform.pagesymb.value=pagesymb;  
         }  
         this.document.forms.renameform.submit();  
     }  
 }  
   
 function markcopy(folderpath,index,oldtitle,container,pagesymb) {  
     this.document.forms.renameform.markcopy.value=index;  
     if (container == 'sequence') {  
  this.document.forms.renameform.folderpath.value=folderpath;  
     }  
     if (container == 'page') {  
  this.document.forms.renameform.pagepath.value=folderpath;  
  this.document.forms.renameform.pagesymb.value=pagesymb;  
     }      }
     this.document.forms.renameform.submit();  
 }  
   
 </script>  
   
 ENDNEWSCRIPT  
   }  
 # -------------------------------------------------------------------- Body tag  # -------------------------------------------------------------------- Body tag
   $r->print('</head>'.      $script = '<script type="text/javascript">'."\n".$script."\n".'</script>';
             &Apache::loncommon::bodytag('Course Documents','',$events,      $r->print(&Apache::loncommon::start_page('Course Documents', $script,
  '','',$showdoc).       {'add_entries'    => $events,
     &Apache::loncommon::help_open_menu('','','','',273,'RAT'));        'force_register' => $showdoc,}).
         &Apache::loncommon::help_open_menu('','','','',273,'RAT'));
     
   my %allfiles = ();    my %allfiles = ();
   my %codebase = ();    my %codebase = ();
   my ($upload_result,$upload_output);    my ($upload_result,$upload_output);
Line 2441  ENDNEWSCRIPT Line 2274  ENDNEWSCRIPT
                           $content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi;                             $content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi; 
                       }                        }
                       if (exists($codebase{$item})) {                        if (exists($codebase{$item})) {
                           $content =~ s/(codebase\s*=\s*["']?)\Q$codebase{$item}\E(["']?)/$1.$2/i;                            $content =~ s/(codebase\s*=\s*["']?)\Q$codebase{$item}\E(["']?)/$1.$2/i; #' stupid emacs
                       }                        }
                   }                    }
 # Save edited file.  # Save edited file.
Line 2478  ENDNEWSCRIPT Line 2311  ENDNEWSCRIPT
                 'navc' => 'Navigate Contents',                  'navc' => 'Navigate Contents',
                 'sipa' => 'Simple Page',                  'sipa' => 'Simple Page',
                 'sipr' => 'Simple Problem',                  'sipr' => 'Simple Problem',
                   'drbx' => 'Drop Box',
                 'scuf' => 'Score Upload Form',                  'scuf' => 'Score Upload Form',
                 'bull' => 'Bulletin Board',                  'bull' => 'Bulletin Board',
                 'mypi' => 'My Personal Info',                  'mypi' => 'My Personal Info',
Line 2530  $uploadtag Line 2364  $uploadtag
     <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}      <input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}
 $dumpbut  $dumpbut
 $exportbut  $exportbut
 </td><!-- <td bgcolor="#DDDDCC">  </td><td bgcolor="#DDDDCC">
     <input type="submit" name="listsymbs" value="$lt{'ls'}" />      <input type="submit" name="listsymbs" value="$lt{'ls'}" />
 </td>--></tr></table>  </td></tr></table>
 </form>  </form>
 ENDCOURSEVERIFY  ENDCOURSEVERIFY
        $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',         $r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc',
Line 2634  $uploadtag Line 2468  $uploadtag
 value="$lt{'extr'}" /> $help{'Adding_External_Resource'}  value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/imsimportdocs" method="post" name="ims">  <br /><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'}" onClick="javascript:makeims();" />
 </nobr>  </nobr>
Line 2644  ENDFORM Line 2478  ENDFORM
        $r->print('</td><td bgcolor="#DDDDDD">');         $r->print('</td><td bgcolor="#DDDDDD">');
        unless ($env{'form.pagepath'}) {         unless ($env{'form.pagepath'}) {
            $r->print(<<ENDFORM);             $r->print(<<ENDFORM);
 <form action="/adm/coursedocs" method="post" name="newfolder">  <br /><form action="/adm/coursedocs" method="post" name="newfolder">
 <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />  <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2653  onClick="javascript:makenewfolder(this.f Line 2487  onClick="javascript:makenewfolder(this.f
 value="$lt{'newf'}" />$help{'Adding_Folders'}  value="$lt{'newf'}" />$help{'Adding_Folders'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newpage">  <br /><form action="/adm/coursedocs" method="post" name="newpage">
 <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />  <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2662  onClick="javascript:makenewpage(this.for Line 2496  onClick="javascript:makenewpage(this.for
 value="$lt{'newp'}" />$help{'Adding_Pages'}  value="$lt{'newp'}" />$help{'Adding_Pages'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newsyl">  <br /><form action="/adm/coursedocs" method="post" name="newsyl">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail"   <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">  value="Syllabus=/public/$coursedom/$coursenum/syllabus">
Line 2671  value="Syllabus=/public/$coursedom/$cour Line 2505  value="Syllabus=/public/$coursedom/$cour
  $help{'Syllabus'}   $help{'Syllabus'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newnav">  <br /><form action="/adm/coursedocs" method="post" name="newnav">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail"   <input type=hidden name="importdetail" 
 value="Navigate Content=/adm/navmaps">  value="Navigate Content=/adm/navmaps">
Line 2680  value="Navigate Content=/adm/navmaps"> Line 2514  value="Navigate Content=/adm/navmaps">
 $help{'Navigate_Content'}  $help{'Navigate_Content'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newsmppg">  <br /><form action="/adm/coursedocs" method="post" name="newsmppg">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2688  $uploadtag Line 2522  $uploadtag
 onClick="javascript:makesmppage();" /> $help{'Simple Page'}  onClick="javascript:makesmppage();" /> $help{'Simple Page'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newsmpproblem">  <br /><form action="/adm/coursedocs" method="post" name="newsmpproblem">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2696  $uploadtag Line 2530  $uploadtag
 onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}  onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newexamupload">  <br /><form action="/adm/coursedocs" method="post" name="newdropbox">
   $uploadtag      
   <input type=hidden name="importdetail" value="">
   <nobr>          
   <input name="newdropbox" type="button" value="$lt{'drbx'}"
   onClick="javascript:makedropbox();" />
   </nobr>         
   </form> 
   <br /><form action="/adm/coursedocs" method="post" name="newexamupload">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2705  onClick="javascript:makeexamupload();" / Line 2547  onClick="javascript:makeexamupload();" /
 $help{'Score_Upload_Form'}  $help{'Score_Upload_Form'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newbul">  <br /><form action="/adm/coursedocs" method="post" name="newbul">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2714  onClick="javascript:makebulboard();" /> Line 2556  onClick="javascript:makebulboard();" />
 $help{'Bulletin Board'}  $help{'Bulletin Board'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newaboutme">  <br /><form action="/adm/coursedocs" method="post" name="newaboutme">
 $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 2723  value="$plainname=/adm/$udom/$uname/abou Line 2565  value="$plainname=/adm/$udom/$uname/abou
 $help{'My Personal Info'}  $help{'My Personal Info'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newaboutsomeone">  <br /><form action="/adm/coursedocs" method="post" name="newaboutsomeone">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2743  $uploadtag Line 2585  $uploadtag
 onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}  onClick="javascript:makesmpproblem();" />$help{'Simple Problem'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="newexamupload">  <br /><form action="/adm/coursedocs" method="post" name="newexamupload">
 $uploadtag  $uploadtag
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2816  onClick="javascript:makenewfolder(this.f Line 2658  onClick="javascript:makenewfolder(this.f
 value="$lt{'newf'}" /> $help{'Adding_Folders'}  value="$lt{'newf'}" /> $help{'Adding_Folders'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="supnewext">  <br /><form action="/adm/coursedocs" method="post" name="supnewext">
 <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />  <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail" value="">  <input type=hidden name="importdetail" value="">
 <nobr>  <nobr>
Line 2825  onClick="javascript:makenewext('supnewex Line 2667  onClick="javascript:makenewext('supnewex
 value="$lt{'extr'}" /> $help{'Adding_External_Resource'}  value="$lt{'extr'}" /> $help{'Adding_External_Resource'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="supnewsyl">  <br /><form action="/adm/coursedocs" method="post" name="supnewsyl">
 <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />  <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail"   <input type=hidden name="importdetail" 
 value="Syllabus=/public/$coursedom/$coursenum/syllabus">  value="Syllabus=/public/$coursedom/$coursenum/syllabus">
Line 2834  value="Syllabus=/public/$coursedom/$cour Line 2676  value="Syllabus=/public/$coursedom/$cour
 $help{'Syllabus'}  $help{'Syllabus'}
 </nobr>  </nobr>
 </form>  </form>
 <form action="/adm/coursedocs" method="post" name="subnewaboutme">  <br /><form action="/adm/coursedocs" method="post" name="subnewaboutme">
 <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />  <input type="hidden" name="folderpath" value="$env{'form.folderpath'}" />
 <input type=hidden name="importdetail"   <input type=hidden name="importdetail" 
 value="$plainname=/adm/$udom/$uname/aboutme">  value="$plainname=/adm/$udom/$uname/aboutme">
Line 2862  ENDSUPFORM Line 2704  ENDSUPFORM
       }        }
   }    }
  }   }
  $r->print('</body></html>');   $r->print(&Apache::loncommon::end_page());
  return OK;   return OK;
 }   } 
   
   
   sub editing_js {
       my ($udom,$uname) = @_;
       my $now = time();
   
       return <<ENDNEWSCRIPT;
   function makenewfolder(targetform,folderseq) {
       var foldername=prompt('Name of New Folder','New Folder');
       if (foldername) {
          targetform.importdetail.value=foldername+"="+folderseq;
           targetform.submit();
       }
   }
   
   function makenewpage(targetform,folderseq) {
       var pagename=prompt('Name of New Page','New Page');
       if (pagename) {
           targetform.importdetail.value=pagename+"="+folderseq;
           targetform.submit();
       }
   }
   
   function makenewext(targetname) {
       this.document.forms.extimport.useform.value=targetname;
       window.open('/adm/rat/extpickframe.html');
   }
   
   function makeexamupload() {
      var title=prompt('Listed Title for the Uploaded Score');
      if (title) { 
       this.document.forms.newexamupload.importdetail.value=
    title+'=/res/lib/templates/examupload.problem';
       this.document.forms.newexamupload.submit();
      }
   }
   
   function makesmppage() {
      var title=prompt('Listed Title for the Page');
      if (title) { 
       this.document.forms.newsmppg.importdetail.value=
    title+'=/adm/$udom/$uname/$now/smppg';
       this.document.forms.newsmppg.submit();
      }
   }
   
   function makesmpproblem() {
      var title=prompt('Listed Title for the Problem');
      if (title) { 
       this.document.forms.newsmpproblem.importdetail.value=
    title+'=/res/lib/templates/simpleproblem.problem';
       this.document.forms.newsmpproblem.submit();
      }
   }
   
   function makedropbox() {
      var title=prompt('Listed Title for the Drop Box');
      if (title) { 
       this.document.forms.newdropbox.importdetail.value=
           title+'=/res/lib/templates/DropBox.problem';
       this.document.forms.newdropbox.submit();
      }
   }
   
   function makebulboard() {
      var title=prompt('Listed Title for the Bulletin Board');
      if (title) {
       this.document.forms.newbul.importdetail.value=
    title+'=/adm/$udom/$uname/$now/bulletinboard';
       this.document.forms.newbul.submit();
      }
   }
   
   function makeabout() {
      var user=prompt("Enter user\@domain for User's 'About Me' Page");
      if (user) {
          var comp=new Array();
          comp=user.split('\@');
          if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) {
      if ((comp[0]) && (comp[1])) {
          this.document.forms.newaboutsomeone.importdetail.value=
      'About '+user+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';
          this.document.forms.newaboutsomeone.submit();
      } else {
                  alert("Not a valid user\@domain");
              }
          } else {
              alert("Please enter both user and domain in the format user\@domain"); 
          }
      }
   }
   
   function makeims() {
       var caller = document.forms.ims.folder.value;
       var newlocation = "/adm/imsimportdocs?folder="+caller+"&phase=one";
       newWindow = window.open("","IMSimport","HEIGHT=700,WIDTH=750,scrollbars=yes");
       newWindow.location.href = newlocation;
   }
   
   
   function finishpick() {
       var title=this.document.forms.extimport.title.value;
       var url=this.document.forms.extimport.url.value;
       var form=this.document.forms.extimport.useform.value;
       eval
        ('this.document.forms.'+form+'.importdetail.value="'+title+'='+url+
       '";this.document.forms.'+form+'.submit();');
   }
   
   function changename(folderpath,index,oldtitle,container,pagesymb) {
       var title=prompt('New Title',oldtitle);
       if (title) {
    this.document.forms.renameform.title.value=title;
    this.document.forms.renameform.cmd.value='rename_'+index;
           if (container == 'sequence') {
       this.document.forms.renameform.folderpath.value=folderpath;
           }
           if (container == 'page') {
               this.document.forms.renameform.pagepath.value=folderpath;
               this.document.forms.renameform.pagesymb.value=pagesymb;
           }
           this.document.forms.renameform.submit();
       }
   }
   
   function removeres(folderpath,index,oldtitle,container,pagesymb) {
       if (confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {
    this.document.forms.renameform.cmd.value='del_'+index;
           if (container == 'sequence') {
               this.document.forms.renameform.folderpath.value=folderpath;
           }
           if (container == 'page') {
               this.document.forms.renameform.pagepath.value=folderpath;
               this.document.forms.renameform.pagesymb.value=pagesymb;
           }
           this.document.forms.renameform.submit();
       }
   }
   
   function cutres(folderpath,index,oldtitle,container,pagesymb) {
       if (confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible!\\nGrades remain inaccessible if resource is pasted into another folder.\\nCut "'+oldtitle+'"?')) {
    this.document.forms.renameform.cmd.value='cut_'+index;
    this.document.forms.renameform.markcopy.value=index;
           if (container == 'sequence') {
               this.document.forms.renameform.folderpath.value=folderpath;
           }
           if (container == 'page') {
               this.document.forms.renameform.pagepath.value=folderpath;
               this.document.forms.renameform.pagesymb.value=pagesymb;
           }
           this.document.forms.renameform.submit();
       }
   }
   
   function markcopy(folderpath,index,oldtitle,container,pagesymb) {
       this.document.forms.renameform.markcopy.value=index;
       if (container == 'sequence') {
    this.document.forms.renameform.folderpath.value=folderpath;
       }
       if (container == 'page') {
    this.document.forms.renameform.pagepath.value=folderpath;
    this.document.forms.renameform.pagesymb.value=pagesymb;
       }
       this.document.forms.renameform.submit();
   }
   
   ENDNEWSCRIPT
   }
 1;  1;
 __END__  __END__

Removed from v.1.212  
changed lines
  Added in v.1.224


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