Diff for /loncom/interface/londocs.pm between versions 1.394 and 1.398

version 1.394, 2009/10/17 00:09:26 version 1.398, 2009/10/20 12:26:02
Line 998  sub group_import { Line 998  sub group_import {
 }  }
   
 sub breadcrumbs {  sub breadcrumbs {
     my ($where,$allowed,$type)=@_;      my ($allowed,$type)=@_;
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     my (@folders);      my (@folders);
     if ($env{'form.pagepath'}) {      if ($env{'form.pagepath'}) {
Line 1013  sub breadcrumbs { Line 1013  sub breadcrumbs {
     my $isencrypted=0;      my $isencrypted=0;
     my $ishidden=0;      my $ishidden=0;
     my $is_random_order=0;      my $is_random_order=0;
       if (!$allowed) {
           my $description = $env{'course.'.$env{'request.course.id'}.'.description'};
           &Apache::lonhtmlcommon::add_breadcrumb(
                                                  {'href' => '/adm/menu',
                                                   'title'=> 'Go to main menu',
                                                   'text' => $description,
                                                  });
           $plain .= $description.' >';
       }
     while (@folders) {      while (@folders) {
  my $folder=shift(@folders);   my $folder=shift(@folders);
     my $foldername=shift(@folders);      my $foldername=shift(@folders);
Line 1503  sub editor { Line 1512  sub editor {
         $LONCAPA::map::resources[$idx]='';          $LONCAPA::map::resources[$idx]='';
     }      }
   
     my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)=      my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
  &breadcrumbs($folder,$allowed,$type);      if ($allowed) {
     $r->print($breadcrumbtrail);          ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) =
       &breadcrumbs($allowed,$type);
           $r->print($breadcrumbtrail);
       } else {
           $randompick = -1;
       }
   
 # ------------------------------------------------------------ Process commands  # ------------------------------------------------------------ Process commands
   
Line 2047  END Line 2061  END
  $url.='pagepath='.&escape($pagepath).   $url.='pagepath='.&escape($pagepath).
     '&pagesymb='.&escape($symb).$cpinfo;      '&pagesymb='.&escape($symb).$cpinfo;
     }      }
     if ($external) {      if (($external) && ($allowed)) {
  my $form = ($folder =~ /^default/)? 'newext' : 'supnewext';   my $form = ($folder =~ /^default/)? 'newext' : 'supnewext';
  $external = '&nbsp;<a class="LC_docs_ext_edit" href="javascript:edittext(\''.$form.'\',\''.$residx.'\',\''.&escape($title).'\',\''.&escape($orig_url).'\');" >'.&mt('Edit').'</a>';   $external = '&nbsp;<a class="LC_docs_ext_edit" href="javascript:edittext(\''.$form.'\',\''.$residx.'\',\''.&escape($title).'\',\''.&escape($orig_url).'\');" >'.&mt('Edit').'</a>';
     } else {      } else {
Line 2756  sub create_form_ul { Line 2770  sub create_form_ul {
                      'Docs_Adding_Course_Doc')                       'Docs_Adding_Course_Doc')
         );          );
     } else {      } else {
         my $lc_type = lc($type);          my $folder=$env{'form.folder'};
         &Apache::lonhtmlcommon::add_breadcrumb({          if ($folder eq '' || $folder eq 'supplemental') {
             href=>"/adm/coursedocs",text=>"Supplemental $lc_type documents"});              $env{'form.folderpath'} = 'supplemental&'.
                                         &escape(&mt('Supplemental '.$type.' Documents'));
           }
           my ($breadcrumbtrail) = &breadcrumbs($allowed,$type);
         $r->print(&Apache::loncommon::start_page("Supplemental documents").          $r->print(&Apache::loncommon::start_page("Supplemental documents").
                   &Apache::lonhtmlcommon::breadcrumbs());                    $breadcrumbtrail);
     }      }
   
   my %allfiles = ();    my %allfiles = ();
Line 2994  ERFORM Line 3010  ERFORM
 HIDDENFORM  HIDDENFORM
     }      }
 # --------------------------------------------------------- Main tab structure  # --------------------------------------------------------- Main tab structure
        
     my $activeClass = 1;      my $activeClass = 1;
     my $active = '';      my $active = '';
   
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');      if ($allowed) {
     if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {          $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
         if($activeClass == 1){          if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'}eq"" || ($env{'form.pagepath'}))) {
            $active = 'class="active"';              if($activeClass == 1){
    $activeClass = 0;                  $active = 'class="active"';
  }          $activeClass = 0;
     }      }
     if ($allowed){          }
         $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></li>');          $r->print('<li '.$active.' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Main Course Documents').'</b></a></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,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Supplemental Course Documents').'</b></a></li>');
           $r->print('</ul>');
       } else {
           $r->print('<br />');
     }      }
     $r->print('<li '.$active.' onclick="javascript:showPage(this,\'supplCourseDocuments\',\'mainnav\',\'maincoursedoc\');"><a href="#"><b>'.&mt('Supplemental Course Documents').'</b></a></li>');      $r->print('<div class="LC_Box" style="clear:both;margin:0;">'
     $r->print('</ul>'  
              .'<div class="LC_Box" style="clear:both;margin:0;">'  
              .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">');               .'<div id="maincoursedoc" style="margin:0 0;padding:0 0;">');
 # --------------------------------------------------------- Standard documents  # --------------------------------------------------------- Standard documents
        my $savefolderpath;         my $savefolderpath;
        my $active = 'style="display: none;"';         $active = 'style="display: none;"';
        if($activeClass == 0){         if($activeClass == 0){
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
        }         }
Line 3234  NGFFORM Line 3252  NGFFORM
 if($env{'form.pagepath'}) {  if($env{'form.pagepath'}) {
   
  @specialdocumentsforma=(   @specialdocumentsforma=(
  {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic32" />'=>$newsmpproblemform},   {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/simpprob.png" alt="pic32" />'=>$newsmpproblemform},
  {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic33" />'=>$newexuploadform}   {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/scoreupfrm.png" alt="pic33" />'=>$newexuploadform}
  );   );
  $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));   $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
 }  }
Line 3272  $r->print('</div>'); Line 3290  $r->print('</div>');
        if ($env{'form.pagepath'}) {         if ($env{'form.pagepath'}) {
        }         }
 # ----------------------------------------------------- Supplemental documents  # ----------------------------------------------------- Supplemental documents
        my $active = 'style="display: none;"';         $active = 'style="display: none;"';
        if($activeClass == 1){         if($activeClass == 1){
           $active = 'style="display: block;"';            $active = 'style="display: block;"';
        }         }
Line 3361  SNAMFORM Line 3379  SNAMFORM
   
   
 my @specialdocs = (  my @specialdocs = (
  {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic29" />'=>$supnewextform},   {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/extres.png" alt="pic29" />'=>$supnewextform},
  {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic30" />'=>$supnewsylform},   {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/syllabus.png" alt="pic30" />'=>$supnewsylform},
  {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic31" />'=>$supnewaboutmeform},   {'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/myaboutme.png" alt="pic31" />'=>$supnewaboutmeform},
  );   );
 my %suporderhash = (  my %suporderhash = (
  '00' => ['Supnewfolder', $supnewfolderform],   '00' => ['Supnewfolder', $supnewfolderform],
Line 3466  sub generate_edit_table { Line 3484  sub generate_edit_table {
  }   }
     }      }
     $form .= '</ul>';      $form .= '</ul>';
     $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">';      $form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0; clear: both;">';
     foreach my $field (keys(%orderhash)){      foreach my $field (keys(%orderhash)){
  if($field ne '00'){   if($field ne '00'){
         if($activetab eq '' || $activetab ne $field){          if($activetab eq '' || $activetab ne $field){

Removed from v.1.394  
changed lines
  Added in v.1.398


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