[LON-CAPA-cvs] cvs: loncom /interface londocs.pm lonnavmaps.pm mydesk.tab

raeburn raeburn at source.lon-capa.org
Sat Dec 29 12:37:21 EST 2012


raeburn		Sat Dec 29 17:37:21 2012 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm mydesk.tab londocs.pm 
  Log:
  - Wording change. "Exit" replaced by "Exit Editor".
  - "Exit Editor" link in Course Editor will return user to original point 
    of access, i.e., to Main Menu, Course Contents, Supplemental Folder, 
    or resource.
  - Preserved in %env for user's session in docs.exit.$courseid
  - Replaced next time editor is entered. 
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.491 loncom/interface/lonnavmaps.pm:1.492
--- loncom/interface/lonnavmaps.pm:1.491	Sat Dec  8 20:10:26 2012
+++ loncom/interface/lonnavmaps.pm	Sat Dec 29 17:37:20 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.491 2012/12/08 20:10:26 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.492 2012/12/29 17:37:20 raeburn Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -983,7 +983,7 @@
             ($resource->symb=~/\_\_\_[^\_]+\_\_\_uploaded/)) {
             my $icon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png';
             $editmapLink=' '.
-                         '<a href="/adm/coursedocs?command=direct&symb='.&escape($resource->symb()).'">'.
+                         '<a href="/adm/coursedocs?command=directnav&symb='.&escape($resource->symb()).'">'.
                          '<img src="'.$icon.'" alt="'.&mt('Edit Content').'" title="'.&mt('Edit Content').'" />'.
                          '</a>';
         }
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.155 loncom/interface/mydesk.tab:1.156
--- loncom/interface/mydesk.tab:1.155	Fri Dec 28 04:35:49 2012
+++ loncom/interface/mydesk.tab	Sat Dec 29 17:37:21 2012
@@ -161,8 +161,8 @@
 1:1:nsc:any:roles.png:switch[_2]:role[_1]:go('/adm/roles');:Switch to another user role:rol
 1:1:nsc:rcm:roles.png:choose[_2]:role[_2]:go('/adm/roles');:Choose the user role:rol
 1:2:clear
-1:2:pmdc:$crs:docs.png:course[_7]:editor[_1]:go('/adm/coursedocs');:Edit course contents:crc
-1:2:pmdc:$cmty:docs.png:communi-[_1]:ty edit[_1]:go('/adm/coursedocs');:Edit community contents:cmc
+1:2:pmdc:$crs:docs.png:course[_7]:editor[_1]:go('/adm/coursedocs?command=home');:Edit course contents:crc
+1:2:pmdc:$cmty:docs.png:communi-[_1]:ty edit[_1]:go('/adm/coursedocs?command=home');:Edit community contents:cmc
 2:1:clear
 2:2:clear
 2:2:course:any:nav.png:course[_3]:contents[_1]:gopost('/adm/navmaps','');:Table of course contents:crc
Index: loncom/interface/londocs.pm
diff -u loncom/interface/londocs.pm:1.524 loncom/interface/londocs.pm:1.525
--- loncom/interface/londocs.pm:1.524	Fri Dec  7 17:15:56 2012
+++ loncom/interface/londocs.pm	Sat Dec 29 17:37:21 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Documents
 #
-# $Id: londocs.pm,v 1.524 2012/12/07 17:15:56 raeburn Exp $
+# $Id: londocs.pm,v 1.525 2012/12/29 17:37:21 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1694,7 +1694,11 @@
         $container = 'sequence';
     }
 
-    my $jumpto = "uploaded/$coursedom/$coursenum/$folder.$container";
+    my $jumpto;
+
+    unless ($supplementalflag) {
+        $jumpto = "'uploaded/$coursedom/$coursenum/$folder.$container'";
+    }
 
     unless ($allowed) {
         $randompick = -1;
@@ -1867,7 +1871,7 @@
                                                            'Navigation_Screen',undef,'RAT')
                        .'</td><td class="LC_middle">'.&mt('Tools:').'</td>'
                        .'<td align="left"><ul id="LC_toolbar">'
-                       .'<li><a href="/adm/coursedocs?forcesupplement=1" '
+                       .'<li><a href="/adm/coursedocs?forcesupplement=1&command=editsupp" '
                        .'id="LC_content_toolbar_edittoplevel" '
                        .'class="LC_toolbarItem" '
                        .'title="'.&mt('Supplemental Content Editor').'">'
@@ -3211,23 +3215,33 @@
 
 # Do we directly jump somewhere?
 
-   if ($env{'form.command'} eq 'direct') {
-       my ($mapurl,$id,$resurl);
+   if (($env{'form.command'} eq 'direct') || ($env{'form.command'} eq 'directnav')) {
        if ($env{'form.symb'} ne '') {
            $env{'form.folderpath'}=
                &Apache::loncommon::symb_to_docspath($env{'form.symb'});
+           &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => 
+               $env{'form.command'}.'_'.$env{'form.symb'}});
        } elsif ($env{'form.supppath'} ne '') {
            $env{'form.folderpath'}=$env{'form.supppath'};
+           &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => 
+               $env{'form.command'}.'_'.$env{'form.supppath'}});
        }
    } elsif ($env{'form.command'} eq 'editdocs') {
-        $env{'form.folderpath'} = 'default&'.
-                                  &Apache::lonhtmlcommon::entity_encode('Main Course Content').
-                                  ':::::';
+       $env{'form.folderpath'} = 'default&'.
+                                 &Apache::lonhtmlcommon::entity_encode('Main Course Content').
+                                 ':::::';
+       &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => $env{'form.command'}});
    } elsif ($env{'form.command'} eq 'editsupp') {
-        $env{'form.folderpath'} = 'default&'.
+       $env{'form.folderpath'} = 'supplemental&'.
                                   &Apache::lonhtmlcommon::entity_encode('Supplemental Content');
+       &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/supplemental'});
+   } elsif ($env{'form.command'} eq 'contents') {
+       &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/navmaps'});
+   } elsif ($env{'form.command'} eq 'home') {
+       &Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => '/adm/menu'});
    }
 
+
 # Where do we store these for when we come back?
     my $stored_folderpath='docs_folderpath';
     if ($supplementalflag) {
@@ -4224,11 +4238,11 @@
         $activetab = $env{'form.active'};
     }
     my $backicon = $iconpath.'clickhere.gif';
-    my $backtext = &mt('Exit');
+    my $backtext = &mt('Exit Editor');
     $form = '<div class="LC_Box" style="margin:0;">'.
             '<ul id="navigation'.$tid.'" class="LC_TabContent">'."\n".
             '<li class="goback">'.
-            '<a href="javascript:toContents('."'$jumpto'".');">'.
+            '<a href="javascript:toContents('.$jumpto.');">'.
             '<img src="'.$backicon.'" class="LC_icon" style="border: none; vertical-align: top;"'.
             '  alt="'.$backtext.'" />'.$backtext.'</a></li>'."\n".
             '<li>'.
@@ -4324,9 +4338,25 @@
     my $toplevelmain = 'default&Main%20'.$crstype.'%20Documents%3A%3A%3A%3A%3A';
     my $toplevelsupp = &supplemental_base();
 
-    my $backtourl = '/adm/navmaps';
-    if ($supplementalflag) {
+    my $backtourl;
+    if ($env{'docs.exit.'.$env{'request.course.id'}} =~ /^direct_(.+)$/) {   
+        my $caller = $1; 
+        if ($caller =~ /^supplemental/) {
+            $backtourl = '/adm/supplemental?folderpath='.&escape($caller);
+        } else {
+            my ($map,$id,$res)=&Apache::lonnet::decode_symb($caller);
+            $res = &Apache::lonnet::clutter($res);
+            if (&Apache::lonnet::is_on_map($res)) {
+                $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($res),'<>&"').'?symb='.
+                             &HTML::Entities::encode($caller,'<>&"');
+            }
+        }
+    } elsif ($env{'docs.exit.'.$env{'request.course.id'}} eq '/adm/menu') {
+        $backtourl = '/adm/menu';
+    } elsif ($supplementalflag) {
         $backtourl = '/adm/supplemental';
+    } else {
+        $backtourl = '/adm/navmaps';
     }
 
     my $fieldsets = "'ext','doc'";
@@ -4628,9 +4658,8 @@
 
 function toContents(jumpto) {
     var newurl = '$backtourl';
-    if (jumpto != '') {
+    if ((newurl == '/adm/navmaps') && (jumpto != '')) {
         newurl = newurl+'?postdata='+jumpto;
-;
     }
     location.href=newurl;
 }




More information about the LON-CAPA-cvs mailing list