[LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml loncom loncapa_apache.conf loncom/html/res/adm/pages editmap.png loncom/interface loncommon.pm londocs.pm lonindexcourse.pm lonnavdisplay.pm lonnavmaps.pm lonsearchcourse.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 25 15:42:18 EST 2011


raeburn		Sun Dec 25 20:42:18 2011 EDT

  Added files:                 
    /loncom/html/res/adm/pages	editmap.png 

  Modified files:              
    /loncom/interface	loncommon.pm londocs.pm lonindexcourse.pm 
                     	lonnavdisplay.pm lonnavmaps.pm lonsearchcourse.pm 
    /loncom	loncapa_apache.conf 
    /doc/loncapafiles	loncapafiles.lpml 
  Log:
  Changes to improve usability for Course Contents and Content Editor.
  - Separate "editor" tabs (Content Editor && Supplemental Content Editor) from
    "display" tabs (Main Content, Supplemental Content, Content Search, Content Index).
  - Replace "Edit Content" link on "Course Contents" page (used to jump directly 
    to editing specific folder) with icon, to reduce clutter.
  - "Back to Overview" link on editor pages to jump directly to corresponding
    location on "display" pages.
  - CC and student roles have same tabs in "display" of Contents
  - New URL: "/adm/supplemental" for supplemental contents when displaying 
    (as CC or student).
  - Supplemental Course Content breadcrumbs do not need link to course as first
    item.
  - Functions menu in Supplemental Course Content includes "Folder Editor" link
    to jump to editor.
  - Do not use style: "LC_current_location" when location is a folder.
  
  
-------------- next part --------------
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1046 loncom/interface/loncommon.pm:1.1047
--- loncom/interface/loncommon.pm:1.1046	Fri Dec 23 16:55:34 2011
+++ loncom/interface/loncommon.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.1046 2011/12/23 16:55:34 raeburn Exp $
+# $Id: loncommon.pm,v 1.1047 2011/12/25 20:41:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -6314,6 +6314,12 @@
   background:#FFFFFF;
   outline: none;
 }
+
+ul.LC_TabContent li.goback {
+  float: left;
+  border-left: none;
+}
+
 #maincoursedoc {
   clear:both;
 }
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.471 loncom/interface/londocs.pm:1.472
--- loncom/interface/londocs.pm:1.471	Sun Dec 25 18:29:49 2011
+++ loncom/interface/londocs.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.471 2011/12/25 18:29:49 raeburn Exp $
+# $Id: londocs.pm,v 1.472 2011/12/25 20:41:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,6 +41,7 @@
 use Apache::lonxml;
 use Apache::lonclonecourse;
 use Apache::lonnavmaps;
+use Apache::lonnavdisplay();
 use HTML::Entities;
 use GDBM_File;
 use Apache::lonlocal;
@@ -1127,37 +1128,33 @@
     my $isencrypted=0;
     my $ishidden=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) {
 	my $folder=shift(@folders);
     	my $foldername=shift(@folders);
 	if ($folderpath) {$folderpath.='&';}
 	$folderpath.=$folder.'&'.$foldername;
-	my $url='/adm/coursedocs?folderpath='.
-	    &escape($folderpath);
-	    my $name=&unescape($foldername);
+        my $url;
+        if ($allowed) {
+            $url = '/adm/coursedocs?folderpath=';
+        } else {
+            $url = '/adm/supplemental?folderpath=';
+        }
+	$url .= &escape($folderpath);
+	my $name=&unescape($foldername);
 # randompick number, hidden, encrypted, random order, is appended with ":"s to the foldername
- 	    $name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//;
-	    if ($1 ne '') {
-               $randompick=$1;
-            } else {
-               $randompick=-1;
-            }
-            if ($2) { $ishidden=1; }
-            if ($3) { $isencrypted=1; }
-	    if ($4 ne '') { $is_random_order = 1; }
-            if ($folder eq 'supplemental') {
-                $name = &mt('Supplemental '.$crstype.' Documents');
-            }
-	    &Apache::lonhtmlcommon::add_breadcrumb(
+ 	$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//;
+	if ($1 ne '') {
+           $randompick=$1;
+        } else {
+           $randompick=-1;
+        }
+        if ($2) { $ishidden=1; }
+        if ($3) { $isencrypted=1; }
+	if ($4 ne '') { $is_random_order = 1; }
+        if ($folder eq 'supplemental') {
+            $name = &mt('Supplemental '.$crstype.' Content');
+        }
+	&Apache::lonhtmlcommon::add_breadcrumb(
 		      {'href'=>$url.$cpinfo,
 		       'title'=>$name,
 		       'text'=>$name,
@@ -1167,7 +1164,8 @@
     }
     $plain=~s/\&gt\;\s*$//;
     return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp',
-					       undef, undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order);
+					       undef, undef, 1 ),$randompick,$ishidden,
+                                               $isencrypted,$plain,$is_random_order);
 }
 
 sub log_docs {
@@ -1614,7 +1612,7 @@
 
 sub editor {
     my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype,
-        $supplementalflag,$orderhash)=@_;
+        $supplementalflag,$orderhash,$iconpath)=@_;
     my $container= ($env{'form.pagepath'}) ? 'page'
 		                           : 'sequence';
 
@@ -1630,8 +1628,10 @@
     }
 
     my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) =
-	    &breadcrumbs($allowed,$crstype);
-        $r->print($breadcrumbtrail);
+        &breadcrumbs($allowed,$crstype);
+    $r->print($breadcrumbtrail);
+
+    my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container";
 
     unless ($allowed) {
         $randompick = -1;
@@ -1788,9 +1788,22 @@
         $tid = 2;
     }
     if ($allowed) {
-        $r->print(&generate_edit_table($tid,$orderhash,$to_show));
+        $r->print(&generate_edit_table($tid,$orderhash,$to_show,$iconpath,$jumpto));
         &print_paste_buffer($r,$container);
     } else {
+        if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+            #Function Box for Supplemental Content for users with mdc priv.
+            my $funcname = &mt('Folder Editor');
+            $r->print(
+                &Apache::loncommon::head_subbox(
+                    &Apache::lonhtmlcommon::start_funclist().
+                    &Apache::lonhtmlcommon::add_item_funclist(
+                        '<a href="/adm/coursedocs?command=direct&forcesupplement=1&'.
+                        'supppath='.&HTML::Entities::encode($env{'form.folderpath'}).'">'.
+                        '<img src="/res/adm/pages/docs.png" alt="'.$funcname.'" class="LC_icon" />'.
+                        '<span class="LC_menubuttons_inline_text">'.$funcname.'</span></a>').
+                          &Apache::lonhtmlcommon::end_funclist()));
+        }
         $r->print($to_show);
     }
     return;
@@ -2086,18 +2099,23 @@
     my $pagearg;
     my $pagefile;
     if ($uploaded) {
-	if ($extension eq 'sequence') {
-	    $icon=$iconpath.'/navmap.folder.closed.gif';
-	    $url=~/\Q$coursenum\E\/([\/\w]+)\.sequence$/;
-	    $url='/adm/coursedocs?';
-	    $folderarg=$1;
-	    $isfolder=1;
-        } elsif ($extension eq 'page') {
-            $icon=$iconpath.'/page.gif';
-            $url=~/\Q$coursenum\E\/([\/\w]+)\.page$/;
-            $pagearg=$1;
-            $url='/adm/coursedocs?';
-            $ispage=1;
+        if (($extension eq 'sequence') || ($extension eq 'page')) {
+            $url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/;
+            my $containerarg = $1;
+	    if ($extension eq 'sequence') {
+	        $icon=$iconpath.'navmap.folder.closed.gif';
+                $folderarg=$containerarg;
+                $isfolder=1;
+            } else {
+                $icon=$iconpath.'page.gif';
+                $pagearg=$containerarg;
+                $ispage=1;
+            }
+            if ($allowed) {
+                $url='/adm/coursedocs?';
+            } else {
+                $url='/adm/supplemental?';
+            }
 	} else {
 	    &Apache::lonnet::allowuploaded('/adm/coursedoc',$url);
 	}
@@ -2200,7 +2218,7 @@
         $reinit = &mt('(re-initialize course to access)');
     }  
     $line.='<td>';
-    if ($url=~m{/adm/coursedocs}) {
+    if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
        $line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>';
     } elsif ($url) {
        $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes',
@@ -2209,7 +2227,7 @@
        $line.='<img src="'.$icon.'" alt="" class="LC_icon" />';
     }
     $line.='</td><td>';
-    if ($url=~m{/adm/coursedocs}) {
+    if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) {
        $line.='<a href="'.$url.'">'.$title.'</a>';
     } elsif ($url) {
        $line.=&Apache::loncommon::modal_link($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes',
@@ -2761,27 +2779,19 @@
 sub startContentScreen {
     my ($r,$mode)=@_;
     $r->print('<ul class="LC_TabContentBigger" id="mainnav">');
-    $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b>    '.&mt('Content Overview').'    </b></a></li>');
-
-    my $active = '';
-# does this user have privileges to modify docs?
-    my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
-
-    my $onclick;
-    my $href;
-
-    if ($allowed) {
+    if (($mode eq 'navmaps') || ($mode eq 'supplemental')) {
+        $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b>    '.&mt('Content Overview').'    </b></a></li>'."\n");
+        $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>     '.&mt('Content Search').'     </b></a></li>'."\n");
+        $r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b>      '.&mt('Content Index').'      </b></a></li>'."\n");
+        $r->print('<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>');
+    } else {
         $r->print('<li '.(($mode eq 'docs')?' class="active"':'').
                ' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b>      '.&mt('Content Editor').'      </b></a></li>');
+        $r->print('<li '.(($mode eq 'suppdocs')?' class="active"':'').
+                  '><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Content Editor').'</b></a></li>');
     }
-    $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>     '.&mt('Content Search').'     </b></a></li>');
-    $r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b>      '.&mt('Content Index').'      </b></a></li>');
-    $r->print('<li '.(($mode eq 'supdocs')?' class="active"':'').
-           '><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Documents').'</b></a></li>');
-    $r->print('</ul>');
-    $r->print('<div class="LC_DocsBox" style="clear:both;margin:0;" id="contenteditor">'
-             .'<div id="maincoursedoc" style="margin:0 0;padding:0 0">');
-    $r->print('<div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');
+    $r->print("\n".'</ul>'."\n");
+    $r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');
 }
 
 #
@@ -2794,7 +2804,7 @@
 }
 
 sub supplemental_base {
-    return 'supplemental&'.&escape(&mt('Supplemental '.&Apache::loncommon::course_type().' Documents'));
+    return 'supplemental&'.&escape(&mt('Supplemental '.&Apache::loncommon::course_type().' Content'));
 }
 
 sub handler {
@@ -2828,8 +2838,14 @@
     $help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files');
     $help{'Caching'} = &Apache::loncommon::help_open_topic('Caching');
 
-# does this user have privileges to modify docs
-    my $allowed=&Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+    
+    my $allowed;
+# URI is /adm/supplemental when viewing supplemental docs in non-edit mode.
+    unless ($r->uri eq '/adm/supplemental') {
+        # does this user have privileges to modify content.  
+        $allowed = &Apache::lonnet::allowed('mdc',$env{'request.course.id'});
+    }
+
   if ($allowed && $env{'form.verify'}) {
       &init_breadcrumbs('verify','Verify Content');
       &verifycontent($r);
@@ -2888,66 +2904,74 @@
 
    if ($env{'form.command'} eq 'direct') {
        my ($mapurl,$id,$resurl);
-       if ($env{'form.symb'} eq '') {
-           $mapurl = $env{'course.'.$env{'request.course.id'}.'.url'};
-       } else {
+       if ($env{'form.symb'} ne '') {
            ($mapurl,$id,$resurl) = &Apache::lonnet::decode_symb($env{'form.symb'});
            if ($resurl=~/\.(sequence|page)$/) {
                $mapurl=$resurl;
            } elsif ($resurl eq 'adm/navmaps') {
                $mapurl=$env{'course.'.$env{'request.course.id'}.'.url'};
            }
-       }
-       my $mapresobj;
-       my $navmap = Apache::lonnavmaps::navmap->new();
-       if (ref($navmap)) {
-           $mapresobj = $navmap->getResourceByUrl($mapurl);
-       }
-       $mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1};
-       my $type=$2;
-       my $path;
-       if (ref($mapresobj)) {
-           my $pcslist = $mapresobj->map_hierarchy();
-           if ($pcslist ne '') {
-               foreach my $pc (split(/,/,$pcslist)) {
-                   next if ($pc <= 1);
-                   my $res = $navmap->getByMapPc($pc);
-                   if (ref($res)) {
-                       my $thisurl = $res->src();
-                       $thisurl=~s{^.*/([^/]+)\.\w+$}{$1}; 
-                       my $thistitle = $res->title();
-                       $path .= '&'.
-                                &Apache::lonhtmlcommon::entity_encode($thisurl).'&'.
-                                &Apache::lonhtmlcommon::entity_encode($thistitle).
-                                ':'.$res->randompick().
-                                ':'.$res->randomout().
-                                ':'.$res->encrypted().
-                                ':'.$res->randomorder();
+           my $mapresobj;
+           my $navmap = Apache::lonnavmaps::navmap->new();
+           if (ref($navmap)) {
+               $mapresobj = $navmap->getResourceByUrl($mapurl);
+           }
+           $mapurl=~s{^.*/([^/]+)\.(\w+)$}{$1};
+           my $type=$2;
+           my $path;
+           if (ref($mapresobj)) {
+               my $pcslist = $mapresobj->map_hierarchy();
+               if ($pcslist ne '') {
+                   foreach my $pc (split(/,/,$pcslist)) {
+                       next if ($pc <= 1);
+                       my $res = $navmap->getByMapPc($pc);
+                       if (ref($res)) {
+                           my $thisurl = $res->src();
+                           $thisurl=~s{^.*/([^/]+)\.\w+$}{$1}; 
+                           my $thistitle = $res->title();
+                           $path .= '&'.
+                                    &Apache::lonhtmlcommon::entity_encode($thisurl).'&'.
+                                    &Apache::lonhtmlcommon::entity_encode($thistitle).
+                                    ':'.$res->randompick().
+                                    ':'.$res->randomout().
+                                    ':'.$res->encrypted().
+                                    ':'.$res->randomorder();
+                       }
                    }
                }
-           }
-           $path .= '&'.&Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
+               $path .= '&'.&Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
                     &Apache::lonhtmlcommon::entity_encode($mapresobj->title()).
                     ':'.$mapresobj->randompick().
                     ':'.$mapresobj->randomout().
                     ':'.$mapresobj->encrypted().
                     ':'.$mapresobj->randomorder();
-       } else {
-           my $maptitle = &Apache::lonnet::gettitle($mapurl);
-           $path = '&default&...::::'.
-               '&'.&Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
-               &Apache::lonhtmlcommon::entity_encode($maptitle).'::::';
-       }
-       $path = 'default&'.
-               &Apache::lonhtmlcommon::entity_encode('Main Course Documents').
-               $path;
-       if ($type eq 'sequence') {
-           $env{'form.folderpath'}=$path;
-           $env{'form.pagepath'}='';
-       } else {
-           $env{'form.pagepath'}=$path;
-           $env{'form.folderpath'}='';
+           } else {
+               my $maptitle = &Apache::lonnet::gettitle($mapurl);
+               $path = '&default&...::::'.
+                   '&'.&Apache::lonhtmlcommon::entity_encode($mapurl).'&'.
+                   &Apache::lonhtmlcommon::entity_encode($maptitle).'::::';
+           }
+           $path = 'default&'.
+                   &Apache::lonhtmlcommon::entity_encode('Main Course Documents').
+                   $path;
+           if ($type eq 'sequence') {
+               $env{'form.folderpath'}=$path;
+               $env{'form.pagepath'}='';
+           } else {
+               $env{'form.pagepath'}=$path;
+               $env{'form.folderpath'}='';
+           }
+       } elsif ($env{'form.supppath'} ne '') {
+           $env{'form.folderpath'}=$env{'form.supppath'};
        }
+   } elsif ($env{'form.command'} eq 'editdocs') {
+        $env{'form.folderpath'} = 'default&'.
+                                  &Apache::lonhtmlcommon::entity_encode('Main Course Content');
+        $env{'form.pagepath'}='';
+   } elsif ($env{'form.command'} eq 'editsupp') {
+        $env{'form.folderpath'} = 'default&'.
+                                  &Apache::lonhtmlcommon::entity_encode('Supplemental Content');
+        $env{'form.pagepath'}='';
    }
 
 # Where do we store these for when we come back?
@@ -2987,7 +3011,7 @@
        } else {
           $env{'form.folderpath'}='default';
        }
-    } 
+    }
 
 # Store this
     &Apache::loncommon::store_course_settings($stored_folderpath,
@@ -3058,7 +3082,7 @@
             }
         }
         my $tabidstr = join("','", at tabids);
-	$script .= &editing_js($udom,$uname).
+	$script .= &editing_js($udom,$uname,$supplementalflag).
                    &resize_contentdiv_js($tabidstr);
         $addentries = {
                         onload   => "javascript:resize_contentdiv('contentscroll','1','1');",
@@ -3261,8 +3285,12 @@
     }
 
 # Generate the tabs
-    &startContentScreen($r,($supplementalflag?'supdocs':'docs'));
-
+    my $mode;
+    if (($supplementalflag) && (!$allowed)) {
+        &Apache::lonnavdisplay::startContentScreen($r,'supplemental');
+    } else {
+        &startContentScreen($r,($supplementalflag?'suppdocs':'docs'));
+    }
 
 #
 
@@ -3512,7 +3540,7 @@
  $hadchanges=0;
        unless ($supplementalflag) {
           my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
-                              $supplementalflag,\%orderhash);
+                              $supplementalflag,\%orderhash,$iconpath);
           if ($error) {
              $r->print('<p><span class="LC_error">'.$error.'</span></p>');
           }
@@ -3624,14 +3652,14 @@
                 );
         if ($supplementalflag) {
            my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
-                               $supplementalflag,\%suporderhash);
+                               $supplementalflag,\%suporderhash,$iconpath);
            if ($error) {
               $r->print('<p><span class="LC_error">'.$error.'</span></p>');
            }
         }
     } elsif ($supplementalflag) {
         my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype,
-                            $supplementalflag);
+                            $supplementalflag,'',$iconpath);
         if ($error) {
             $r->print('<p><span class="LC_error">'.$error.'</span></p>');
         }
@@ -3734,7 +3762,7 @@
 
 
 sub generate_edit_table {
-    my ($tid,$orderhash_ref,$to_show) = @_;
+    my ($tid,$orderhash_ref,$to_show,$iconpath,$jumpto) = @_;
     return unless(ref($orderhash_ref) eq 'HASH');
     my %orderhash = %{$orderhash_ref};
     my $form;
@@ -3743,8 +3771,14 @@
     if($env{'form.active'} ne ''){
         $activetab = $env{'form.active'};
     }
+    my $backicon = $iconpath.'clickhere.gif';
+    my $backtext = &mt('Back to Overview');
     $form = '<div class="LC_Box" style="margin:0;">'.
-             '<ul id="navigation'.$tid.'" class="LC_TabContent">';
+             '<ul id="navigation'.$tid.'" class="LC_TabContent">'.
+             '<li class="goback">'.
+             '<a href="javascript:toContents('."'$jumpto'".');">'.
+             '<img src="'.$backicon.'" alt="'.$backtext.'" />'.
+             $backtext.'</a></li>';
     foreach my $name (reverse(sort(keys(%orderhash)))) {
         if($name ne '00'){
             if($activetab eq '' || $activetab ne $name){
@@ -3784,7 +3818,7 @@
 }
 
 sub editing_js {
-    my ($udom,$uname) = @_;
+    my ($udom,$uname,$supplementalflag) = @_;
     my $now = time();
     my %lt = &Apache::lonlocal::texthash(
                                           p_mnf => 'Name of New Folder',
@@ -3822,6 +3856,11 @@
     my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents';
     my $toplevelsupp = &supplemental_base();
 
+    my $backtourl = '/adm/navmaps';
+    if ($supplementalflag) {
+        $backtourl = '/adm/supplemental';
+    }
+
     return <<ENDNEWSCRIPT;
 function makenewfolder(targetform,folderseq) {
     var foldername=prompt('$lt{"p_mnf"}','$lt{"t_mnf"}');
@@ -4000,11 +4039,15 @@
 currentNav = document.getElementById(nav);
 currentLis = currentNav.getElementsByTagName('LI');
 for (i = 0; i < currentLis.length; i++) {
-	if(currentLis[i].className == 'right active' || currentLis[i].className == 'right'){
+        if (currentLis[i].className == 'goback') {
+            currentLis[i].className = 'goback';
+        } else {
+	    if (currentLis[i].className == 'right active' || currentLis[i].className == 'right') {
 		currentLis[i].className = 'right';
-	}else{
+	    } else {
 		currentLis[i].className = 'i';
-	}
+	    }
+        }
 }
 }
 
@@ -4096,6 +4139,15 @@
 	current.submit();
 }
 
+function toContents(jumpto) {
+    var newurl = '$backtourl';
+    if (jumpto != '') {
+        newurl = newurl+'?postdata='+jumpto;
+;
+    }
+    location.href=newurl;
+}
+
 ENDNEWSCRIPT
 }
 
Index: loncom/interface/lonindexcourse.pm
diff -u loncom/interface/lonindexcourse.pm:1.1 loncom/interface/lonindexcourse.pm:1.2
--- loncom/interface/lonindexcourse.pm:1.1	Tue Jan 18 00:22:02 2011
+++ loncom/interface/lonindexcourse.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Index Course
 #
-# $Id: lonindexcourse.pm,v 1.1 2011/01/18 00:22:02 www Exp $
+# $Id: lonindexcourse.pm,v 1.2 2011/12/25 20:41:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,7 +41,7 @@
 use LONCAPA::lonmetadata();
 use HTML::Entities();
 use Apache::lonnavmaps;
-use Apache::londocs();
+use Apache::lonnavdisplay();
 use Apache::lonindexer();
 use LONCAPA;
 
@@ -163,9 +163,9 @@
             {   href => '/adm/indexcourse',
                 text => "$crstype Index"});
     $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Index"));
-    &Apache::londocs::startContentScreen($r,'courseindex');
+    &Apache::lonnavdisplay::startContentScreen($r,'courseindex');
     &course_index($r);
-    &Apache::londocs::endContentScreen($r);
+    &Apache::lonnavdisplay::endContentScreen($r);
     $r->print(&Apache::loncommon::end_page());
     return OK;
 }
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.19 loncom/interface/lonnavdisplay.pm:1.20
--- loncom/interface/lonnavdisplay.pm:1.19	Tue Dec  7 01:15:39 2010
+++ loncom/interface/lonnavdisplay.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavdisplay.pm,v 1.19 2010/12/07 01:15:39 www Exp $
+# $Id: lonnavdisplay.pm,v 1.20 2011/12/25 20:41:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -101,7 +101,7 @@
     }
     $r->print($start_page.
               '<script type="text/javascript">window.focus();</script>');
-    &Apache::londocs::startContentScreen($r,'navmaps');
+    &startContentScreen($r,'navmaps');
     $r->rflush();
 
     # Check that it's defined
@@ -261,13 +261,30 @@
     }
     #my $td=&tv_interval($t0);
     #$r->print("<br />$td");
-    &Apache::londocs::endContentScreen($r);
+    &endContentScreen($r);
     $r->print(&Apache::loncommon::end_page());
     $r->rflush();
 
     return OK;
 }
 
+sub startContentScreen {
+    my ($r,$mode)=@_;
+
+    $r->print("\n".'<ul class="LC_TabContentBigger" id="mainnav">'."\n");
+    $r->print('<li'.(($mode eq 'navmaps')?' class="active"':'').'><a href="/adm/navmaps"><b>    '.&mt('Main Content').'    </b></a></li>'."\n");
+    $r->print('<li '.(($mode eq 'supplemental')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>');
+    $r->print('<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b>     '.&mt('Content Search').'     </b></a></li>'."\n");
+    $r->print('<li'.(($mode eq 'courseindex')?' class="active"':'').'><a href="/adm/indexcourse"><b>      '.&mt('Content Index').'      </b></a></li>'."\n");
+    $r->print("\n".'</ul>'."\n");
+    $r->print('<div class="LC_Box" style="clear:both;margin:0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;"><div class="LC_ContentBox" id="mainCourseDocuments" style="display: block;">');
+}
+
+sub endContentScreen {
+   my ($r)=@_;
+   $r->print('</div></div></div>');
+}
+
 1;
 __END__
 
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.476 loncom/interface/lonnavmaps.pm:1.477
--- loncom/interface/lonnavmaps.pm:1.476	Sun Dec 25 19:39:08 2011
+++ loncom/interface/lonnavmaps.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.476 2011/12/25 19:39:08 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.477 2011/12/25 20:41:53 raeburn Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -896,6 +896,7 @@
 sub render_resource {
     my ($resource, $part, $params) = @_;
 
+    my $editmapLink;
     my $nonLinkedText = ''; # stuff after resource title not in link
 
     my $link = $params->{"resourceLink"};
@@ -977,6 +978,14 @@
             $linkopen = "";
             $linkclose = "";
         }
+        if ((&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) &&
+            ($resource->symb=~/\_\_\_[^\_]+\_\_\_uploaded/)) {
+            my $icon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png';
+            $editmapLink=' '.
+                         '<a href="/adm/coursedocs?command=direct&symb='.&escape($resource->symb()).'">'.
+                         '<img src="'.$icon.'" alt="'.&mt('Edit Content').'" title="'.&mt('Edit Content').'" />'.
+                         '</a>';
+        }
     }
 
     if ($resource->randomout()) {
@@ -1010,8 +1019,10 @@
     # Is this the current resource?
     if (!$params->{'displayedHereMarker'} && 
         $resource->symb() eq $params->{'here'} ) {
-        $curMarkerBegin = '<span class="LC_current_nav_location">';
-        $curMarkerEnd = '</span>';
+        unless ($resource->is_map()) {
+            $curMarkerBegin = '<span class="LC_current_nav_location">';
+            $curMarkerEnd = '</span>';
+        }
 	$params->{'displayedHereMarker'} = 1;
     }
 
@@ -1030,7 +1041,7 @@
     if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) {
         $result .= "$curMarkerBegin<a href=\"$link\">$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
     } else {
-        $result .= "$curMarkerBegin$linkopen$title$partLabel</a>$curMarkerEnd$nonLinkedText</td>";
+        $result .= "$curMarkerBegin$linkopen$title$partLabel</a>$curMarkerEnd$editmapLink$nonLinkedText</td>";
     }
 
     return $result;
@@ -1044,6 +1055,7 @@
     my $linkopen = "<a href=\"$link\">";
     my $linkclose = "</a>";
     my $location=&Apache::loncommon::lonhttpdurl("/adm/lonMisc");
+
     if ($resource->hasDiscussion()) {
         $discussionHTML = $linkopen .
             '<img alt="'.&mt('New Discussion').'" src="'.$location.'/chat.gif" title="'.&mt('New Discussion').'"/>' .
@@ -1132,14 +1144,6 @@
         $result .= getDescription($resource, $part);
         if ($color) {$result .= "</b></font>"; }
     }
-    if ($resource->is_map()) {
-        if (&Apache::lonnet::allowed('mdc')) {
-            if ($resource->symb=~/\_\_\_[^\_]+\_\_\_uploaded/) {
-               $result.=" <a href='/adm/coursedocs?command=direct&symb=".&escape($resource->symb())."'>".
-                              "<span class='LC_setting'>".&mt("Edit Content").'</span></a> ';
-            }
-        }
-    }
     if ($resource->is_map() && &advancedUser() && $resource->randompick()) {
         $result .= &mt('(randomly select [_1])', $resource->randompick());
     }
@@ -1509,7 +1513,7 @@
             if ($env{'course.'.$env{'request.course.id'}.'.url'} eq 
                 "uploaded/$cdom/$cnum/default.sequence") {
                 &add_linkitem($args->{'linkitems'},'edittoplevel',
-                              "javascript:gocmd('/adm/coursedocs','direct');",
+                              "javascript:gocmd('/adm/coursedocs','editdocs');",
                               'Content Editor');
             }
         }
@@ -1855,7 +1859,7 @@
 
 sub show_linkitems_toolbar {
     my ($args,$condition) = @_;
-    my $result = 
+    my $result =
         '<table><tr><td>'.
         &Apache::loncommon::help_open_menu('Navigation Screen','Navigation_Screen',undef,'RAT').
         '</td>'.
@@ -1865,7 +1869,7 @@
         if (ref($args->{'linkitems'}) eq 'HASH') {
             my @linkorder = ('firsthomework','everything','uncompleted',
                              'changefolder','clearbubbles','edittoplevel');
-            $result .='<td align="left">'."\n". 
+            $result .='<td align="left">'."\n".
                       '<span class="LC_nobreak">'."\n".
                       '<ul id="LC_toolbar">';
             foreach my $link (@linkorder) {
@@ -1903,7 +1907,6 @@
     return $result;
 }
 
-
 1;
 
 
Index: loncom/interface/lonsearchcourse.pm
diff -u loncom/interface/lonsearchcourse.pm:1.3 loncom/interface/lonsearchcourse.pm:1.4
--- loncom/interface/lonsearchcourse.pm:1.3	Mon Jan 17 22:56:27 2011
+++ loncom/interface/lonsearchcourse.pm	Sun Dec 25 20:41:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Course
 #
-# $Id: lonsearchcourse.pm,v 1.3 2011/01/17 22:56:27 www Exp $
+# $Id: lonsearchcourse.pm,v 1.4 2011/12/25 20:41:53 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -41,7 +41,7 @@
 use LONCAPA::lonmetadata();
 use HTML::Entities();
 use Apache::lonnavmaps;
-use Apache::londocs();
+use Apache::lonnavdisplay();
 use Apache::lonindexer();
 use LONCAPA;
 
@@ -320,13 +320,13 @@
                 text => 'Search Results'});
     }
     $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Search"));
-    &Apache::londocs::startContentScreen($r,'coursesearch');
+    &Apache::lonnavdisplay::startContentScreen($r,'coursesearch');
     if ($env{'form.phase'} eq 'results') {
        &course_search($r);
     } else {
        $r->print(&menu());
     }
-    &Apache::londocs::endContentScreen($r);
+    &Apache::lonnavdisplay::endContentScreen($r);
     $r->print(&Apache::loncommon::end_page());
     return OK;
 }
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.206 loncom/loncapa_apache.conf:1.207
--- loncom/loncapa_apache.conf:1.206	Tue Nov  1 13:32:04 2011
+++ loncom/loncapa_apache.conf	Sun Dec 25 20:41:59 2011
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.206 2011/11/01 13:32:04 raeburn Exp $
+## $Id: loncapa_apache.conf,v 1.207 2011/12/25 20:41:59 raeburn Exp $
 ##
 
 #
@@ -1097,6 +1097,18 @@
 ErrorDocument	  500 /adm/errorhandler
 </Location>
 
+<Location /adm/supplemental>
+AuthType LONCAPA
+Require valid-user
+PerlAuthzHandler       Apache::lonacc
+SetHandler perl-script
+PerlHandler Apache::londocs
+PerlCleanupHandler Apache::londocs::untiehash
+PerlCleanupHandler      Apache::lonacc::cleanup
+ErrorDocument     403 /adm/login
+ErrorDocument     500 /adm/errorhandler
+</Location>
+
 <Location /adm/imsimportdocs>
 AuthType LONCAPA
 Require valid-user
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.777 doc/loncapafiles/loncapafiles.lpml:1.778
--- doc/loncapafiles/loncapafiles.lpml:1.777	Wed Dec 21 20:21:55 2011
+++ doc/loncapafiles/loncapafiles.lpml	Sun Dec 25 20:42:17 2011
@@ -2,7 +2,7 @@
  "http://lpml.sourceforge.net/DTD/lpml.dtd">
 <!-- loncapafiles.lpml -->
 
-<!-- $Id: loncapafiles.lpml,v 1.777 2011/12/21 20:21:55 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.778 2011/12/25 20:42:17 raeburn Exp $ -->
 
 <!--
 
@@ -7049,6 +7049,7 @@
 courses.png;
 crsconf.png;
 docs.png;
+editmap.png;
 eval.png;
 grds.png;
 grps.png;


More information about the LON-CAPA-cvs mailing list