--- loncom/interface/lonmenu.pm 2010/03/03 21:33:15 1.315
+++ loncom/interface/lonmenu.pm 2010/03/10 21:25:50 1.316
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.315 2010/03/03 21:33:15 droeschl Exp $
+# $Id: lonmenu.pm,v 1.316 2010/03/10 21:25:50 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -28,8 +28,6 @@
#
# There is one parameter controlling the action of this module:
#
-# environment.remote - if this is 'on', the routines controll the remote
-# control, otherwise they render the main window controls;
=head1 NAME
@@ -124,22 +122,8 @@ and in the body of the document
=item unloadevents()
-=item startupremote()
-
-=item setflags()
-
-=item maincall()
-
-=item load_remote_msg()
-
=item get_menu_name()
-=item reopenmenu()
-
-=item open()
-
-Open the menu
-
=item clear()
=item switch()
@@ -156,10 +140,6 @@ The javascript is usually similar to "go
=item rawconfig()
-=item close()
-
-=item footer()
-
=item utilityfunctions()
=item serverform()
@@ -205,10 +185,10 @@ sub prep_menuitem {
} else { # textual Link
$link = &mt($$menuitem[3]);
}
- if($$menuitem[4] eq 'newmsg'){ #special style for New Messages
- return '
-#$inlineremote[21] $inlineremote[23]
-#ENDARROWSINLINE
-# if ( &hidden_button_check() ne 'yes' ) {
-# $inlinebuttons .= (<
-#ENDINLINEICONS
-# }
-# } else { # not iconsonly
-# if ( $inlineremote[21] ne '' || $inlineremote[23] ne '' ) {
-# $inlinebuttons = (<$inlineremote[21] | | $inlineremote[23] |
-#ENDFIRSTLINE
-# }
-# if ( &hidden_button_check() ne 'yes' ) {
-# foreach my $row ( 6 .. 9 ) {
-# if ( $inlineremote[ ${row} . '1' ] ne ''
-# || $inlineremote[ $row . '2' ] ne ''
-# || $inlineremote[ $row . '3' ] ne '' )
-# {
-# $inlinebuttons .= <<"ENDLINE";
-#$inlineremote["${row}1"] | $inlineremote["${row}2"] | $inlineremote["${row}3"] |
-#ENDLINE
-# }
-# }
-# }
-# }
- }
- $breadcrumb = &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0);
- $result =(<
-// BEGIN LON-CAPA Internal
-
-$timesync
-$breadcrumb
-
-
-
-$newmail
-
-
-
-ENDREGTEXT
-# Registered, graphical output
- } else {
- my $requri=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
- $requri=&Apache::lonenc::check_encrypt(&unescape($requri));
- my $cursymb=&Apache::lonenc::check_encrypt($env{'request.symb'});
- my $navstatus=&get_nav_status();
- my $clearcstr;
-
- if ($env{'user.adv'}) { $clearcstr='clearbut(6,1)'; }
- $result = (<
-//
-
-ENDREGTHIS
- }
-# =============================================================================
- } else {
-# ========================================== This can or will not be registered
- if ($noremote) {
-# Not registered
- $result= (<
-//
-
-ENDDONOTREGTHIS
- }
-# =============================================================================
- }
- return $result;
+ return Apache::lonhtmlcommon::scripttag('', 'start')
+ . Apache::lonhtmlcommon::breadcrumbs(undef,undef,0)
+ . Apache::lonhtmlcommon::scripttag('', 'end');
}
sub is_course_upload {
@@ -925,176 +715,22 @@ sub unloadevents() {
return 'LONCAPAstale();';
}
-
-sub startupremote {
- my ($lowerurl)=@_;
- if ($env{'environment.remote'} eq 'off') {
- return ('');
- }
-#
-# The Remote actually gets launched!
-#
- my $configmenu=&rawconfig();
- my $esclowerurl=&escape($lowerurl);
- my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited');
- return(<
-//
-
-ENDREMOTESTARTUP
-}
-
-sub setflags() {
- return(<
-//
-
-ENDSETFLAGS
-}
-
-sub maincall() {
- if ($env{'environment.remote'} eq 'off') { return ''; }
- return(<
-//
-
-ENDMAINCALL
-}
-
-sub load_remote_msg {
- my ($lowerurl)=@_;
-
- if ($env{'environment.remote'} eq 'off') { return ''; }
-
- my $esclowerurl=&escape($lowerurl);
- my $link=&mt('[_1]Continue[_2] on in Inline Menu mode'
- ,''
- ,'');
- return(<
-
-
-$link
-ENDREMOTEFORM
-}
-
sub get_menu_name {
my $hostid = $Apache::lonnet::perlvar{'lonHostID'};
$hostid =~ s/\W//g;
return 'LCmenu'.$hostid;
}
-
-sub reopenmenu {
- if ($env{'environment.remote'} eq 'off') { return ''; }
- my $menuname = &get_menu_name();
- my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
- return('window.open('.$nothing.',"'.$menuname.'","",false);');
-}
-
-
-sub open {
- my $returnval='';
- if ($env{'environment.remote'} eq 'off') {
- return
- '';
- }
- my $menuname = &get_menu_name();
-
-# unless (shift eq 'unix') {
-# resizing does not work on linux because of virtual desktop sizes
-# $returnval.=(<
-ENDOPEN
- return '';
-}
-
-
# ================================================================== Raw Config
+#SD
+#this is called by
+#lonmenu
+#
sub clear {
my ($row,$col)=@_;
- unless ($env{'environment.remote'} eq 'off') {
- if (($row<1) || ($row>13)) { return ''; }
- return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
- } else {
- $inlineremote[10*$row+$col]='';
- return '';
- }
+ $inlineremote[10*$row+$col]='';
+ return '';
}
# ============================================ Switch a button or create a link
@@ -1108,22 +744,11 @@ sub switch {
$top=&mt($top);
$bot=&mt($bot);
$desc=&mt($desc);
- if (($env{'environment.remote'} ne 'off') || ($env{'environment.icons'} eq 'classic')) {
- $img=&mt($img);
- }
my $idx=10*$row+$col;
$category_members{$cat}.=':'.$idx;
- unless ($env{'environment.remote'} eq 'off') {
- if (($row<1) || ($row>13)) { return ''; }
-# Remote
- return "\n".
- qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
- } else {
# Inline Remote
- if ($env{'environment.icons'} ne 'classic') {
- $img=~s/\.gif$/\.png/;
- }
+ $img=~s/\.gif$/\.png/;
if ($nobreak==2) { return ''; }
my $text=$top.' '.$bot;
$text=~s/\s*\-\s*//gs;
@@ -1153,6 +778,7 @@ sub switch {
}
} else {
# Inline Menu
+#SD look here
if ($env{'environment.icons'} eq 'iconsonly') {
$inlineremote[$idx]=''.$pic.'';
} else {
@@ -1161,7 +787,6 @@ sub switch {
'';
}
}
- }
return '';
}
@@ -1179,13 +804,6 @@ sub secondlevel {
return $output;
}
-sub openmenu {
- my $menuname = &get_menu_name();
- if ($env{'environment.remote'} eq 'off') { return ''; }
- my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
- return "window.open(".$nothing.",'".$menuname."');";
-}
-
sub inlinemenu {
undef(@inlineremote);
undef(%category_members);
@@ -1228,13 +846,7 @@ sub rawconfig {
#
my $textualoverride=shift;
my $output='';
- unless ($env{'environment.remote'} eq 'off') {
- $output.=
- "window.status='Opening Remote Control';var swmenu=".&openmenu().
-"\nwindow.status='Configuring Remote Control ';";
- } else {
- unless ($textualoverride) { return ''; }
- }
+ return '' unless $textualoverride;
my $uname=$env{'user.name'};
my $udom=$env{'user.domain'};
my $adv=$env{'user.adv'};
@@ -1408,13 +1020,6 @@ sub rawconfig {
$uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc,$cat);
}
}
- unless ($env{'environment.remote'} eq 'off') {
- $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
- if (&Apache::lonmsg::newmail()) {
- $output.='swmenu.setstatus("you have","messages");';
- }
- }
-
return $output;
}
@@ -1440,34 +1045,8 @@ sub check_for_rcrs {
return $showreqcrs;
}
-# ======================================================================= Close
-
-sub close {
- if ($env{'environment.remote'} eq 'off') { return ''; }
- my $menuname = &get_menu_name();
- return(<
-//
-
-ENDCLOSE
-}
-
# ====================================================================== Footer
-sub footer {
-
-}
-
sub nav_control_js {
my $nav=($env{'environment.remotenavmap'} eq 'on');
return (< |