--- loncom/interface/lonmenu.pm 2009/11/18 04:59:56 1.302 +++ loncom/interface/lonmenu.pm 2010/01/19 19:00:02 1.312 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.302 2009/11/18 04:59:56 raeburn Exp $ +# $Id: lonmenu.pm,v 1.312 2010/01/19 19:00:02 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,6 +150,9 @@ sub prep_menuitem { } else { # textual Link $link = &mt($$menuitem[3]); } + if($$menuitem[4] eq 'newmsg'){ #special style for New Messages + return '
  • '.$link.'
  • '; + } return '
  • '.$link.'
  • '; } @@ -290,7 +293,7 @@ sub initlittle { 'roles' => (&Apache::loncommon::show_course()? 'Courses':'Roles'), 'other' => 'Other Roles', - 'docs' => 'Edit Course', + 'docs' => 'Course Editor', 'exit' => 'Logout', 'login' => 'Log In', 'launch' => 'Launch Remote Control', @@ -512,7 +515,7 @@ sub registerurl { } sub innerregister { - my ($forcereg, $titletable) = @_; + my ($forcereg,$titletable,$bread_crumbs) = @_; my $result = ''; my ($uname,$thisdisfn); my $const_space = ($env{'request.state'} eq 'construct'); @@ -753,6 +756,14 @@ s&7&1&del.gif&delete[_1]&resource[_2]&go s&7&2&prt.gif&prepare[_1]&printout[_1]&gocstr('/adm/printout','/~$uname/$cleandisfn')&Prepare a printable document ENDMENUITEMS } + if ($noremote) { + if (ref($bread_crumbs) eq 'ARRAY') { + &Apache::lonhtmlcommon::clear_breadcrumbs(); + foreach my $crumb (@{$bread_crumbs}){ + &Apache::lonhtmlcommon::add_breadcrumb($crumb); + } + } + } } elsif ( defined($env{'request.course.id'}) && $env{'request.symb'} ne '' ) { # @@ -831,38 +842,19 @@ ENDMENUITEMS my $inlinebuttons=''; if ($addremote) { - #SD START (work in progress!) - # Arrows for navigation - Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[21] ); - Apache::lonhtmlcommon::add_breadcrumb_tool( 'A', $inlineremote[23] ); - if(hidden_button_check() ne 'yes'){ - # notes - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[93]); - # bookmark - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[91]); - # evaluate - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[81]); - # feedback - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[82]); - # print - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[83]); - # metadata - Apache::lonhtmlcommon::add_breadcrumb_tool( 'B', $inlineremote[63]); - - # ? - Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[61]); - # ? - Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[71]); - # ? - Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[72]); - # ? - Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[73]); - # ? - Apache::lonhtmlcommon::add_breadcrumb_tool( 'C', $inlineremote[92]); + Apache::lonhtmlcommon::clear_breadcrumb_tools(); + Apache::lonhtmlcommon::add_breadcrumb_tool( + 'navigation', @inlineremote[21,23]); + + if(hidden_button_check() ne 'yes') { + Apache::lonhtmlcommon::add_breadcrumb_tool( + 'tools', @inlineremote[93,91,81,82,83,63]); + + Apache::lonhtmlcommon::add_breadcrumb_tool( + 'advtools', @inlineremote[61,71,72,73,92]); } - #SD END # # Registered, textual output # if ( $env{'environment.icons'} eq 'iconsonly' ) { # $inlinebuttons = (< @@ -905,11 +896,11 @@ ENDMENUITEMS $timesync $breadcrumb - - - + + + $newmail - + @@ -1267,7 +1258,7 @@ sub switch { my $pic= ''.$text.''; + '" align="'.($nobreak==3?'right':'left').'" class="LC_icon" />'; if ($env{'browser.interface'} eq 'faketextual') { # Main Menu if ($nobreak==3) { @@ -1327,15 +1318,15 @@ sub inlinemenu { undef(%category_members); # calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control &rawconfig(1); - my $output=''; + my $output='
    '; for (my $col=1; $col<=2; $col++) { $output.='
    '; for (my $row=1; $row<=8; $row++) { foreach my $cat (keys(%category_members)) { if ($category_positions{$cat} ne "$col,$row") { next; } #$output.=''; - $output.='
    '; - $output.='

    '.&mt($category_names{$cat}).'

    '; + $output.='
    '; + $output.='

    '.&mt($category_names{$cat}).'

    '; $output.='
    '.&mt($category_names{$cat}).'
    '; my %active=(); foreach my $menu_item (split(/\:/,$category_members{$cat})) { @@ -1452,15 +1443,31 @@ sub rawconfig { } } elsif ($pro =~ /^courseenv_(.*)$/) { my $key = $1; - if (($env{'course.'.$env{'request.course.id'}.'.'.$key}) && - ($crstype ne 'Community')) { - $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); + if ($crstype ne 'Community') { + my $coursepref = $env{'course.'.$env{'request.course.id'}.'.'.$key}; + if ($key eq 'canuse_pdfforms') { + if ($env{'request.course.id'} && $coursepref eq '') { + my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'}); + $coursepref = $domdefs{'canuse_pdfforms'}; + } + } + if ($coursepref) { + $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); + } } } elsif ($pro =~ /^communityenv_(.*)$/) { my $key = $1; - if (($env{'course.'.$env{'request.course.id'}.'.'.$key}) && - ($crstype eq 'Community')) { - $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); + if ($crstype eq 'Community') { + my $coursepref = $env{'course.'.$env{'request.course.id'}.'.'.$key}; + if ($key eq 'canuse_pdfforms') { + if ($env{'request.course.id'} && $coursepref eq '') { + my %domdefs = &Apache::lonnet::get_domain_defaults($env{'course.'.$env{'request.course.id'}.'.domain'}); + $coursepref = $domdefs{'canuse_pdfforms'}; + } + } + if ($coursepref) { + $output.=&switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat); + } } } elsif ($pro =~ /^course_(.*)$/) { # Check for permissions inside of a course @@ -1605,6 +1612,31 @@ function gonav(url) { NAVCONTROL } +sub dc_popup_js { + my %lt = &Apache::lonlocal::texthash( + more => '(More ...)', + less => '(Less ...)', + ); + return <<"END"; + +function showCourseID() { + document.getElementById('dccid').style.display='block'; + document.getElementById('dccid').style.textAlign='left'; + document.getElementById('dccid').style.textFace='normal'; + document.getElementById('dccidtext').innerHTML ='$lt{'less'}'; + return; +} + +function hideCourseID() { + document.getElementById('dccid').style.display='none'; + document.getElementById('dccidtext').innerHTML ='$lt{'more'}'; + return; +} + +END + +} + sub utilityfunctions { my $caller = shift; unless ($env{'environment.remote'} eq 'off' || @@ -1622,6 +1654,13 @@ sub utilityfunctions { my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'}); my $nav_control=&nav_control_js(); + my $dc_popup_cid; + if ($env{'user.adv'} && exists($env{'user.role.dc./'. + $env{'course.'.$env{'request.course.id'}. + '.domain'}.'/'})) { + $dc_popup_cid = &dc_popup_js(); + } + my $start_page_annotate = &Apache::loncommon::start_page('Annotator',undef, {'only_body' => 1, @@ -1649,6 +1688,7 @@ return (<