Diff for /loncom/interface/londocs.pm between versions 1.335 and 1.343

version 1.335, 2009/02/03 18:31:59 version 1.343, 2009/02/16 10:33:32
Line 1899  END Line 1899  END
     }      }
           
     my $orig_url = $url;      my $orig_url = $url;
       $orig_url=~s{http(:|:)//https(:|:)//}{https$2//};
     my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/});      my $external = ($url=~s{^http(|s)(:|:)//}{/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(
Line 2760  sub handler { Line 2761  sub handler {
                 'extr' => 'External Resource',                  'extr' => 'External Resource',
                 'syll' => 'Syllabus',                  'syll' => 'Syllabus',
                 'navc' => 'Navigate Contents',                  'navc' => 'Navigate Contents',
                 'sipa' => 'Simple Page',                  'sipa' => 'Simple Course Page',
                 'sipr' => 'Simple Problem',                  'sipr' => 'Simple Problem',
                 'drbx' => 'Drop Box',                  'drbx' => 'Drop Box',
                 'scuf' => 'Score Upload Form',                  'scuf' => 'Score Upload Form',
                 'bull' => 'Bulletin Board',                  'bull' => 'Discussion Board',
                 'mypi' => 'My Personal Info',                  'mypi' => 'My Personal Info',
                 'grpo' => 'Group Files',                  'grpo' => 'Group Files',
                 'rost' => 'Course Roster',                  'rost' => 'Course Roster',
Line 2872  ERFORM Line 2873  ERFORM
            $containertag = '<input type="hidden" name="folderpath" value="" />';             $containertag = '<input type="hidden" name="folderpath" value="" />';
            $uploadtag = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($folderpath,'<>&"').'" />';             $uploadtag = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($folderpath,'<>&"').'" />';
        }         }
    $r->print(<<HIDDENFORM);
        $r->print(&generate_admin_options($containertag,$uploadtag,\%lt,\%help,\%env));   <form name="renameform" method="post" action="/adm/coursedocs">
      <input type="hidden" name="title" />
      <input type="hidden" name="cmd" />
      <input type="hidden" name="markcopy" />
      <input type="hidden" name="copyfolder" />
      $containertag
    </form>
    <form name="simpleedit" method="post" action="/adm/coursedocs">
      <input type="hidden" name="importdetail" value="" />
      $uploadtag
    </form>
   HIDDENFORM
     }      }
 # --------------------------------------------------------- Main tab structure  # --------------------------------------------------------- Main tab structure
     my $activeClass = 1;      my $activeClass = 1;
     $r->print('<div class="LC_ContentBoxSpecial"><ul class="LC_TabContent" id="mainnav">');      $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
     if (($standard) && ($allowed) && (!$forcesupplement)) {      if (($standard) && ($allowed) && (!$forcesupplement)) {
  my $active = '';   my $active = '';
         if($activeClass == 1){          if($activeClass == 1){
Line 2893  ERFORM Line 2905  ERFORM
         }          }
  $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,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>');
     }      }
     $r->print('</ul><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');      $r->print('<li onclick="javascript:showPage(this,\'Special Admin Options\',\'mainnav\',\'maincoursedoc\');">'.&mt('Special Admin Options').'</li>');
       $r->print('</ul><div class="LC_ContentBoxSpecial" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
     if (($standard) && ($allowed) && (!$forcesupplement)) {      if (($standard) && ($allowed) && (!$forcesupplement)) {
        my $active = 'style="display: none;"';         my $active = 'style="display: none;"';
Line 2916  ERFORM Line 2929  ERFORM
        } else {         } else {
            #$postexec='self.close();';             #$postexec='self.close();';
        }         }
        $hadchanges=0;  
        if ($hadchanges) {  
    &mark_hash_old();  
        }  
        &changewarning($r,$postexec);  
        my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.         my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
                      '.sequence';                       '.sequence';
        my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.         my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time.
Line 3051  NASOFORM Line 3059  NASOFORM
  </form>   </form>
 NROSTFORM  NROSTFORM
   
   my $specialdocumentsform;
   
        unless ($env{'form.pagepath'}) {         unless ($env{'form.pagepath'}) {
    my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');     my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
   
Line 3102  NSYLFORM Line 3112  NSYLFORM
  </form>   </form>
 NGFFORM  NGFFORM
   
    $specialdocumentsform="<br />$newfolderform<br />$newpageform<br />$newsylform<br />$newgroupfileform";
         my $specialdocumentsform=(<<SPDOFORM);        }
  <br />$newfolderform   $specialdocumentsform.="<br />$newnavform<br />$newsmppageform
  <br />$newpageform   <br />$newsmpproblemform<br />$newdropboxform
  <br />$newsylform          <br />$newexuploadform<br />$newbulform
  <br />$newnavform          <br />$newaboutmeform<br />$newaboutsomeoneform
  <br />$newsmppageform          <br />$newrosterform";
  <br />$newsmpproblemform  if($env{'form.pagepath'}) {
  <br />$newdropboxform   $specialdocumentsform="<br />$newsmpproblemform<br />$newexuploadform";
  <br />$newexuploadform  }
  <br />$newbulform  
  <br />$newaboutmeform  
  <br />$newaboutsomeoneform  
  <br />$newgroupfileform  
  <br />$newrosterform  
 SPDOFORM  
   
   
 my %orderhash = (  my %orderhash = (
                 'aa' => 'New Document',                  'aa' => 'New Document',
Line 3137  my $tid='1'; Line 3140  my $tid='1';
 my $content='content';  my $content='content';
 my $navigation='navigation';  my $navigation='navigation';
 my $varcd = 'Main Course Documents';  my $varcd = 'Main Course Documents';
 $r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash));   $r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash));
 my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);   $hadchanges=0;
           my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
        if ($error) {         if ($error) {
            $r->print('<p><span class="LC_error">'.$error.'</span></p>');             $r->print('<p><span class="LC_error">'.$error.'</span></p>');
        }         }
          if ($hadchanges) {
              &mark_hash_old();
          }
   
          &changewarning($r,'');
 $r->print('</div>');  $r->print('</div>');
       }  
        if ($env{'form.pagepath'}) {         if ($env{'form.pagepath'}) {
        }         }
     }      }
Line 3264  my $error = &editor($r,$coursenum,$cours Line 3272  my $error = &editor($r,$coursenum,$cours
        if ($error) {         if ($error) {
            $r->print('<p><span class="LC_error">'.$error.'</span></p>');             $r->print('<p><span class="LC_error">'.$error.'</span></p>');
        }         }
 $r->print('</div)');  $r->print('</div>');
  }    } 
    }     }
   $r->print('<div class="LC_ContentBox" id="Special Admin Options" style="display: none;">');
   $r->print(&generate_admin_options($containertag,$uploadtag,\%help,\%env));
   $r->print('</div>');
 $r->print('</div>');  $r->print('</div>');
     if ($allowed) {      if ($allowed) {
  $r->print('   $r->print('
Line 3292  $r->print('</div>'); Line 3303  $r->print('</div>');
 }   } 
   
 sub generate_admin_options {  sub generate_admin_options {
   my ($containertag,$uploadtag,$lt_ref,$help_ref,$env_ref) = @_;    my ($containertag,$uploadtag,$help_ref,$env_ref) = @_;
   my %lt = %{$lt_ref};   my %lt=&Apache::lonlocal::texthash(
                                            'vc' => 'Verify Content',
                                            'cv' => 'Check/Set Resource Versions',
                                            'ls' => 'List Symbs',
                                            'sl' => 'Show Log'
                                             );
   my %help = %{$help_ref};    my %help = %{$help_ref};
   my %env = %{$env_ref};    my %env = %{$env_ref};
   my $dumpbut=&dumpbutton();    my $dumpbut=&dumpbutton();
   my $exportbut=&exportbutton();    my $exportbut=&exportbutton();
   return (<<ENDOPTIONFORM);    return (<<ENDOPTIONFORM);
  <form name="renameform" method="post" action="/adm/coursedocs">  
    <input type="hidden" name="title" />  
    <input type="hidden" name="cmd" />  
    <input type="hidden" name="markcopy" />  
    <input type="hidden" name="copyfolder" />  
    $containertag  
  </form>  
  <form name="simpleedit" method="post" action="/adm/coursedocs">  
    <input type="hidden" name="importdetail" value="" />  
    $uploadtag  
  </form>  
  <form action="/adm/coursedocs" method="post" name="courseverify">   <form action="/adm/coursedocs" method="post" name="courseverify">
    <ul style="list-style-type:none">     <ul style="list-style-type:none">
        <li>         <li>
Line 3333  sub generate_admin_options { Line 3338  sub generate_admin_options {
         </li>          </li>
    </ul>     </ul>
  </form>   </form>
  <div style="clear: both; height: 0px;">&nbsp;</div>  <!-- <div style="clear: both; height: 0px;">&nbsp;</div>-->
 ENDOPTIONFORM  ENDOPTIONFORM
   
 }  }
Line 3341  ENDOPTIONFORM Line 3346  ENDOPTIONFORM
   
 sub generate_edit_table {  sub generate_edit_table {
     my ($tid,$content,$navigation,$varcd,$namehash_ref,$orderhash_ref) = @_;      my ($tid,$content,$navigation,$varcd,$namehash_ref,$orderhash_ref) = @_;
     my %namehash = %{$namehash_ref};             #name verlinkt mit id      my %namehash = %{$namehash_ref};
     my %orderhash = %{$orderhash_ref};           #name mit kürzel verlinkt mit name      my %orderhash = %{$orderhash_ref};
     my $form;      my $form;    
   
       
   
     $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';      $form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>';
     $form .= '<ul id="'.$navigation.$tid.'" class="LC_TabContent">';      $form .= '<ul id="'.$navigation.$tid.'" class="LC_TabContent">';
Line 3356  sub generate_edit_table { Line 3359  sub generate_edit_table {
             $form .= '<li onclick="javascript:showPage(this, \''.$tid.$orderhash{$name}.'\', \''.$navigation.$tid.'\',\''.$content.$tid.'\');">'.&mt($orderhash{$name}).'</li>';              $form .= '<li onclick="javascript:showPage(this, \''.$tid.$orderhash{$name}.'\', \''.$navigation.$tid.'\',\''.$content.$tid.'\');">'.&mt($orderhash{$name}).'</li>';
         }          }
     }      }
       $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(%namehash)){      foreach my $field (keys(%namehash)){
         $form .= '<div id="'.$tid.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';          $form .= '<div id="'.$tid.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>';
Line 3377  sub editing_js { Line 3381  sub editing_js {
                                           p_msp => 'Title for the Page',                                            p_msp => 'Title for the Page',
                                           p_msb => 'Title for the Problem',                                            p_msb => 'Title for the Problem',
                                           p_mdb => 'Title for the Drop Box',                                            p_mdb => 'Title for the Drop Box',
                                           p_mbb => 'Title for the Bulletin Board',                                            p_mbb => 'Title for the Discussion Board',
                                           p_mab => "Enter user:domain for User's 'About Me' Page",                                            p_mab => "Enter user:domain for User's 'About Me' Page",
                                           p_mab2 => "About [_99]",                                            p_mab2 => "About [_99]",
                                           p_mab_alrt1 => 'Not a valid user:domain',                                            p_mab_alrt1 => 'Not a valid user:domain',

Removed from v.1.335  
changed lines
  Added in v.1.343


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