Diff for /loncom/interface/londocs.pm between versions 1.293.2.1 and 1.306

version 1.293.2.1, 2007/07/19 00:08:04 version 1.306, 2008/05/22 17:47:33
Line 1205  sub update_paste_buffer { Line 1205  sub update_paste_buffer {
     }      }
     $url=~s{http(:|:)//https(:|:)//}{https$2//};      $url=~s{http(:|:)//https(:|:)//}{https$2//};
   
     &Apache::lonnet::appenv('docs.markedcopy_title' => $title,      &Apache::lonnet::appenv({'docs.markedcopy_title' => $title,
     'docs.markedcopy_url'   => $url);      'docs.markedcopy_url'   => $url});
     delete($env{'form.markcopy'});      delete($env{'form.markcopy'});
 }  }
   
Line 1227  ENDPASTE Line 1227  ENDPASTE
   &LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')');    &LONCAPA::map::qtescape($env{'docs.markedcopy_url'}).')');
     }  else {      }  else {
  my $extension = (split(/\./,$env{'docs.markedcopy_url'}))[-1];   my $extension = (split(/\./,$env{'docs.markedcopy_url'}))[-1];
  my $type = &Apache::loncommon::filedescription($extension);   my $icon = &Apache::loncommon::icon($extension);
  my $icon = '<img src="'.&Apache::loncommon::icon($extension).   if ($extension eq 'sequence' &&
     '" alt="" class="LC_icon" />';      $env{'docs.markedcopy_url'} =~ m{/default_\d+\.sequence$ }x) {
       $icon = &Apache::loncommon::lonhttpdurl($r->dir_config('lonIconsURL'));
       $icon .= '/folder_closed.gif';
    }
    $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'})));
     }      }
     if ($container eq 'page') {      if ($container eq 'page') {
Line 1467  sub editor { Line 1471  sub editor {
  $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>');   $r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>');
     }      }
     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. Do not modify the contents of this folder if it is in active student use.').'</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('<table class="LC_docs_editor">');
     foreach my $res (@LONCAPA::map::order) {      foreach my $res (@LONCAPA::map::order) {
Line 1698  sub entryline { Line 1702  sub entryline {
     my $line='<tr>';      my $line='<tr>';
     my ($form_start,$form_end);      my ($form_start,$form_end);
 # Edit commands  # Edit commands
     my $container;  
     my ($container, $type, $esc_path, $path, $symb);      my ($container, $type, $esc_path, $path, $symb);
     if ($env{'form.folderpath'}) {      if ($env{'form.folderpath'}) {
  $type = 'folder';   $type = 'folder';
Line 1751  sub entryline { Line 1754  sub entryline {
  # no copy for published maps   # no copy for published maps
  $nocopy = 1;   $nocopy = 1;
     } else {      } else {
  foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$url))) {   foreach (&Apache::lonsequence::attemptread(&Apache::lonnet::filelocation('',$url),1)) {
     my ($title,$url,$ext,$type)=split(/\:/,$_);      my ($title,$url,$ext,$type)=split(/\:/,$_);
     if (($url=~/\.(page|sequence)/) && ($type ne 'zombie')) {      if (($url=~/\.(page|sequence)/) && ($type ne 'zombie')) {
  $nocopy=1;   $nocopy=1;
Line 2436  sub init_breadcrumbs { Line 2439  sub init_breadcrumbs {
     my ($form,$text)=@_;      my ($form,$text)=@_;
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",      &Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
     text=>&Apache::loncommon::course_type()." Documents",      text=>"Edit ".&Apache::loncommon::course_type(),
     faq=>273,      faq=>273,
     bug=>'Instructor Interface',      bug=>'Instructor Interface',
                                             help => 'Docs_Adding_Course_Doc'});                                              help => 'Docs_Adding_Course_Doc'});
Line 2571  sub handler { Line 2574  sub handler {
       if (($env{'form.uploaddoc.filename'}) &&        if (($env{'form.uploaddoc.filename'}) &&
   ($env{'form.cmd'}=~/^upload_(\w+)/)) {    ($env{'form.cmd'}=~/^upload_(\w+)/)) {
 # Process file upload - phase one - upload and parse primary file.    # Process file upload - phase one - upload and parse primary file.  
     undef($hadchanges);
           $upload_result = &process_file_upload(\$upload_output,$coursenum,            $upload_result = &process_file_upload(\$upload_output,$coursenum,
  $coursedom,\%allfiles,   $coursedom,\%allfiles,
  \%codebase,$1);   \%codebase,$1);
     if ($hadchanges) {
         &mark_hash_old();
     }
           if ($upload_result eq 'phasetwo') {            if ($upload_result eq 'phasetwo') {
               $r->print($upload_output);                $r->print($upload_output);
           }            }
Line 2675  sub handler { Line 2682  sub handler {
                 'bull' => 'Bulletin Board',                  'bull' => 'Bulletin Board',
                 'mypi' => 'My Personal Info',                  'mypi' => 'My Personal Info',
                 'grpo' => 'Group Files',                  'grpo' => 'Group Files',
                   'rost' => 'Course Roster',
  'abou' => 'About User',   'abou' => 'About User',
                 'imsf' => 'Import IMS package',                  'imsf' => 'Import IMS package',
                 'file' =>  'File',                  'file' =>  'File',
Line 2803  $uploadtag Line 2811  $uploadtag
 <br />  <br />
 <span class="LC_nobreak">  <span class="LC_nobreak">
 <label>$lt{'parse'}?  <label>$lt{'parse'}?
 <input type="checkbox" name="parserflag" />  <input type="checkbox" name="parserflag" checked="checked" />
 </label>  </label>
 </span>  </span>
 <br />  <br />
Line 2883  value="$lt{'newp'}" />$help{'Adding_Page Line 2891  value="$lt{'newp'}" />$help{'Adding_Page
 <br /><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="$lt{'syll'}=/public/$coursedom/$coursenum/syllabus" />
 <span class="LC_nobreak">  <span class="LC_nobreak">
 <input name="newsyl" type="submit" value="$lt{'syll'}" />   <input name="newsyl" type="submit" value="$lt{'syll'}" /> 
  $help{'Syllabus'}   $help{'Syllabus'}
Line 2892  value="Syllabus=/public/$coursedom/$cour Line 2900  value="Syllabus=/public/$coursedom/$cour
 <br /><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="$lt{'navc'}=/adm/navmaps" />
 <span class="LC_nobreak">  <span class="LC_nobreak">
 <input name="newnav" type="submit" value="$lt{'navc'}" />  <input name="newnav" type="submit" value="$lt{'navc'}" />
 $help{'Navigate_Content'}  $help{'Navigate_Content'}
Line 2960  onClick="javascript:makeabout();" /> Line 2968  onClick="javascript:makeabout();" />
 <br /><form action="/adm/coursedocs" method="post" name="newgroupfiles">  <br /><form action="/adm/coursedocs" method="post" name="newgroupfiles">
 $uploadtag  $uploadtag
 <input type="hidden" name="importdetail"  <input type="hidden" name="importdetail"
 value="Group Files=/adm/$coursedom/$coursenum/aboutme" />  value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" />
 <span class="LC_nobreak">  <span class="LC_nobreak">
 <input name="newgroupfiles" type="submit" value="$lt{'grpo'}" />  <input name="newgroupfiles" type="submit" value="$lt{'grpo'}" />
 $help{'Group Files'}  $help{'Group Files'}
 </span>  </span>
 </form>  </form>
   <br /><form action="/adm/coursedocs" method="post" name="newroster">
   $uploadtag
   <input type="hidden" name="importdetail" 
   value="$lt{'rost'}=/adm/viewclasslist" />
   <span class="LC_nobreak">
   <input name="newroster" type="submit" value="$lt{'rost'}" />
   $help{'Course Roster'}
   </span>
   </form>
 ENDFORM  ENDFORM
        }         }
        if ($env{'form.pagepath'}) {         if ($env{'form.pagepath'}) {
Line 3115  ENDSUPFORM Line 3132  ENDSUPFORM
 sub editing_js {  sub editing_js {
     my ($udom,$uname) = @_;      my ($udom,$uname) = @_;
     my $now = time();      my $now = time();
       my %lt = &Apache::lonlocal::texthash(
                                             p_mnf => 'Name of New Folder',
                                             t_mnf => 'New Folder',
                                             p_mnp => 'Name of New Page',
                                             t_mnp => 'New Page',
                                             p_mxu => 'Title for the Uploaded Score',
                                             p_msp => 'Title for the Page',
                                             p_msb => 'Title for the Problem',
                                             p_mdb => 'Title for the Drop Box',
                                             p_mbb => 'Title for the Bulletin Board',
                                             p_mab => "Enter user:domain for User's 'About Me' Page",
                                             p_mab2 => "About [_99]",
                                             p_mab_alrt1 => 'Not a valid user:domain',
                                             p_mab_alrt2 => 'Please enter both user and domain in the format user:domain',
                                             p_chn => 'New Title',
                                             p_rmr1 => 'WARNING: Removing a resource makes associated grades and scores inaccessible!',
                                             p_rmr2a => 'Remove[_99]',
                                             p_rmr2b => '?[_99]',
                                             p_ctr1a => 'WARNING: Cutting a resource makes associated grades and scores inaccessible!',
                                             p_ctr1b => 'Grades remain inaccessible if resource is pasted into another folder.',
                                             p_ctr2a => 'Cut[_98]',
                                             p_ctr2b => '?[_98]'
                                           );
   
     return <<ENDNEWSCRIPT;      return <<ENDNEWSCRIPT;
 function makenewfolder(targetform,folderseq) {  function makenewfolder(targetform,folderseq) {
     var foldername=prompt('Name of New Folder','New Folder');      var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}');
     if (foldername) {      if (foldername) {
        targetform.importdetail.value=escape(foldername)+"="+folderseq;         targetform.importdetail.value=escape(foldername)+"="+folderseq;
         targetform.submit();          targetform.submit();
Line 3126  function makenewfolder(targetform,folder Line 3166  function makenewfolder(targetform,folder
 }  }
   
 function makenewpage(targetform,folderseq) {  function makenewpage(targetform,folderseq) {
     var pagename=prompt('Name of New Page','New Page');      var pagename=prompt('$lt{"p_mnp"}','$lt{"t_mnp"}');
     if (pagename) {      if (pagename) {
         targetform.importdetail.value=escape(pagename)+"="+folderseq;          targetform.importdetail.value=escape(pagename)+"="+folderseq;
         targetform.submit();          targetform.submit();
Line 3150  function edittext(targetname,residx,titl Line 3190  function edittext(targetname,residx,titl
 }  }
   
 function makeexamupload() {  function makeexamupload() {
    var title=prompt('Listed Title for the Uploaded Score');     var title=prompt('$lt{"p_mxu"}');
    if (title) {      if (title) { 
     this.document.forms.newexamupload.importdetail.value=      this.document.forms.newexamupload.importdetail.value=
  escape(title)+'=/res/lib/templates/examupload.problem';   escape(title)+'=/res/lib/templates/examupload.problem';
Line 3159  function makeexamupload() { Line 3199  function makeexamupload() {
 }  }
   
 function makesmppage() {  function makesmppage() {
    var title=prompt('Listed Title for the Page');     var title=prompt('$lt{"p_msp"}');
    if (title) {      if (title) { 
     this.document.forms.newsmppg.importdetail.value=      this.document.forms.newsmppg.importdetail.value=
  escape(title)+'=/adm/$udom/$uname/$now/smppg';   escape(title)+'=/adm/$udom/$uname/$now/smppg';
Line 3168  function makesmppage() { Line 3208  function makesmppage() {
 }  }
   
 function makesmpproblem() {  function makesmpproblem() {
    var title=prompt('Listed Title for the Problem');     var title=prompt('$lt{"p_msb"}');
    if (title) {      if (title) { 
     this.document.forms.newsmpproblem.importdetail.value=      this.document.forms.newsmpproblem.importdetail.value=
  escape(title)+'=/res/lib/templates/simpleproblem.problem';   escape(title)+'=/res/lib/templates/simpleproblem.problem';
Line 3177  function makesmpproblem() { Line 3217  function makesmpproblem() {
 }  }
   
 function makedropbox() {  function makedropbox() {
    var title=prompt('Listed Title for the Drop Box');     var title=prompt('$lt{"p_mdb"}');
    if (title) {      if (title) { 
     this.document.forms.newdropbox.importdetail.value=      this.document.forms.newdropbox.importdetail.value=
         escape(title)+'=/res/lib/templates/DropBox.problem';          escape(title)+'=/res/lib/templates/DropBox.problem';
Line 3186  function makedropbox() { Line 3226  function makedropbox() {
 }  }
   
 function makebulboard() {  function makebulboard() {
    var title=prompt('Listed Title for the Bulletin Board');     var title=prompt('$lt{"p_mbb"}');
    if (title) {     if (title) {
     this.document.forms.newbul.importdetail.value=      this.document.forms.newbul.importdetail.value=
  escape(title)+'=/adm/$udom/$uname/$now/bulletinboard';   escape(title)+'=/adm/$udom/$uname/$now/bulletinboard';
Line 3195  function makebulboard() { Line 3235  function makebulboard() {
 }  }
   
 function makeabout() {  function makeabout() {
    var user=prompt("Enter user:domain for User's 'About Me' Page");     var user=prompt("$lt{'p_mab'}");
    if (user) {     if (user) {
        var comp=new Array();         var comp=new Array();
        comp=user.split(':');         comp=user.split(':');
        if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) {         if ((typeof(comp[0])!=undefined) && (typeof(comp[1])!=undefined)) {
    if ((comp[0]) && (comp[1])) {     if ((comp[0]) && (comp[1])) {
        this.document.forms.newaboutsomeone.importdetail.value=         this.document.forms.newaboutsomeone.importdetail.value=
    'About '+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';     '$lt{"p_mab2"}'+escape(user)+'=/adm/'+comp[1]+'/'+comp[0]+'/aboutme';
        this.document.forms.newaboutsomeone.submit();         this.document.forms.newaboutsomeone.submit();
    } else {     } else {
                alert("Not a valid user:domain");                 alert("$lt{'p_mab_alrt1'}");
            }             }
        } else {         } else {
            alert("Please enter both user and domain in the format user:domain");              alert("$lt{'p_mab_alrt2'}");
        }         }
    }     }
 }  }
Line 3230  function finishpick() { Line 3270  function finishpick() {
 }  }
   
 function changename(folderpath,index,oldtitle,container,pagesymb) {  function changename(folderpath,index,oldtitle,container,pagesymb) {
     var title=prompt('New Title',oldtitle);      var title=prompt('$lt{"p_chn"}',oldtitle);
     if (title) {      if (title) {
  this.document.forms.renameform.markcopy.value=-1;   this.document.forms.renameform.markcopy.value=-1;
  this.document.forms.renameform.title.value=title;   this.document.forms.renameform.title.value=title;
Line 3247  function changename(folderpath,index,old Line 3287  function changename(folderpath,index,old
 }  }
   
 function removeres(folderpath,index,oldtitle,container,pagesymb,skip_confirm) {  function removeres(folderpath,index,oldtitle,container,pagesymb,skip_confirm) {
     if (skip_confirm || confirm('WARNING: Removing a resource makes associated grades and scores inaccessible!\\nRemove "'+oldtitle+'"?')) {      if (skip_confirm || confirm('$lt{"p_rmr1"}\\n\\n$lt{"p_rmr2a"} "'+oldtitle+'" $lt{"p_rmr2b"}')) {
  this.document.forms.renameform.markcopy.value=-1;   this.document.forms.renameform.markcopy.value=-1;
  this.document.forms.renameform.cmd.value='del_'+index;   this.document.forms.renameform.cmd.value='del_'+index;
         if (container == 'sequence') {          if (container == 'sequence') {
Line 3262  function removeres(folderpath,index,oldt Line 3302  function removeres(folderpath,index,oldt
 }  }
   
 function cutres(folderpath,index,oldtitle,container,pagesymb,folder,skip_confirm) {  function cutres(folderpath,index,oldtitle,container,pagesymb,folder,skip_confirm) {
     if (skip_confirm || confirm('WARNING: Cutting a resource makes associated grades and scores inaccessible!\\nGrades remain inaccessible if resource is pasted into another folder.\\nCut "'+oldtitle+'"?')) {      if (skip_confirm || confirm('$lt{"p_ctr1a"}\\n$lt{"p_ctr1b"}\\n\\n$lt{"p_ctr2a"} "'+oldtitle+'" $lt{"p_ctr2b"}')) {
  this.document.forms.renameform.cmd.value='cut_'+index;   this.document.forms.renameform.cmd.value='cut_'+index;
  this.document.forms.renameform.markcopy.value=index;   this.document.forms.renameform.markcopy.value=index;
  this.document.forms.renameform.copyfolder.value=folder+'.'+container;   this.document.forms.renameform.copyfolder.value=folder+'.'+container;

Removed from v.1.293.2.1  
changed lines
  Added in v.1.306


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