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

version 1.394, 2009/10/17 00:09:26 version 1.395, 2009/10/18 15:32:36
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 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 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;"';
        }         }

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


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