version 1.431.2.4, 2015/05/28 12:37:14
|
version 1.434, 2015/05/28 03:14:25
|
Line 288 sub primary_menu {
|
Line 288 sub primary_menu {
|
push(@primsub,$item); |
push(@primsub,$item); |
} |
} |
if (@primsub > 0) { |
if (@primsub > 0) { |
|
if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) { |
|
$title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
|
} else { |
|
$title = &mt($title); |
|
} |
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1); |
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1); |
} elsif ($link) { |
} elsif ($link) { |
$menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>'; |
$menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>'; |
Line 510 sub create_submenu {
|
Line 515 sub create_submenu {
|
if ($target ne '') { |
if ($target ne '') { |
$disptarget = ' target="'.$target.'"'; |
$disptarget = ' target="'.$target.'"'; |
} |
} |
my $name; |
|
if ($title eq 'Personal') { |
|
if ($env{'user.name'} && $env{'user.domain'}) { |
|
$name = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
|
} else { |
|
$name = &mt($title); |
|
} |
|
} else { |
|
$name = &mt($title); |
|
} |
|
my $menu = '<li class="LC_hoverable">'. |
my $menu = '<li class="LC_hoverable">'. |
'<a href="'.$link.'"'.$disptarget.'>'. |
'<a href="'.$link.'"'.$disptarget.'>'. |
'<span class="LC_nobreak">'.$name. |
'<span class="LC_nobreak">'.$title. |
'<span class="LC_fontsize_small" style="font-weight:normal;">'. |
'<span class="LC_fontsize_small" style="font-weight:normal;">'. |
' ▼</span></span></a>'. |
' ▼</span></span></a>'. |
'<ul>'; |
'<ul>'; |
Line 932 ENDMENUITEMS
|
Line 927 ENDMENUITEMS
|
} |
} |
my ($topic_help,$topic_help_text); |
my ($topic_help,$topic_help_text); |
if ($is_const_dir == 2) { |
if ($is_const_dir == 2) { |
if ((($ENV{'SERVER_PORT'} == 443) || |
if ((($ENV{'SERVER_PORT'} == 443) || |
($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && |
($Apache::lonnet::protocol{$Apache::lonnet::perlvar{'lonHostID'}} eq 'https')) && |
(&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) { |
(&Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},'webdav'))) { |
$topic_help = 'Authoring_WebDAV,Authoring_WebDAV_Mac_10v6,Authoring_WebDAV_Mac_10v10,'. |
$topic_help = 'Authoring_WebDAV,Authoring_WebDAV_Mac_10v6,Authoring_WebDAV_Mac_10v10,'. |
'Authoring_WebDAV_Windows_v7,Authoring_WebDAV_Linux_Centos'; |
'Authoring_WebDAV_Windows_v7,Authoring_WebDAV_Linux_Centos'; |
Line 1548 function toggleCountdown() {
|
Line 1543 function toggleCountdown() {
|
END |
END |
} |
} |
|
|
# This creates a "done button" for timed events. The confirmation box is a jQuery |
|
# dialog widget. Clicking OK will set (LC_interval_done = 'true') which is checked in |
|
# lonhomework.pm. |
|
sub done_button_js { |
|
my ($type,$height) = @_; |
|
if ($height !~ /^\d+$/) { |
|
$height = 320; |
|
} |
|
my %lt = &Apache::lonlocal::texthash( |
|
title => 'WARNING!', |
|
button => 'Done', |
|
preamble => 'You are trying to end this timed event early.', |
|
map => 'Confirming that you are done will cause the time to expire and prevent you from changing any answers in the current folder.', |
|
resource => 'Confirming that you are done will cause the time to expire for this question, and prevent you from changing your answer(s).', |
|
ok => 'Click "OK" if you are completely finished.', |
|
cancel => 'Click "Cancel" to continue working.', |
|
); |
|
my $confirm; |
|
if (($type eq 'map') || ($type eq 'resource')) { |
|
$confirm = $lt{'preamble'}.' '.$lt{$type}.' '.$lt{'ok'}.' '.$lt{'cancel'}; |
|
} |
|
if ($confirm) { |
|
return <<END; |
|
|
|
<form method="post" name="LCdoneButton" action=""> |
|
<input type="hidden" name="LC_interval_done" value="" /> |
|
<button id="LC_done-confirm-opener" type="button">$lt{'button'}</button> |
|
</form> |
|
|
|
<div id="LC_done-confirm" title="$lt{'title'}"> |
|
<p>$confirm</p> |
|
</div> |
|
|
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
\$( "#LC_done-confirm" ).dialog({ autoOpen: false }); |
|
\$( "#LC_done-confirm-opener" ).click(function() { |
|
\$( "#LC_done-confirm" ).dialog( "open" ); |
|
\$( "#LC_done-confirm" ).dialog({ |
|
resizable: false, |
|
height: $height, |
|
modal: true, |
|
buttons: { |
|
"OK": function() { |
|
\$( this ).dialog( "close" ); |
|
\$( '[name="LC_interval_done"]' )[0].value = 'true'; |
|
\$( '[name="LCdoneButton"]' )[0].submit(); |
|
}, |
|
Cancel: function() { |
|
\$( this ).dialog( "close" ); |
|
} |
|
} |
|
}) |
|
}); |
|
// ]]> |
|
</script> |
|
|
|
END |
|
} else { |
|
return; |
|
} |
|
} |
|
|
|
sub utilityfunctions { |
sub utilityfunctions { |
my ($httphost) = @_; |
my ($httphost) = @_; |
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])); |
Line 1860 sub roles_selector {
|
Line 1792 sub roles_selector {
|
my $now = time; |
my $now = time; |
my (%courseroles,%seccount,%courseprivs); |
my (%courseroles,%seccount,%courseprivs); |
my $is_cc; |
my $is_cc; |
my ($js,$form,$switcher,$switchtext); |
my ($js,$form,$switcher); |
my $ccrole; |
my $ccrole; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$ccrole = 'co'; |
$ccrole = 'co'; |
Line 1948 sub roles_selector {
|
Line 1880 sub roles_selector {
|
} |
} |
} |
} |
} |
} |
$switchtext = 'Switch role'; # do not translate here |
|
my @roles_order = ($ccrole,'in','ta','ep','ad','st'); |
my @roles_order = ($ccrole,'in','ta','ep','ad','st'); |
my $numdiffsec; |
my $numdiffsec; |
if (keys(%seccount) == 1) { |
if (keys(%seccount) == 1) { |
Line 2004 sub roles_selector {
|
Line 1935 sub roles_selector {
|
} |
} |
} |
} |
if (@submenu > 0) { |
if (@submenu > 0) { |
$switcher = &create_submenu('','',$switchtext,\@submenu); |
$switcher = &create_submenu('','',&mt('Switch role'),\@submenu); |
} |
} |
} |
} |
return ($js,$form,$switcher); |
return ($js,$form,$switcher); |
Line 2286 sub countdown_timer {
|
Line 2217 sub countdown_timer {
|
if (($duedate && $duedate > time) || |
if (($duedate && $duedate > time) || |
(!$duedate && $hastimeleft) || |
(!$duedate && $hastimeleft) || |
($slot_name ne '' && $slothastime)) { |
($slot_name ne '' && $slothastime)) { |
my ($collapse,$expand,$alttxt,$title,$currdisp,$donebutton); |
my ($collapse,$expand,$alttxt,$title,$currdisp); |
if ((@interval > 1 && $hastimeleft) || |
if ((@interval > 1 && $hastimeleft) || |
($type eq 'Task' && $slothastime)) { |
($type eq 'Task' && $slothastime)) { |
$currdisp = 'inline'; |
$currdisp = 'inline'; |
$collapse = '► '; |
$collapse = '► '; |
if ((@interval > 1) && ($hastimeleft)) { |
|
$donebutton = &done_button_js($interval[1]); |
|
} |
|
} else { |
} else { |
$currdisp = 'none'; |
$currdisp = 'none'; |
$expand = '◄ '; |
$expand = '◄ '; |
Line 2303 sub countdown_timer {
|
Line 2231 sub countdown_timer {
|
$title = $alttxt.' '; |
$title = $alttxt.' '; |
} |
} |
my $desc = &mt('Countdown to due date/time'); |
my $desc = &mt('Countdown to due date/time'); |
|
|
return <<END; |
return <<END; |
$donebutton |
|
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
<a href="javascript:toggleCountdown();" class="LC_menubuttons_link"> |
<span id="ddcountcollapse" class="LC_menubuttons_inline_text"> |
<span id="ddcountcollapse" class="LC_menubuttons_inline_text"> |
$collapse |
$collapse |