[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmenu.pm mydesk.tab /publisher lonconstruct.pm

droeschl droeschl@source.lon-capa.org
Mon, 12 Apr 2010 15:05:51 -0000


droeschl		Mon Apr 12 15:05:51 2010 EDT

  Modified files:              
    /loncom/interface	loncommon.pm lonmenu.pm mydesk.tab 
    /loncom/publisher	lonconstruct.pm 
  Log:
  In process of removing remote control, remote navmap and different icon modes code
  - lonconstruct: instead of rendering the construction space sites in a frameset, we 
    redirect to the content page. This change keeps all URLs intact. This should be 
    solved more elegantly at a later point (e.g. when reworking URLs for multi-domain 
    servers)
  
  - mydesk.tab, lonmenu.pm: replaced gotop function call by target="_top" attribute 
    to links, also removed gotop function
  - added 'Feeds' to primary menu according to 3.0 draft
   
  - loncommon: removed unused/redundand code fragments
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.963 loncom/interface/loncommon.pm:1.964
--- loncom/interface/loncommon.pm:1.963	Mon Mar 29 13:40:03 2010
+++ loncom/interface/loncommon.pm	Mon Apr 12 15:05:45 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.963 2010/03/29 13:40:03 raeburn Exp $
+# $Id: loncommon.pm,v 1.964 2010/04/12 15:05:45 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4598,8 +4598,6 @@
     }
 
     if (!$realm) { $realm=' '; }
-# Set messages
-    my $messages=&domainlogo($domain);
 
     my $extra_body_attr = &make_attr_string($forcereg,\%design);
 
@@ -6702,6 +6700,14 @@
 sub start_page {
     my ($title,$head_extra,$args) = @_;
     #&Apache::lonnet::logthis("start_page ".join(':',caller(0)));
+#SD
+#I don't see why we copy certain elements of %$args to %head_args
+#head args is passed to headtag() and this routine only reads those
+#keys that are needed. There doesn't happen any writes or any processing
+#of other keys.
+#proposal: just pass $args to headtag instead of \%head_args and delete 
+#marked lines
+#<- MARK
     my %head_args;
     foreach my $arg ('redirect','force_register','domain','function',
 		     'bgcolor','frameset','no_nav_bar','only_body',
@@ -6710,13 +6716,16 @@
 	    $head_args{$arg} = $args->{$arg};
 	}
     }
+#MARK ->
 
     $env{'internal.start_page'}++;
     my $result;
+
     if (! exists($args->{'skip_phases'}{'head'}) ) {
-	$result.=
-	    &xml_begin().
-        &headtag($title,$head_extra,\%head_args);
+        $result .= 
+                  &xml_begin() . &headtag($title,$head_extra,\%head_args);
+#replace prev line by
+#                 &xml_begin() . &headtag($title, $head_extra, $args);
     }
     
     if (! exists($args->{'skip_phases'}{'body'}) ) {
@@ -6746,15 +6755,10 @@
     #            $result .= &build_functionlist();
     #}
 
-    # Don't add anything more if only_body wanted
-    return $result if $args->{'only_body'};
+    # Don't add anything more if only_body wanted or in const space
+    return $result if    $args->{'only_body'} 
+                      || $env{'request.state'} eq 'construct';
 
-    #Breadcrumbs for Construction Space provided by &bodytag. 
-    if (
-        $env{'request.state'} eq 'construct') {
-        return $result;
-    }
- 
     #Breadcrumbs
     if (exists($args->{'bread_crumbs'}) or exists($args->{'bread_crumbs_component'})) {
 		&Apache::lonhtmlcommon::clear_breadcrumbs();
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.324 loncom/interface/lonmenu.pm:1.325
--- loncom/interface/lonmenu.pm:1.324	Mon Mar 29 14:50:46 2010
+++ loncom/interface/lonmenu.pm	Mon Apr 12 15:05:45 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.324 2010/03/29 14:50:46 raeburn Exp $
+# $Id: lonmenu.pm,v 1.325 2010/04/12 15:05:45 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -177,7 +177,7 @@
     return '<li><a' 
            # highlighting for new messages
            . ( $$menuitem[4] eq 'newmsg' ? ' class="LC_new_message"' : '') 
-           . qq| href="$$menuitem[0]">$link</a></li>|;
+           . qq| href="$$menuitem[0]" target="_top">$link</a></li>|;
 }
 
 # primary_menu() evaluates @primary_menu and returns XHTML for the menu
@@ -216,11 +216,11 @@
         if ($$menuitem[3] eq 'Help') { # special treatment for helplink
             $menu .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>';
         } else {
-            my @items = @{$menuitem};
-            $items[0] = 'javascript:'.$menuitem->[0].';';
-            $menu .= &prep_menuitem(\@items);
+            $menu .= prep_menuitem($menuitem);
         }
     }
+    $menu =~ s/\[domain\]/$env{'user.domain'}/g;
+    $menu =~ s/\[user\]/$env{'user.name'}/g;
 
     return "<ol class=\"LC_primary_menu LC_right\">$menu</ol>";
 }
@@ -674,10 +674,6 @@
 
 # ================================================================== Raw Config
 
-#SD
-#this is called by
-#lonmenu
-#
 sub clear {
     my ($row,$col)=@_;
     $inlineremote[10*$row+$col]='';
@@ -1068,12 +1064,6 @@
    }
 }
 
-function gotop(url) {
-    if (url!='' && url!= null) {
-        top.location.href = url;
-    }
-}
-
 function gopost(url,postdata) {
    if (url!='') {
       this.document.server.action=url;
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.131 loncom/interface/mydesk.tab:1.132
--- loncom/interface/mydesk.tab:1.131	Mon Mar 22 15:10:10 2010
+++ loncom/interface/mydesk.tab	Mon Apr 12 15:05:45 2010
@@ -15,16 +15,17 @@
 #   - roles: show Roles instead of Courses
 #   - courses: show Courses instead of Roles
 # prim:link:icon:alt:text:condition
-prim:gotop('/adm/about.html'):/adm/lonIcons/minilogo.gif:LON-CAPA Logo:About:public
-prim:gotop('/adm/communicate'):::Messages:nonewmsg
-prim:gotop('/adm/communicate'):::New Messages:newmsg
-prim:gotop('/adm/preferences'):::Preferences:
-prim:gotop('/adm/portfolio'):::Portfolio:
-prim:gotop('/adm/roles'):::Roles:roles
-prim:gotop('/adm/roles'):::Courses:courses
-prim:gotop('/adm/roles'):::Log In:onlypublic
+prim:/adm/about.html:/adm/lonIcons/minilogo.gif:LON-CAPA Logo:About:public
+prim:/adm/communicate:::Messages:nonewmsg
+prim:/adm/communicate:::New Messages:newmsg
+prim:/adm/preferences:::Preferences:
+prim:/adm/portfolio:::Portfolio:
+prim:/adm/[domain]/[user]/_rss.html:::Feeds:
+prim:/adm/roles:::Roles:roles
+prim:/adm/roles:::Courses:courses
+prim:/adm/roles:::Log In:onlypublic
 prim::::Help:
-prim:gotop('/adm/logout'):::Logout:
+prim:/adm/logout:::Logout:
 
 # secondary menu links
 # Apache::lonmenu::secondary_menu() generates a menu from these elements
@@ -54,7 +55,7 @@
 scnd:/adm/roles:::Roles:
 
 
-# Categories
+# Categories for main menu
 # cat:column,row:title
 cat:0,0:none:No category, inline menu
 cat:1,2:com:Communication
Index: loncom/publisher/lonconstruct.pm
diff -u loncom/publisher/lonconstruct.pm:1.36 loncom/publisher/lonconstruct.pm:1.37
--- loncom/publisher/lonconstruct.pm:1.36	Wed Mar 10 21:26:04 2010
+++ loncom/publisher/lonconstruct.pm	Mon Apr 12 15:05:51 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Construction Space Page Wrapper for Construction
 #
-# $Id: lonconstruct.pm,v 1.36 2010/03/10 21:26:04 droeschl Exp $
+# $Id: lonconstruct.pm,v 1.37 2010/04/12 15:05:51 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -117,29 +117,12 @@
        $lowerframe.='?editmode=Edit&problemmode=edit';
    }
 
-   my $js=qq|
-<script type="text/javascript">
-var lastknownpriv="$lowerframe";
-</script>
-    |;
-
-   my $start_page=
-       &Apache::loncommon::start_page('Construction Space',$js,
-				      {'frameset'    => 1,
-				       'add_entries' => {
-					   'rows'   => "0,*",
-					   'border' => "0",}});
-   my $end_page=
-       &Apache::loncommon::end_page({'frameset' => 1});
-
-
-#SD this entire frameset should be obsolete?!
-   $r->print(<<ENDPAGE);
-$start_page
-<frame src='' />
-<frame src="$lowerframe" name="LONCAPAToBePublished" />
-$end_page
-ENDPAGE
+   # when the remote control existed we used to force the
+   # pages of construction space into a frameset.
+   # without remote control, we can elimnate this frameset
+   # and redirect to the url of the content frame.
+   # This keeps all URLs intact. 
+   $r->internal_redirect($lowerframe);
    return OK;
 }
 1;