Diff for /loncom/interface/lonmenu.pm between versions 1.377 and 1.378

version 1.377, 2012/05/25 03:22:43 version 1.378, 2012/05/28 13:09:16
Line 778  ENDMENUITEMS Line 778  ENDMENUITEMS
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'navigation', @inlineremote[21,23]);                  'navigation', @inlineremote[21,23]);
   
         if(hidden_button_check() ne 'yes') {          my $countdown = &countdown_timer();
           if (&hidden_button_check() eq 'yes') {
               if ($countdown) {
                   &Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown);
               }
           } else {
               my @tools = @inlineremote[93,91,81,82,83];
               if ($countdown) {
                   unshift(@tools,$countdown);
               }
             &Apache::lonhtmlcommon::add_breadcrumb_tool(              &Apache::lonhtmlcommon::add_breadcrumb_tool(
                 'tools', @inlineremote[93,91,81,82,83]);                  'tools',@tools);
   
             #publish button in construction space              #publish button in construction space
             if ($env{'request.state'} eq 'construct'){              if ($env{'request.state'} eq 'construct'){
Line 891  sub switch { Line 900  sub switch {
    }     }
     } else {      } else {
 # Inline Menu  # Inline Menu
       $inlineremote[$idx]=          my @tools = (93,91,81,82,83);
           unless ($env{'request.state'} eq 'construct') {
               push(@tools,63);
           }
           if (($env{'environment.icons'} eq 'iconsonly') && 
               (grep(/^$idx$/,@tools))) {
               $inlineremote[$idx] =
           '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.'</a>';
           } else {
               $inlineremote[$idx] =
        '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.         '<a title="'.$desc.'" class="LC_menubuttons_link" href="javascript:'.$act.';">'.$pic.
        '<span class="LC_menubuttons_inline_text">'.$top.'&nbsp;</span></a>';         '<span class="LC_menubuttons_inline_text">'.$top.'&nbsp;</span></a>';
           }
     }      }
     return '';      return '';
 }  }
Line 1179  END Line 1198  END
   
 }  }
   
   sub countdown_toggle_js {
       return <<"END";
   
   function toggleCountdown() {
       var countdownid = document.getElementById('duedatecountdown');
       var currstyle = countdownid.style.display;
       if (currstyle == 'inline') {
           countdownid.style.display = 'none';
           document.getElementById('ddcountcollapse').innerHTML='';
           document.getElementById('ddcountexpand').innerHTML='&#9668;&nbsp;';
       } else {
           countdownid.style.display = 'inline';
           document.getElementById('ddcountcollapse').innerHTML='&#9658;&nbsp;';
           document.getElementById('ddcountexpand').innerHTML='';
       }
       return;
   }
   
   END
   }
   
 sub utilityfunctions {  sub utilityfunctions {
     my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));      my $currenturl=&Apache::lonnet::clutter(&Apache::lonnet::fixversion((split(/\?/,$env{'request.noversionuri'}))[0]));
     if ($currenturl =~ m{^/adm/wrapper/ext/}      if ($currenturl =~ m{^/adm/wrapper/ext/}
Line 1213  sub utilityfunctions { Line 1253  sub utilityfunctions {
     my $esc_url=&escape($currenturl);      my $esc_url=&escape($currenturl);
     my $esc_symb=&escape($currentsymb);      my $esc_symb=&escape($currentsymb);
   
       my $countdown = &countdown_toggle_js();
   
 return (<<ENDUTILITY)  return (<<ENDUTILITY)
   
     var currentURL=unescape("$esc_url");      var currentURL=unescape("$esc_url");
Line 1363  function open_StoredLinks_Import(rat) { Line 1405  function open_StoredLinks_Import(rat) {
   });    });
 }(jQuery));  }(jQuery));
   
   $countdown
   
 ENDUTILITY  ENDUTILITY
 }  }
   
Line 1761  sub required_privs { Line 1805  sub required_privs {
     return $privs;      return $privs;
 }  }
   
   sub countdown_timer {
       if (($env{'request.course.id'}) && ($env{'request.symb'} ne '') &&
           ($env{'request.filename'}=~/$LONCAPA::assess_re/) &&
           ($Apache::inputtags::status[-1] eq 'CAN_ANSWER')) {
           my $duedate = &Apache::lonnet::EXT("resource.0.duedate");
           if ($duedate && $duedate > time) {
               my ($collapse,$expand,$title,$currdisp);
               my @interval=&Apache::lonnet::EXT("resource.0.interval");
               if (@interval > 1) {
                   $currdisp = 'inline';
                   $collapse = '&#9658;&nbsp;';
               } else {
                   $currdisp = 'none';
                   $expand = '&#9668;&nbsp;';
               }
               unless ($env{'environment.icons'} eq 'iconsonly') {
                   $title = &mt('Timer');
               }
               my $desc = &mt('Countdown to due date/time');
               return <<END;
   
   <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
   <span id="ddcountcollapse" class="LC_menubuttons_inline_text">
   $collapse
   </a></span>
   <span id="duedatecountdown" class="LC_menubuttons_inline_text" style="display: $currdisp;"></span>
   <a href="javascript:toggleCountdown();" class="LC_menubuttons_link">
   <span id="ddcountexpand" class="LC_menubuttons_inline_text" >$expand</span>
   <img src="/res/adm/pages/timer.png" title="$desc" class="LC_icon"><span class="LC_menubuttons_inline_text">$title</span></a>
   END
           }
       }
       return;
   }
   
 # ================================================================ Main Program  # ================================================================ Main Program
   
 BEGIN {  BEGIN {

Removed from v.1.377  
changed lines
  Added in v.1.378


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>