version 1.504, 2021/01/02 21:07:36
|
version 1.538, 2023/09/28 15:56:48
|
Line 99 It gets filled in the BEGIN block of thi
|
Line 99 It gets filled in the BEGIN block of thi
|
|
|
=over |
=over |
|
|
=item prep_menuitems(\@menuitem,$ltitarget) |
=item prep_menuitems(\@menuitem,$target,$listclass,$linkattr) |
|
|
This routine wraps a menuitem in proper HTML. It is used by primary_menu() and |
This routine wraps a menuitem in proper HTML. It is used by primary_menu() and |
secondary_menu(). |
secondary_menu(). |
Line 210 use Apache::lonenc();
|
Line 210 use Apache::lonenc();
|
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::lonmsg(); |
use Apache::lonmsg(); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA::ltiutils; |
|
use HTML::Entities(); |
use HTML::Entities(); |
use Apache::lonwishlist(); |
use Apache::lonwishlist(); |
|
|
Line 220 use vars qw(@desklines %category_names %
|
Line 219 use vars qw(@desklines %category_names %
|
my @inlineremote; |
my @inlineremote; |
|
|
sub prep_menuitem { |
sub prep_menuitem { |
my ($menuitem,$ltitarget) = @_; |
my ($menuitem,$target,$listclass,$linkattr) = @_; |
return '' unless(ref($menuitem) eq 'ARRAY'); |
return '' unless(ref($menuitem) eq 'ARRAY'); |
my $link; |
my ($link,$targetattr); |
if ($$menuitem[1]) { # graphical Link |
if ($$menuitem[1]) { # graphical Link |
$link = "<img class=\"LC_noBorder\"" |
$link = "<img class=\"LC_noBorder\"" |
. " src=\"" . &Apache::loncommon::lonhttpdurl($$menuitem[1]) . "\"" |
. " src=\"" . &Apache::loncommon::lonhttpdurl($$menuitem[1]) . "\"" |
Line 230 sub prep_menuitem {
|
Line 229 sub prep_menuitem {
|
} else { # textual Link |
} else { # textual Link |
$link = &mt($$menuitem[3]); |
$link = &mt($$menuitem[3]); |
} |
} |
my $target = ' target="_top"'; |
if ($target ne '') { |
if ($ltitarget eq 'iframe') { |
$targetattr = ' target="'.$target.'"'; |
$target =''; |
|
} |
} |
return '<li><a' |
return ($listclass?'<li class="'.$listclass.'">':'<li>').'<a' |
# highlighting for new messages |
# highlighting for new messages |
. ( $$menuitem[4] eq 'newmsg' ? ' class="LC_new_message"' : '') |
. ( $$menuitem[4] eq 'newmsg' ? ' class="LC_new_message"' : '') |
. qq| href="$$menuitem[0]"$target>$link</a></li>|; |
. qq| href="$$menuitem[0]"$targetattr $linkattr>$link</a></li>|; |
} |
} |
|
|
# primary_menu() evaluates @primary_menu and returns a two item array, |
# primary_menu() evaluates @primary_menu and returns a two item array, |
Line 247 sub prep_menuitem {
|
Line 245 sub prep_menuitem {
|
# @primary_menu is filled within the BEGIN block of this module with |
# @primary_menu is filled within the BEGIN block of this module with |
# entries from mydesk.tab |
# entries from mydesk.tab |
sub primary_menu { |
sub primary_menu { |
my ($crstype,$ltimenu) = @_; |
my ($crstype,$ltimenu,$menucoll,$menuref,$links_disabled,$links_target) = @_; |
my (%menu,%ltiexc); |
my (%menu,%ltiexc,%menuopts); |
# each element of @primary contains following array: |
# each element of @primary contains following array: |
# (link url, icon path, alt text, link text, condition, position) |
# (link url, icon path, alt text, link text, condition, position) |
my $public; |
my $public; |
Line 265 sub primary_menu {
|
Line 263 sub primary_menu {
|
my %roles_in_env; |
my %roles_in_env; |
$rolecount = &Apache::lonroles::roles_from_env(\%roles_in_env,$update); |
$rolecount = &Apache::lonroles::roles_from_env(\%roles_in_env,$update); |
} |
} |
my ($lti,$ltitarget); |
my $lti; |
if ($env{'request.lti.login'}) { |
if ($env{'request.lti.login'}) { |
$lti = 1; |
$lti = 1; |
$ltitarget = $env{'request.lti.target'}; |
|
if (ref($ltimenu) eq 'HASH') { |
if (ref($ltimenu) eq 'HASH') { |
foreach my $item ('fullname','logout') { |
foreach my $item ('fullname','logout') { |
unless ($ltimenu->{$item}) { |
unless ($ltimenu->{$item}) { |
Line 277 sub primary_menu {
|
Line 274 sub primary_menu {
|
} |
} |
} |
} |
} |
} |
|
my ($listclass,$linkattr,$target); |
|
if ($links_disabled) { |
|
$listclass = 'LCisDisabled'; |
|
$linkattr = 'aria-disabled="true"'; |
|
} |
|
if ($links_target ne '') { |
|
$target = $links_target; |
|
} else { |
|
my ($ltitarget,$deeplinktarget); |
|
if ($env{'request.lti.login'}) { |
|
$ltitarget = $env{'request.lti.target'}; |
|
} |
|
if ($env{'request.deeplink.login'}) { |
|
$deeplinktarget = $env{'request.deeplink.target'}; |
|
} |
|
if (($ltitarget eq 'iframe') || ($deeplinktarget eq '_self')) { |
|
$target = '_self'; |
|
} else { |
|
$target = '_top'; |
|
} |
|
} |
|
if (($menucoll) && (ref($menuref) eq 'HASH')) { |
|
%menuopts = %{$menuref}; |
|
} |
foreach my $menuitem (@primary_menu) { |
foreach my $menuitem (@primary_menu) { |
# evaluate conditions |
# evaluate conditions |
next if ref($menuitem) ne 'ARRAY'; # |
next if ref($menuitem) ne 'ARRAY'; # |
Line 292 sub primary_menu {
|
Line 313 sub primary_menu {
|
# users |
# users |
next if $$menuitem[4] eq 'roles' ##show links depending on |
next if $$menuitem[4] eq 'roles' ##show links depending on |
&& (&Apache::loncommon::show_course() ##term 'Courses' or |
&& (&Apache::loncommon::show_course() ##term 'Courses' or |
|| $env{'request.lti.login'}); ##'Roles' wanted |
|| $lti); ##'Roles' wanted |
next if $$menuitem[4] eq 'courses' ##and not LTI access |
next if $$menuitem[4] eq 'courses' ##and not LTI access |
&& (!&Apache::loncommon::show_course() |
&& (!&Apache::loncommon::show_course() |
|| !$env{'request.lti.login'}); |
|| $lti); |
next if $$menuitem[4] eq 'notlti' |
next if $$menuitem[4] eq 'notlti' |
&& $lti; |
&& $lti; |
next if $$menuitem[4] eq 'ltiexc' |
next if $$menuitem[4] eq 'ltiexc' |
Line 312 sub primary_menu {
|
Line 333 sub primary_menu {
|
if ($position eq '') { |
if ($position eq '') { |
$position = 'right'; |
$position = 'right'; |
} |
} |
|
if ($env{'request.course.id'} && $menucoll) { |
|
if (($menuitem->[6]) && (!$menuopts{$menuitem->[6]})) { |
|
if ($menuitem->[6] eq 'pers') { |
|
if ($menuopts{'name'} && !$ltiexc{'fullname'} && |
|
$env{'user.name'} && $env{'user.domain'}) { |
|
$menu{$position} .= '<li><a href="#">'. |
|
&Apache::loncommon::plainname($env{'user.name'}, |
|
$env{'user.domain'}).'</a></li>'; |
|
next; |
|
} else { |
|
next; |
|
} |
|
} else { |
|
next; |
|
} |
|
} |
|
} |
if (defined($primary_submenu{$title})) { |
if (defined($primary_submenu{$title})) { |
my ($link,$target); |
my $link; |
if ($menuitem->[0] ne '') { |
if ($menuitem->[0] ne '') { |
$link = $menuitem->[0]; |
$link = $menuitem->[0]; |
unless ($ltitarget eq 'iframe') { |
|
$target = '_top'; |
|
} |
|
} else { |
} else { |
$link = '#'; |
$link = '#'; |
} |
} |
Line 331 sub primary_menu {
|
Line 366 sub primary_menu {
|
($item->[2] eq 'blog')) && |
($item->[2] eq 'blog')) && |
(!&Apache::lonnet::usertools_access('','',$item->[2], |
(!&Apache::lonnet::usertools_access('','',$item->[2], |
undef,'tools'))); |
undef,'tools'))); |
|
if ($env{'request.course.id'} && $menucoll) { |
|
next if ($item->[3]) && (!$menuopts{$item->[3]}); |
|
} |
push(@primsub,$item); |
push(@primsub,$item); |
} |
} |
if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) { |
if ($title eq 'Personal') { |
unless ($ltiexc{'fullname'}) { |
if ($env{'user.name'} && $env{'user.domain'} && !$ltiexc{'fullname'}) { |
$title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
unless (($env{'request.course.id'}) && ($menucoll) && (!$menuopts{'name'})) { |
|
$title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
|
} |
|
} |
|
next if (($env{'request.course.id'}) && ($menucoll) && ($title eq 'Personal') && |
|
(!@primsub)); |
|
if ($title eq 'Personal') { |
|
$title = &mt($title); |
} |
} |
} else { |
} else { |
$title = &mt($title); |
$title = &mt($title); |
} |
} |
if (@primsub > 0) { |
if (@primsub > 0) { |
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1); |
$menu{$position} .= &create_submenu($link,$target,$title,\@primsub,1,undef,$listclass,$linkattr); |
} elsif ($link) { |
} elsif ($link) { |
$menu{$position} .= '<li><a href="'.$link.'" target="'.$target.'">'.$title.'</a></li>'; |
$menu{$position} .= ($listclass?'<li class="'.$listclass.'">':'<li>'). |
|
'<a href="'.$link.'" target="'.$target.'" '.$linkattr.'>'.$title.'</a></li>'; |
} |
} |
} |
} |
} elsif ($$menuitem[3] eq 'Help') { # special treatment for helplink |
} elsif ($$menuitem[3] eq 'Help') { # special treatment for helplink |
Line 355 sub primary_menu {
|
Line 401 sub primary_menu {
|
'helpdeskmail', |
'helpdeskmail', |
$defdom,$origmail); |
$defdom,$origmail); |
if ($to ne '') { |
if ($to ne '') { |
$menu{$position} .= &prep_menuitem($menuitem,$ltitarget); |
$menu{$position} .= &prep_menuitem($menuitem,$target,$listclass,$linkattr); |
} |
} |
} else { |
} else { |
$menu{$position} .= '<li>'.&Apache::loncommon::top_nav_help('Help').'</li>'; |
$menu{$position} .= ($listclass?'<li class="'.$listclass.'">':'<li>'). |
|
&Apache::loncommon::top_nav_help('Help',$linkattr). |
|
'</li>'; |
|
} |
|
} elsif ($$menuitem[3] eq 'Log In') { |
|
if ($public) { |
|
if (&Apache::lonnet::get_saml_landing()) { |
|
$$menuitem[0] = '/adm/login'; |
|
} |
} |
} |
|
$menu{$position} .= prep_menuitem($menuitem,$target,$listclass,$linkattr); |
} else { |
} else { |
$menu{$position} .= prep_menuitem($menuitem,$ltitarget); |
$menu{$position} .= prep_menuitem($menuitem,$target,$listclass,$linkattr); |
} |
} |
} |
} |
my @output = ('',''); |
my @output = ('',''); |
Line 400 sub getauthor{
|
Line 455 sub getauthor{
|
} |
} |
|
|
sub secondary_menu { |
sub secondary_menu { |
my ($httphost,$ltiscope,$ltimenu,$noprimary) = @_; |
my ($httphost,$ltiscope,$ltimenu,$noprimary,$menucoll,$menuref, |
|
$links_disabled,$links_target) = @_; |
my $menu; |
my $menu; |
|
|
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
Line 424 sub secondary_menu {
|
Line 480 sub secondary_menu {
|
my $canplc = &Apache::lonnet::allowed('plc', $crs_sec); |
my $canplc = &Apache::lonnet::allowed('plc', $crs_sec); |
my $author = &getauthor(); |
my $author = &getauthor(); |
|
|
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv,$grouptools,$lti,$ltimapres,%ltiexc); |
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv,$grouptools, |
|
$lti,$ltimapres,%ltiexc,%menuopts); |
$grouptools = 0; |
$grouptools = 0; |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
Line 472 sub secondary_menu {
|
Line 529 sub secondary_menu {
|
} |
} |
} |
} |
} |
} |
|
if (($menucoll) && (ref($menuref) eq 'HASH')) { |
|
%menuopts = %{$menuref}; |
|
} |
|
|
|
my ($listclass,$linkattr,$target); |
|
if ($links_disabled) { |
|
$listclass = 'LCisDisabled'; |
|
$linkattr = 'aria-disabled="true"'; |
|
} |
|
|
my ($canmodifycoauthor); |
my ($canmodifycoauthor); |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
if ($env{'request.role'} eq "au./$env{'user.domain'}/") { |
Line 482 sub secondary_menu {
|
Line 548 sub secondary_menu {
|
} |
} |
} |
} |
|
|
my ($roleswitcher_js,$roleswitcher_form,$ltitarget); |
my ($roleswitcher_js,$roleswitcher_form); |
if ($env{'request.lti.login'}) { |
if ($links_target ne '') { |
$ltitarget = $env{'request.lti.target'}; |
$target = $links_target; |
|
} else { |
|
my ($ltitarget,$deeplinktarget); |
|
if ($env{'request.lti.login'}) { |
|
$ltitarget = $env{'request.lti.target'}; |
|
} |
|
if ($env{'request.deeplink.login'}) { |
|
$deeplinktarget = $env{'request.deeplink.target'}; |
|
} |
|
if (($ltitarget eq 'iframe') || ($deeplinktarget eq '_self')) { |
|
$target = '_self'; |
|
} else { |
|
$target = '_top'; |
|
} |
} |
} |
|
|
foreach my $menuitem (@secondary_menu) { |
foreach my $menuitem (@secondary_menu) { |
Line 534 sub secondary_menu {
|
Line 613 sub secondary_menu {
|
&& $ltiexc{'logout'}; |
&& $ltiexc{'logout'}; |
|
|
my $title = $menuitem->[3]; |
my $title = $menuitem->[3]; |
|
if ($env{'request.course.id'} && $menucoll) { |
|
unless ($$menuitem[5] eq 'roles') { |
|
next if (($$menuitem[5]) && (!$menuopts{$$menuitem[5]})); |
|
} |
|
} |
if (defined($secondary_submenu{$title})) { |
if (defined($secondary_submenu{$title})) { |
my ($link,$target); |
my $link; |
if ($menuitem->[0] ne '') { |
if ($menuitem->[0] ne '') { |
$link = $menuitem->[0]; |
$link = $menuitem->[0]; |
unless ($ltitarget eq 'iframe') { |
|
$target = '_top'; |
|
} |
|
} else { |
} else { |
$link = '#'; |
$link = '#'; |
} |
} |
Line 568 sub secondary_menu {
|
Line 649 sub secondary_menu {
|
push(@scndsub,$item); |
push(@scndsub,$item); |
} |
} |
} |
} |
if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'} ) { |
if ($title eq 'Personal' && $env{'user.name'} && $env{'user.domain'}) { |
unless ($ltiexc{'fullname'}) { |
unless ($ltiexc{'fullname'}) { |
$title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
$title = &Apache::loncommon::plainname($env{'user.name'},$env{'user.domain'}); |
} |
} |
} |
} |
if (@scndsub > 0) { |
if (@scndsub > 0) { |
$menu .= &create_submenu($link,$target,$title,\@scndsub,1); |
$menu .= &create_submenu($link,$target,&mt($title),\@scndsub,1,undef, |
|
$listclass,$linkattr); |
} elsif ($link ne '#') { |
} elsif ($link ne '#') { |
$menu .= '<li><a href="'.$link.'" target="'.$target.'">'.&mt($title).'</a></li>'; |
$menu .= ($listclass?'<li class="'.$listclass.'">':'<li>'). |
|
'<a href="'.$link.'" target="'.$target.'" '.$linkattr.'>'. |
|
&mt($title).'</a></li>'; |
} |
} |
} |
} |
} elsif ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { |
} elsif ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) { |
# special treatment for role selector |
# special treatment for role selector |
($roleswitcher_js,$roleswitcher_form,my $switcher) = |
my ($switcher,$has_opa_priv); |
|
($roleswitcher_js,$roleswitcher_form,$switcher,$has_opa_priv) = |
&roles_selector( |
&roles_selector( |
$env{'course.' . $env{'request.course.id'} . '.domain'}, |
$env{'course.' . $env{'request.course.id'} . '.domain'}, |
$env{'course.' . $env{'request.course.id'} . '.num'}, |
$env{'course.' . $env{'request.course.id'} . '.num'}, |
$httphost,$ltitarget |
$httphost,$target,$menucoll,$menuref |
); |
); |
|
if (($$menuitem[5]) && (!$menuopts{$$menuitem[5]})) { |
|
next unless ($has_opa_priv); |
|
} |
$menu .= $switcher; |
$menu .= $switcher; |
} elsif ($$menuitem[3] eq 'Help') { # special treatment for helplink |
} elsif ($$menuitem[3] eq 'Help') { # special treatment for helplink |
next if ($crstype eq 'Placement'); |
next if ($crstype eq 'Placement'); |
Line 604 sub secondary_menu {
|
Line 692 sub secondary_menu {
|
} |
} |
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { |
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { |
if (($ENV{'SERVER_PORT'} == 443) || ($env{'request.use_absolute'} =~ m{^https://})) { |
if (($ENV{'SERVER_PORT'} == 443) || ($env{'request.use_absolute'} =~ m{^https://})) { |
unless (&Apache::lonnet::uses_sts()) { |
unless ((&Apache::lonnet::uses_sts()) || (&Apache::lonnet::waf_allssl())) { |
unless ($$menuitem[0] =~ m{^https?://}) { |
unless ($$menuitem[0] =~ m{^https?://}) { |
$$menuitem[0] = 'http://'.$ENV{'SERVER_NAME'}.$$menuitem[0]; |
$$menuitem[0] = 'http://'.$ENV{'SERVER_NAME'}.$$menuitem[0]; |
} |
} |
Line 616 sub secondary_menu {
|
Line 704 sub secondary_menu {
|
} |
} |
$$menuitem[0] = &HTML::Entities::encode($$menuitem[0],'&<>"'); |
$$menuitem[0] = &HTML::Entities::encode($$menuitem[0],'&<>"'); |
} |
} |
$menu .= &prep_menuitem(\@$menuitem,$ltitarget); |
$menu .= &prep_menuitem(\@$menuitem,$target,$listclass,$linkattr); |
} |
} |
} |
} |
if ($menu =~ /\[url\].*\[symb\]/) { |
if ($menu =~ /\[url\].*\[symb\]/) { |
Line 654 sub secondary_menu {
|
Line 742 sub secondary_menu {
|
} |
} |
|
|
sub create_submenu { |
sub create_submenu { |
my ($link,$target,$title,$submenu,$translate,$addclass) = @_; |
my ($link,$target,$title,$submenu,$translate,$addclass,$listclass,$linkattr) = @_; |
return unless (ref($submenu) eq 'ARRAY'); |
return unless (ref($submenu) eq 'ARRAY'); |
my $disptarget; |
my $targetattr; |
if ($target ne '') { |
if (($target ne '') && ($link ne '#')) { |
$disptarget = ' target="'.$target.'"'; |
$targetattr = ' target="'.$target.'"'; |
} |
} |
my $menu = '<li class="LC_hoverable '.$addclass.'">'. |
my $menu = '<li class="LC_hoverable '.$addclass.'">'. |
'<a href="'.$link.'"'.$disptarget.'>'. |
'<a href="'.$link.'"'.$targetattr.'>'. |
'<span class="LC_nobreak">'.$title. |
'<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>'. |
Line 669 sub create_submenu {
|
Line 757 sub create_submenu {
|
|
|
# $link and $title are only used in the initial string written in $menu |
# $link and $title are only used in the initial string written in $menu |
# as seen above, not needed for nested submenus |
# as seen above, not needed for nested submenus |
$menu .= &build_submenu($target, $submenu, $translate, '1'); |
$menu .= &build_submenu($target, $submenu, $translate, '1', $listclass, $linkattr); |
$menu .= '</ul></li>'; |
$menu .= '</ul></li>'; |
|
|
return $menu; |
return $menu; |
Line 679 sub create_submenu {
|
Line 767 sub create_submenu {
|
# build the dropdown (and nested submenus) recursively |
# build the dropdown (and nested submenus) recursively |
# see perldoc create_submenu documentation for further information |
# see perldoc create_submenu documentation for further information |
sub build_submenu { |
sub build_submenu { |
my ($target, $submenu, $translate, $first_level) = @_; |
my ($target, $submenu, $translate, $first_level, $listclass, $linkattr) = @_; |
unless (@{$submenu}) { |
unless (@{$submenu}) { |
return ''; |
return ''; |
} |
} |
Line 738 sub build_submenu {
|
Line 826 sub build_submenu {
|
} |
} |
$href =~ s/\[returnurl\]/$returnurl/; |
$href =~ s/\[returnurl\]/$returnurl/; |
} |
} |
|
my $targetattr; |
unless (($href eq '') || ($href =~ /^\#/)) { |
unless (($href eq '') || ($href =~ /^\#/)) { |
if ($target eq '_top') { |
if ($target ne '') { |
$target = ' target="_top"'; |
$targetattr = ' target="'.$target.'"'; |
} |
} |
} |
} |
|
|
$menu .= '<li style="margin:0;padding:0;'. $bordertop . $borderbot .'">'; |
$menu .= '<li '; |
$menu .= '<a href="'.$href.'"'.$target.'>' . $title . '</a>'; |
$menu .= ($listclass?'class="'.$listclass.'" ':''); |
|
$menu .= 'style="margin:0;padding:0;'. $bordertop . $borderbot .'">'; |
|
$menu .= '<a href="'.$href.'"'.$targetattr.' '.$linkattr.'>' . $title . '</a>'; |
$menu .= '</li>'; |
$menu .= '</li>'; |
} |
} |
} |
} |
Line 754 sub build_submenu {
|
Line 845 sub build_submenu {
|
} |
} |
|
|
sub innerregister { |
sub innerregister { |
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname,$ltiscope,$ltiuri) = @_; |
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname, |
|
$ltiscope,$ltiuri,$showncrumbsref) = @_; |
my $const_space = ($env{'request.state'} eq 'construct'); |
my $const_space = ($env{'request.state'} eq 'construct'); |
my $is_const_dir = 0; |
my $is_const_dir = 0; |
|
|
Line 795 sub innerregister {
|
Line 887 sub innerregister {
|
} |
} |
} |
} |
} |
} |
unless (($forcereg) && |
unless ((($crstype eq 'Placement') && (!$env{'request.role.adv'})) || |
($env{'request.noversionuri'} eq '/adm/navmaps') && |
|
($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'}) || |
|
(($crstype eq 'Placement') && (!$env{'request.role.adv'})) || |
|
($ltiscope eq 'map') || ($ltiscope eq 'resource')) { |
($ltiscope eq 'map') || ($ltiscope eq 'resource')) { |
@crumbs = ({text => $crstype.' Contents', |
@crumbs = ({text => $crstype.' Contents', |
href => "Javascript:gopost('/adm/navmaps','')"}); |
href => "Javascript:gopost('/adm/navmaps','')"}); |
Line 845 sub innerregister {
|
Line 934 sub innerregister {
|
if ($env{'form.title'}) { |
if ($env{'form.title'}) { |
$title = $env{'form.title'}; |
$title = $env{'form.title'}; |
} |
} |
my $trail; |
my ($trail,$cnum,$cdom); |
|
if ($env{'form.folderpath'}) { |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
$cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
&Apache::loncommon::validate_folderpath(1,'',$cnum,$cdom); |
|
} |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname); |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname); |
|
$title = &HTML::Entities::encode($title,'\'"<>&'); |
($trail) = |
($trail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); |
} else { |
} else { |
&Apache::lonhtmlcommon::add_breadcrumb( |
&Apache::lonhtmlcommon::add_breadcrumb( |
{text => "Supplemental $crstype Content", |
{text => "Supplemental $crstype Content", |
href => "javascript:gopost('/adm/supplemental','')"}); |
href => "javascript:gopost('/adm/supplemental','')"}); |
$title = &mt('View Resource'); |
$title = &HTML::Entities::encode(&mt('View Resource'),'\'"<>&'); |
($trail) = |
($trail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); |
|
} |
|
if (ref($showncrumbsref)) { |
|
$$showncrumbsref = 1; |
} |
} |
return $trail; |
return $trail; |
} elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) { |
} elsif ($resurl =~ m{^\Q/uploaded$courseurl/portfolio/syllabus/}) { |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&prepare_functions('/public'.$courseurl."/syllabus", |
&prepare_functions('/public'.$courseurl."/syllabus", |
$forcereg,$group,undef,undef,1,$hostname); |
$forcereg,$group,undef,undef,1,$hostname); |
$title = &mt('Syllabus File'); |
$title = &HTML::Entities::encode(&mt('Syllabus File'),'\'"<>&'); |
|
my ($trail) = |
|
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); |
|
if (ref($showncrumbsref)) { |
|
$$showncrumbsref = 1; |
|
} |
|
return $trail; |
|
} elsif (($resurl eq '/public'.$courseurl.'/syllabus') && |
|
($env{'form.folderpath'})) { |
|
if ($env{'form.title'}) { |
|
$title = $env{'form.title'}; |
|
} else { |
|
$title = 'Syllabus'; |
|
} |
|
&prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname); |
|
$title = &HTML::Entities::encode($title,'\'"<>&'); |
my ($trail) = |
my ($trail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,$hostname); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,1); |
return $trail; |
return $trail; |
} |
} |
unless ($env{'request.state'} eq 'construct') { |
unless ($env{'request.state'} eq 'construct') { |
Line 960 sub innerregister {
|
Line 1073 sub innerregister {
|
'Folder/Page Content'); |
'Folder/Page Content'); |
} |
} |
# End modifiable folder/page container check |
# End modifiable folder/page container check |
|
|
|
# |
|
# Determine whether to show View As button for shortcut to display problem, answer, and submissions |
|
# |
|
|
|
if (($env{'request.symb'} ne '') && |
|
($env{'request.filename'}=~/$LONCAPA::assess_re/) && |
|
(($perms{'mgr'}) || ($perms{'vgr'}))) { |
|
my ($viewas,$text,$change,$visibility,$vuname,$vudom,$vid,$leftvis,$defdom,$righticon); |
|
my %lt = &Apache::lonlocal::texthash( |
|
view => 'View', |
|
upda => 'Update', |
|
); |
|
if ($env{'request.user_in_effect'} =~ /^($match_username):($match_domain)$/) { |
|
($vuname,$vudom) = ($1,$2); |
|
unless (&Apache::lonnet::is_advanced_user($vudom,$vuname)) { |
|
$vid = (&Apache::lonnet::idrget($vudom,$vuname))[1]; |
|
} |
|
$viewas = $env{'request.user_in_effect'}; |
|
$text = $lt{'upda'}; |
|
$change = 'off'; |
|
$visibility = 'inline'; |
|
$leftvis = 'none'; |
|
$defdom = $vudom; |
|
$righticon = '✖'; |
|
} else { |
|
$text = $lt{'view'}; |
|
$change = 'on'; |
|
$visibility = 'none'; |
|
$leftvis = 'inline'; |
|
$defdom = $cdom; |
|
} |
|
my $sellink = &Apache::loncommon::selectstudent_link('userview','vuname','vudom','','','vuidentifier'); |
|
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
|
my $shownsymb = &HTML::Entities::encode(&Apache::lonenc::check_encrypt($env{'request.symb'}),'<>&"'); |
|
my $input = &mt('[_1]Username:[_2] or [_3]ID:[_4] | ', |
|
'<label><input type="radio" name="vuidentifier" value="uname" checked="checked" onclick="javascript:toggleIdentifier(this.form);" />', |
|
'</label><input name="vuname" type="text" size="6" value="'.$vuname.'" id="LC_vuname" />', |
|
'<label><input type="radio" name="vuidentifier" value="uid" onclick="javascript:toggleIdentifier(this.form);" />', |
|
'</label><input name="vid" type="hidden" size="6" value="'.$vid.'" id="LC_vid" />'). |
|
'<input name="vudom" type="hidden" value="'.$defdom.'" />'. |
|
'<input name="LC_viewas" type="hidden" value="'.$viewas.'" />', |
|
'<input name="symb" type="hidden" value="'.$shownsymb.'" />'; |
|
my $chooser = <<END; |
|
$selscript |
|
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link"> |
|
<span id="usexpand" class="LC_menubuttons_inline_text" style="display:$leftvis">► </span> |
|
</a> |
|
<fieldset id="LC_selectuser" style="display:$visibility"> |
|
<form name="userview" action="" method="post" onsubmit="event.preventDefault(); return validCourseUser(this,'$change');"> |
|
<span class="LC_menubuttons_inline_text LC_nobreak"> |
|
$input |
|
$sellink |
|
</span> |
|
<input type="submit" value="$text" /> |
|
</form> |
|
</fieldset> |
|
<a href="javascript:toggleViewAsUser('$change');" class="LC_menubuttons_link"> |
|
<span id="uscollapse" class="LC_menubuttons_inline_text">$righticon</span> |
|
</a> |
|
END |
|
&switch('','',7,5,'viewuser.png','View As','user[_1]', |
|
'toggleViewAsUser('."'$change'".')', |
|
'View As','','',$chooser); |
|
} |
|
# End view as user check |
|
|
} |
} |
# End course context |
# End course context |
|
|
# Prepare the rest of the buttons |
# Prepare the rest of the buttons |
my ($menuitems,$got_prt,$got_wishlist); |
my ($menuitems,$got_prt,$got_wishlist,$crsauthor); |
if ($const_space) { |
if ($const_space) { |
# |
# |
# We are in construction space |
# We are in construction space |
Line 973 sub innerregister {
|
Line 1153 sub innerregister {
|
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my ($udom,$uname,$thisdisfn) = |
my ($udom,$uname,$thisdisfn) = |
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
($env{'request.filename'}=~m{^\Q$londocroot/priv/\E([^/]+)/([^/]+)/(.*)$}); |
|
my $crsauthor; |
|
if (($env{'request.course.id'}) && |
|
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
|
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
|
$crsauthor = 1; |
|
} |
my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; |
my $currdir = '/priv/'.$udom.'/'.$uname.'/'.$thisdisfn; |
if ($currdir =~ m-/$-) { |
if ($currdir =~ m-/$-) { |
$is_const_dir = 1; |
$is_const_dir = 1; |
if ($thisdisfn eq '') { |
if (($thisdisfn eq '') && ($crsauthor)) { |
unless (($env{'request.course.id'}) && |
$is_const_dir = 2; |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
|
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
|
$is_const_dir = 2; |
|
} |
|
} |
} |
|
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
|
$menuitems=(<<ENDMENUITEMS); |
|
s&6&3&pub.png&Publish&dir[_2]&gocstr('/adm/publish','$esc_currdir')&Publish this Directory |
|
s&7&4&docs-22x22.png&Edit Metadata&defaults[_1]&gopost('${esc_currdir}default.meta','')&Edit metadata for this Directory |
|
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','$esc_currdir')&Print contents of directory |
|
s&7&1&del.png&Delete&dir[_3]&gocstr('/adm/cfile?action=delete','$esc_currdir')&Delete this Directory |
|
ENDMENUITEMS |
} else { |
} else { |
$currdir =~ s|[^/]+$||; |
$currdir =~ s|[^/]+$||; |
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $cleandisfn = &Apache::loncommon::escape_single($thisdisfn); |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
my $esc_currdir = &Apache::loncommon::escape_single($currdir); |
|
my $pubfile = "/res/$udom/$uname/$thisdisfn"; |
|
my $candelete = 1; |
|
if (-e $londocroot.$pubfile) { |
|
unless (&Apache::lonnet::metadata($pubfile,'obsolete')) { |
|
undef($candelete); |
|
} |
|
} |
# |
# |
# Probably should be in mydesk.tab |
# Probably should be in mydesk.tab |
# |
# |
$menuitems=(<<ENDMENUITEMS); |
if (($crsauthor) && ($pubfile eq "/res/$udom/$uname/default.rights")) { |
|
$menuitems=(<<ENDMENUITEMS); |
|
s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory |
|
s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource |
|
ENDMENUITEMS |
|
} else { |
|
$menuitems=(<<ENDMENUITEMS); |
s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory |
s&6&1&list.png&Directory&dir[_1]&golist('$esc_currdir')&List current directory |
s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version |
s&6&2&rtrv.png&Retrieve&version[_1]&gocstr('/adm/retrieve','/priv/$udom/$uname/$cleandisfn')&Retrieve old version |
s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource |
s&6&3&pub.png&Publish&resource[_3]&gocstr('/adm/publish','/priv/$udom/$uname/$cleandisfn')&Publish this resource |
|
s&7&3©.png&Copy&resource[_4]&gocstr('/adm/cfile?action=copy','/priv/$udom/$uname/$cleandisfn')&Copy this resource |
|
ENDMENUITEMS |
|
} |
|
# |
|
# Rename and Delete only available if obsolete or unpublished |
|
# |
|
if ($candelete) { |
|
$menuitems .= (<<ENDMENUITEMS); |
|
s&7&4&rename.png&Rename&resource[_5]&gocstr('/adm/cfile?action=rename','/priv/$udom/$uname/$cleandisfn')&Rename this resource |
s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource |
s&7&1&del.png&Delete&resource[_2]&gocstr('/adm/cfile?action=delete','/priv/$udom/$uname/$cleandisfn')&Delete this resource |
|
ENDMENUITEMS |
|
} |
|
$menuitems .= (<<ENDMENUITEMS); |
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document |
s&7&2&prt.png&Print&printout[_1]&gocstr('/adm/printout','/priv/$udom/$uname/$cleandisfn')&Prepare a printable document |
ENDMENUITEMS |
ENDMENUITEMS |
} |
} |
Line 1070 ENDMENUITEMS
|
Line 1284 ENDMENUITEMS
|
$got_prt = 1; |
$got_prt = 1; |
if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/) |
if (($env{'user.adv'}) && ($env{'request.uri'} =~ /^\/res/) |
&& (!$env{'request.enc'})) { |
&& (!$env{'request.enc'})) { |
my ($cnum,$cdom) = &Apache::loncommon::crsauthor_url($env{'request.uri'}); |
my $privurl = $env{'request.uri'}; |
unless ($cnum) { |
$privurl =~ s{^/res/}{/priv/}; |
|
my ($cnum,$cdom) = &Apache::loncommon::crsauthor_url($privurl); |
|
if ($cnum) { |
|
$crsauthor = 1; |
|
} else { |
# wishlist is only available for users with access to resource-pool |
# wishlist is only available for users with access to resource-pool |
# and links can only be set for resources within the resource-pool |
# and links can only be set for resources within the resource-pool |
$menuitems .= (<<ENDMENUITEMS); |
$menuitems .= (<<ENDMENUITEMS); |
Line 1126 s&8&3&prt.png&Print&printout[_1]&gopost(
|
Line 1344 s&8&3&prt.png&Print&printout[_1]&gopost(
|
ENDMENUITEMS |
ENDMENUITEMS |
$got_prt = 1; |
$got_prt = 1; |
} |
} |
unless ($got_wishlist) { |
unless (($got_wishlist) || ($crsauthor)) { |
if (($env{'user.adv'}) && (!$env{'request.enc'})) { |
if (($env{'user.adv'}) && (!$env{'request.enc'})) { |
# wishlist is only available for users with access to resource-pool |
# wishlist is only available for users with access to resource-pool |
$menuitems .= (<<ENDMENUITEMS); |
$menuitems .= (<<ENDMENUITEMS); |
Line 1154 ENDMENUITEMS
|
Line 1372 ENDMENUITEMS
|
} |
} |
} |
} |
} |
} |
my $showprogress; |
my ($showprogress,$linkprotout); |
if (($crstype eq 'Placement') && (!$env{'request.role.adv'})) { |
if (($crstype eq 'Placement') && (!$env{'request.role.adv'})) { |
$showprogress = &placement_progress(); |
$showprogress = &placement_progress(); |
} |
} |
|
if ($env{'request.deeplink.login'}) { |
|
$linkprotout = &linkprot_exit(); |
|
} |
|
|
my $addremote=0; |
my $addremote=0; |
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} } |
foreach (@inlineremote) { if ($_ ne '') { $addremote=1; last;} } |
Line 1183 ENDMENUITEMS
|
Line 1404 ENDMENUITEMS
|
if ($countdown) { |
if ($countdown) { |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown); |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$countdown); |
} |
} |
|
if ($linkprotout) { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout); |
|
} |
if ($showprogress) { |
if ($showprogress) { |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress); |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress); |
} |
} |
Line 1191 ENDMENUITEMS
|
Line 1415 ENDMENUITEMS
|
if ($countdown) { |
if ($countdown) { |
unshift(@tools,$countdown); |
unshift(@tools,$countdown); |
} |
} |
|
if ($linkprotout) { |
|
unshift(@tools,$linkprotout); |
|
} |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'tools',@tools); |
'tools',@tools); |
|
|
Line 1208 ENDMENUITEMS
|
Line 1435 ENDMENUITEMS
|
if ($showprogress) { |
if ($showprogress) { |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress); |
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$showprogress); |
} |
} |
|
if ($linkprotout) { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool('tools',$linkprotout); |
|
} |
} |
} |
my ($topic_help,$topic_help_text); |
my ($topic_help,$topic_help_text); |
if ($is_const_dir == 2) { |
if ($is_const_dir == 2) { |
Line 1219 ENDMENUITEMS
|
Line 1449 ENDMENUITEMS
|
$topic_help_text = 'About WebDAV access'; |
$topic_help_text = 'About WebDAV access'; |
} |
} |
} |
} |
|
if (ref($showncrumbsref)) { |
|
$$showncrumbsref = 1; |
|
} |
return &Apache::lonhtmlcommon::scripttag('', 'start') |
return &Apache::lonhtmlcommon::scripttag('', 'start') |
. &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'','','','',$topic_help,$topic_help_text) |
. &Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'','','','',$topic_help,$topic_help_text) |
. &Apache::lonhtmlcommon::scripttag('', 'end'); |
. &Apache::lonhtmlcommon::scripttag('', 'end'); |
Line 1242 sub get_editbutton {
|
Line 1475 sub get_editbutton {
|
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$suppanchor = $env{'form.anchor'}; |
$suppanchor = $env{'form.anchor'}; |
} |
} |
|
my $shownsymb; |
|
if ($env{'request.symb'}) { |
|
$shownsymb = &Apache::lonenc::check_encrypt($env{'request.symb'}); |
|
} |
$jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver, |
$jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home,$switchserver, |
$forceedit,$forcereg,$env{'request.symb'}, |
$forceedit,$forcereg,$env{'request.symb'},$shownsymb, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
&escape($env{'form.title'}),$hostname, |
&escape($env{'form.title'}),$hostname, |
$env{'form.idx'},&escape($env{'form.suppurl'}), |
$env{'form.idx'},&escape($env{'form.suppurl'}), |
Line 1279 sub prepare_functions {
|
Line 1516 sub prepare_functions {
|
|
|
my $editbutton = ''; |
my $editbutton = ''; |
my $viewsrcbutton = ''; |
my $viewsrcbutton = ''; |
|
my $clientip = &Apache::lonnet::get_requestor_ip(); |
# |
# |
# Determine whether or not to display 'Edit' or 'View Source' icon/button |
# Determine whether or not to display 'Edit' or 'View Source' icon/button |
# |
# |
if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { |
if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { |
my $blocked = &Apache::loncommon::blocking_status('about',$2,$1); |
my $blocked = &Apache::loncommon::blocking_status('about',$clientip,$2,$1); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
&Apache::lonnet::can_edit_resource($file,$cnum,$cdom, |
Line 1401 sub prepare_functions {
|
Line 1639 sub prepare_functions {
|
if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { |
if ($resurl =~ m{^/?adm/($match_domain)/($match_username)/aboutme$}) { |
my ($sdom,$sname) = ($1,$2); |
my ($sdom,$sname) = ($1,$2); |
unless (&Apache::lonnet::is_course($sdom,$sname)) { |
unless (&Apache::lonnet::is_course($sdom,$sname)) { |
my $blocked = &Apache::loncommon::blocking_status('about',$sname,$sdom); |
my $blocked = &Apache::loncommon::blocking_status('about',$clientip,$sname,$sdom); |
unless ($blocked) { |
unless ($blocked) { |
&switch('','',6,4,'mail-message-new-22x22.png','Message to user', |
&switch('','',6,4,'mail-message-new-22x22.png','Message to user', |
'', |
'', |
Line 1496 sub advtools_crumbs {
|
Line 1734 sub advtools_crumbs {
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', @funcs[61,64,65,66,67,74]); |
'advtools', @funcs[61,64,65,66,67,74]); |
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
} elsif ($env{'request.noversionuri'} !~ m{^/adm/(navmaps|viewclasslist)(\?|$)}) { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
if ($env{'request.state'} eq 'construct') { |
'advtools', @funcs[61,71,72,73,74,92]); |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @funcs[61,73,74,71,72]); |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
|
'advtools', @funcs[61,71,72,73,74,75,92]); |
|
} |
} elsif ($env{'request.noversionuri'} eq '/adm/viewclasslist') { |
} elsif ($env{'request.noversionuri'} eq '/adm/viewclasslist') { |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
&Apache::lonhtmlcommon::add_breadcrumb_tool( |
'advtools', $funcs[61]); |
'advtools', $funcs[61]); |
Line 1518 sub clear {
|
Line 1761 sub clear {
|
# The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)". |
# The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)". |
|
|
sub switch { |
sub switch { |
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak)=@_; |
my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$cat,$nobreak,$form)=@_; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$uname/$uname/g; |
$act=~s/\$udom/$udom/g; |
$act=~s/\$udom/$udom/g; |
$top=&mt($top); |
$top=&mt($top); |
Line 1569 sub switch {
|
Line 1812 sub switch {
|
} else { |
} else { |
$inlineremote[$idx] = |
$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.' </span></a>'; |
'<span class="LC_menubuttons_inline_text">'.$top.' </span></a>'.$form; |
} |
} |
} |
} |
return ''; |
return ''; |
Line 1833 sub check_for_rcrs {
|
Line 2076 sub check_for_rcrs {
|
if (!$showreqcrs) { |
if (!$showreqcrs) { |
foreach my $type (@reqtypes) { |
foreach my $type (@reqtypes) { |
if ($env{'environment.reqcrsotherdom.'.$type} ne '') { |
if ($env{'environment.reqcrsotherdom.'.$type} ne '') { |
$showreqcrs = 1; |
my @domains = split(',',$env{'environment.reqcrsotherdom.'.$type}); |
last; |
foreach my $entry (@domains) { |
|
my ($extdom,$extopt) = split(':',$entry); |
|
if (&Apache::lonnet::will_trust('reqcrs',$env{'user.domain'},$extdom)) { |
|
$showreqcrs = 1; |
|
last; |
|
} |
|
} |
|
if ($showreqcrs) { |
|
last; |
|
} |
} |
} |
} |
} |
} |
} |
Line 2101 END
|
Line 2353 END
|
} |
} |
} |
} |
|
|
|
sub view_as_js { |
|
my ($url,$symb) = @_; |
|
my %lt = &Apache::lonlocal::texthash( |
|
ente => 'Enter a username or a student/employee ID', |
|
info => 'Information you entered does not match a valid course user', |
|
); |
|
&js_escape(\%lt); |
|
return <<"END"; |
|
|
|
function toggleViewAsUser(change) { |
|
if (document.getElementById('LC_selectuser')) { |
|
var seluserid = document.getElementById('LC_selectuser'); |
|
var currstyle = seluserid.style.display; |
|
if (change == 'off') { |
|
document.userview.elements['LC_viewas'].value = ''; |
|
document.userview.elements['vuname'].value = ''; |
|
document.userview.elements['vid'].value = ''; |
|
document.userview.submit(); |
|
return; |
|
} |
|
if ((document.getElementById('usexpand')) && (document.getElementById('uscollapse'))) { |
|
if (currstyle == 'inline') { |
|
seluserid.style.display = 'none'; |
|
document.getElementById('usexpand').innerHTML='► '; |
|
document.getElementById('uscollapse').innerHTML=''; |
|
} else { |
|
seluserid.style.display = 'inline'; |
|
document.getElementById('usexpand').innerHTML=''; |
|
document.getElementById('uscollapse').innerHTML='◄ '; |
|
toggleIdentifier(document.userview); |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
function validCourseUser(form,change) { |
|
var possuname = form.elements['vuname'].value; |
|
var possuid = form.elements['vid'].value; |
|
var possudom = form.elements['vudom'].value; |
|
if ((possuname == '') && (possuid == '')) { |
|
if (change == 'off') { |
|
form.elements['LC_viewas'].value = ''; |
|
form.submit(); |
|
} else { |
|
alert("$lt{'ente'}"); |
|
} |
|
return; |
|
} |
|
var http = new XMLHttpRequest(); |
|
var url = "/adm/courseuser"; |
|
var params = "uname="+possuname+"&uid="+possuid+"&udom="+possudom; |
|
http.open("POST", url, true); |
|
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
|
http.onreadystatechange = function() { |
|
if (http.readyState == 4 && http.status == 200) { |
|
var data = JSON.parse(http.responseText); |
|
if (Array.isArray(data.match)) { |
|
var len = data.match.length; |
|
if (len == 2) { |
|
if (data.match[0] != '' && data.match[1] != '') { |
|
form.elements['LC_viewas'].value = data.match[0]+':'+data.match[1]; |
|
form.submit(); |
|
} |
|
} else { |
|
alert("$lt{'info'}"); |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
http.send(params); |
|
return false; |
|
} |
|
|
|
function toggleIdentifier(form) { |
|
if ((document.getElementById('LC_vuname')) && (document.getElementById('LC_vid'))) { |
|
var radioelem = form.elements['vuidentifier']; |
|
if (radioelem.length > 0) { |
|
var i; |
|
for (i=0; i<radioelem.length; i++) { |
|
if (radioelem[i].checked == true) { |
|
if (radioelem[i].value == 'uname') { |
|
document.getElementById('LC_vuname').type = 'text'; |
|
document.getElementById('LC_vid').type = 'hidden'; |
|
document.getElementById('LC_vid').value = ''; |
|
} else { |
|
document.getElementById('LC_vuname').type = 'hidden'; |
|
document.getElementById('LC_vuname').value = ''; |
|
document.getElementById('LC_vid').type = 'text'; |
|
} |
|
break; |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
|
END |
|
} |
|
|
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 2138 sub utilityfunctions {
|
Line 2492 sub utilityfunctions {
|
|
|
my $esc_url=&escape($currenturl); |
my $esc_url=&escape($currenturl); |
my $esc_symb=&escape($currentsymb); |
my $esc_symb=&escape($currentsymb); |
|
my $newname = &mt('New Name'); |
|
|
my $countdown = &countdown_toggle_js(); |
my $countdown = &countdown_toggle_js(); |
|
|
my $ltitarget; |
my $viewuser; |
|
if (($env{'request.course.id'}) && |
|
($env{'request.symb'} ne '') && |
|
($env{'request.filename'}=~/$LONCAPA::assess_re/)) { |
|
my $canview; |
|
foreach my $priv ('msg','vgr') { |
|
$canview = &Apache::lonnet::allowed($priv,$env{'request.course.id'}); |
|
if (!$canview && $env{'request.course.sec'} ne '') { |
|
$canview = |
|
&Apache::lonnet::allowed($priv,"$env{'request.course.id'}/$env{'request.course.sec'}"); |
|
} |
|
last if ($canview); |
|
} |
|
if ($canview) { |
|
$viewuser = &view_as_js($esc_url,$esc_symb); |
|
} |
|
} |
|
|
|
my ($ltitarget,$deeplinktarget); |
if ($env{'request.lti.login'}) { |
if ($env{'request.lti.login'}) { |
$ltitarget = $env{'request.lti.target'}; |
$ltitarget = $env{'request.lti.target'}; |
} |
} |
|
if ($env{'request.deeplink.login'}) { |
|
$deeplinktarget = $env{'request.deeplink.target'}; |
|
} |
|
|
my $annotateurl = '/adm/annotation'; |
my $annotateurl = '/adm/annotation'; |
if ($httphost) { |
if ($httphost) { |
Line 2208 function gocstr(url,filename) {
|
Line 2584 function gocstr(url,filename) {
|
this.document.cstrdelete.submit(); |
this.document.cstrdelete.submit(); |
return; |
return; |
} |
} |
|
if ((url == '/adm/cfile?action=copy') || (url == '/adm/cfile?action=rename')) { |
|
this.document.cstrcopy.filename.value = filename; |
|
var oldname = filename.substring(filename.lastIndexOf("/") + 1); |
|
var newname=prompt('$newname',oldname); |
|
if (newname == "" || !newname || newname == oldname) { |
|
return; |
|
} |
|
if (url == '/adm/cfile?action=rename') { |
|
this.document.cstrcopy.action.value = 'rename'; |
|
} else { |
|
this.document.cstrcopy.action.value = 'copy'; |
|
} |
|
this.document.cstrcopy.newfilename.value = newname; |
|
this.document.cstrcopy.submit(); |
|
return; |
|
} |
if (url == '/adm/printout') { |
if (url == '/adm/printout') { |
this.document.cstrprint.postdata.value = filename |
this.document.cstrprint.postdata.value = filename |
this.document.cstrprint.curseed.value = 0; |
this.document.cstrprint.curseed.value = 0; |
Line 2247 function golist(url) {
|
Line 2639 function golist(url) {
|
currentSymb= null; |
currentSymb= null; |
var lcHostname = setLCHost(); |
var lcHostname = setLCHost(); |
var ltitarget = '$ltitarget'; |
var ltitarget = '$ltitarget'; |
if (ltitarget == 'iframe') { |
var deeplinktarget = '$deeplinktarget'; |
|
if ((ltitarget == 'iframe') || (deeplinktarget == '_self')) { |
document.location.href=lcHostname+url; |
document.location.href=lcHostname+url; |
} else { |
} else { |
top.location.href=lcHostname+url; |
top.location.href=lcHostname+url; |
Line 2337 function open_aboutLC() {
|
Line 2730 function open_aboutLC() {
|
|
|
$countdown |
$countdown |
|
|
|
$viewuser |
|
|
ENDUTILITY |
ENDUTILITY |
} |
} |
|
|
Line 2345 sub serverform {
|
Line 2740 sub serverform {
|
unless (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
unless (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
$target = ' target="_top"'; |
$target = ' target="_top"'; |
} |
} |
|
if (($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self')) { |
|
$target = ' target="_self"'; |
|
} |
return(<<ENDSERVERFORM); |
return(<<ENDSERVERFORM); |
<form name="server" action="/adm/logout" method="post"$target> |
<form name="server" action="/adm/logout" method="post"$target> |
<input type="hidden" name="postdata" value="none" /> |
<input type="hidden" name="postdata" value="none" /> |
Line 2356 ENDSERVERFORM
|
Line 2754 ENDSERVERFORM
|
} |
} |
|
|
sub constspaceform { |
sub constspaceform { |
|
my ($frameset) = @_; |
my ($target,$printtarget); |
my ($target,$printtarget); |
unless (($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) { |
if ($frameset) { |
$target = ' target="_top"'; |
$target = ' target="_parent"'; |
$printtarget = ' target="_parent"'; |
$printtarget = ' target="_parent"'; |
|
} else { |
|
unless ((($env{'request.lti.login'}) && ($env{'request.lti.target'} eq 'iframe')) || |
|
(($env{'request.deeplink.login'}) && ($env{'request.deeplink.target'} eq '_self'))) { |
|
$target = ' target="_top"'; |
|
$printtarget = ' target="_top"'; |
|
} |
} |
} |
return(<<ENDCONSTSPACEFORM); |
return(<<ENDCONSTSPACEFORM); |
<form name="constspace" action="/adm/logout" method="post"$target> |
<form name="constspace" action="/adm/logout" method="post"$target> |
Line 2374 sub constspaceform {
|
Line 2779 sub constspaceform {
|
<input type="hidden" name="curseed" value="" /> |
<input type="hidden" name="curseed" value="" /> |
<input type="hidden" name="problemtype" value="" /> |
<input type="hidden" name="problemtype" value="" /> |
</form> |
</form> |
|
<form name="cstrcopy" action="/adm/cfile" method="post"$target> |
|
<input type="hidden" name="action" value="copy" /> |
|
<input type="hidden" name="filename" value="" /> |
|
<input type="hidden" name="newfilename" value="" /> |
|
</form> |
|
|
ENDCONSTSPACEFORM |
ENDCONSTSPACEFORM |
} |
} |
Line 2389 sub hidden_button_check {
|
Line 2799 sub hidden_button_check {
|
} |
} |
|
|
sub roles_selector { |
sub roles_selector { |
my ($cdom,$cnum,$httphost,$ltitarget) = @_; |
my ($cdom,$cnum,$httphost,$target,$menucoll,$menuref) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
my $now = time; |
my $now = time; |
my (%courseroles,%seccount,%courseprivs,%roledesc); |
my (%courseroles,%seccount,%courseprivs,%roledesc); |
my $is_cc; |
my $is_cc; |
my ($js,$form,$switcher); |
my ($js,$form,$switcher,$has_opa_priv); |
my $ccrole; |
my $ccrole; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$ccrole = 'co'; |
$ccrole = 'co'; |
Line 2495 sub roles_selector {
|
Line 2905 sub roles_selector {
|
} |
} |
} |
} |
if ((keys(%seccount) > 1) || ($numdiffsec > 1)) { |
if ((keys(%seccount) > 1) || ($numdiffsec > 1)) { |
|
my $targetattr; |
|
if ($target ne '') { |
|
$targetattr = ' target="'.$target.'"'; |
|
} |
my @submenu; |
my @submenu; |
$js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs,\%roledesc,$privref); |
$js = &jump_to_role($cdom,$cnum,\%seccount,\%courseroles,\%courseprivs, |
|
\%roledesc,$privref,$menucoll,$menuref); |
$form = |
$form = |
'<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles">'."\n". |
'<form name="rolechooser" method="post" action="'.$httphost.'/adm/roles"'.$targetattr.'>'."\n". |
' <input type="hidden" name="destinationurl" value="'. |
' <input type="hidden" name="destinationurl" value="'. |
&HTML::Entities::encode($destinationurl).'" />'."\n". |
&HTML::Entities::encode($destinationurl).'" />'."\n". |
' <input type="hidden" name="gotorole" value="1" />'."\n". |
' <input type="hidden" name="gotorole" value="1" />'."\n". |
Line 2515 sub roles_selector {
|
Line 2930 sub roles_selector {
|
if ($env{'request.role'} =~ m{^\Q$role\E}) { |
if ($env{'request.role'} =~ m{^\Q$role\E}) { |
if ($seccount{$role} > 1) { |
if ($seccount{$role} > 1) { |
$include = 1; |
$include = 1; |
|
} else { |
|
if ($env{'user.priv.'.$env{'request.role'}."./$cdom/$cnum"} =~/opa\&([^\:]*)/) { |
|
$has_opa_priv = 1; |
|
} |
} |
} |
} else { |
} else { |
$include = 1; |
$include = 1; |
} |
} |
} |
} |
if ($include) { |
if ($include) { |
|
if ($env{"user.priv.$role./$cdom/$cnum./$cdom/$cnum"} =~/opa\&([^\:]*)/) { |
|
$has_opa_priv = 1; |
|
} |
push(@submenu,['javascript:adhocRole('."'$role'".')', |
push(@submenu,['javascript:adhocRole('."'$role'".')', |
&Apache::lonnet::plaintext($role,$crstype)]); |
&Apache::lonnet::plaintext($role,$crstype)]); |
} |
} |
Line 2545 sub roles_selector {
|
Line 2967 sub roles_selector {
|
} else { |
} else { |
$rolename = &Apache::lonnet::plaintext($role); |
$rolename = &Apache::lonnet::plaintext($role); |
} |
} |
|
if ($env{"user.priv.$role./$cdom/$cnum./$cdom/$cnum"} =~/opa\&([^\:]*)/) { |
|
$has_opa_priv = 1; |
|
} |
push(@submenu,['javascript:adhocRole('."'$role'".')', |
push(@submenu,['javascript:adhocRole('."'$role'".')', |
$rolename]); |
$rolename]); |
} |
} |
} |
} |
} |
} |
if (@submenu > 0) { |
if (@submenu > 0) { |
$switcher = &create_submenu('','',&mt('Switch role'),\@submenu,'','',$ltitarget); |
$switcher = &create_submenu('#',$target,&mt('Switch role'),\@submenu); |
} |
} |
} |
} |
return ($js,$form,$switcher); |
return ($js,$form,$switcher,$has_opa_priv); |
} |
} |
|
|
sub get_all_courseroles { |
sub get_all_courseroles { |
Line 2721 sub get_customadhoc_roles {
|
Line 3146 sub get_customadhoc_roles {
|
} |
} |
|
|
sub jump_to_role { |
sub jump_to_role { |
my ($cdom,$cnum,$seccount,$courseroles,$courseprivs,$roledesc,$privref) = @_; |
my ($cdom,$cnum,$seccount,$courseroles,$courseprivs,$roledesc,$privref, |
|
$menucoll,$menuref) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
this => 'This role has section(s) associated with it.', |
this => 'This role has section(s) associated with it.', |
ente => 'Enter a specific section.', |
ente => 'Enter a specific section.', |
Line 2732 sub jump_to_role {
|
Line 3158 sub jump_to_role {
|
role => 'The role you selected is not permitted to view the current page.', |
role => 'The role you selected is not permitted to view the current page.', |
swit => 'Switch role, but display Main Menu page instead?', |
swit => 'Switch role, but display Main Menu page instead?', |
); |
); |
|
&js_escape(\%lt); |
my $js; |
my $js; |
if (ref($courseroles) eq 'HASH') { |
if (ref($courseroles) eq 'HASH') { |
$js = ' var secpick = new Array("'.$lt{'ente'}.'","'.$lt{'orlb'}.'");'."\n". |
$js = ' var secpick = new Array("'.$lt{'ente'}.'","'.$lt{'orlb'}.'");'."\n". |
Line 2754 sub jump_to_role {
|
Line 3181 sub jump_to_role {
|
} |
} |
} |
} |
my $checkroles = 0; |
my $checkroles = 0; |
|
my $fallback = '/adm/menu'; |
|
my $displaymsg = $lt{'swit'}; |
if ((ref($privref) eq 'ARRAY') && (@{$privref} > 0) && (ref($courseprivs) eq 'HASH')) { |
if ((ref($privref) eq 'ARRAY') && (@{$privref} > 0) && (ref($courseprivs) eq 'HASH')) { |
my %disallowed; |
my %disallowed; |
foreach my $role (sort(keys(%{$courseprivs}))) { |
foreach my $role (sort(keys(%{$courseprivs}))) { |
Line 2775 sub jump_to_role {
|
Line 3204 sub jump_to_role {
|
$checkroles = 1; |
$checkroles = 1; |
$js .= " var disallow = new Array('".join("','",keys(%disallowed))."');\n". |
$js .= " var disallow = new Array('".join("','",keys(%disallowed))."');\n". |
" var rolecheck = 1;\n"; |
" var rolecheck = 1;\n"; |
|
if ($menucoll) { |
|
if (ref($menuref) eq 'HASH') { |
|
if ($menuref->{'main'} eq 'n') { |
|
$fallback = '/adm/navmaps'; |
|
if (&Apache::loncommon::course_type() eq 'Community') { |
|
$displaymsg = &mt('Switch role, but display Community Contents page instead?'); |
|
} else { |
|
$displaymsg = &mt('Switch role, but display Course Contents page instead?'); |
|
} |
|
&js_escape(\$displaymsg); |
|
} |
|
} |
|
} |
} |
} |
} |
} |
|
&js_escape(\$fallback); |
if (!$checkroles) { |
if (!$checkroles) { |
$js .= " var disallow = new Array();\n". |
$js .= " var disallow = new Array();\n". |
" rolecheck = 0;\n"; |
" rolecheck = 0;\n"; |
Line 2799 function adhocRole(newrole) {
|
Line 3242 function adhocRole(newrole) {
|
if (rolecheck > 0) { |
if (rolecheck > 0) { |
for (var i=0; i<disallow.length; i++) { |
for (var i=0; i<disallow.length; i++) { |
if (disallow[i] == newrole) { |
if (disallow[i] == newrole) { |
if (confirm("$lt{'role'}\\n$lt{'swit'}")) { |
if (confirm("$lt{'role'}\\n$displaymsg")) { |
document.rolechooser.destinationurl.value = '/adm/menu'; |
document.rolechooser.destinationurl.value = '$fallback'; |
} else { |
} else { |
return; |
return; |
} |
} |
Line 2986 sub placement_progress {
|
Line 3429 sub placement_progress {
|
&mt('Test is [_1]% complete',$complete).'</span>'; |
&mt('Test is [_1]% complete',$complete).'</span>'; |
} |
} |
|
|
|
sub linkprot_exit { |
|
if (($env{'request.course.id'}) && ($env{'request.deeplink.login'})) { |
|
my ($deeplink_symb,$deeplink); |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
if (($cnum ne '') && ($cdom ne '')) { |
|
$deeplink_symb = &Apache::loncommon::deeplink_login_symb($cnum,$cdom); |
|
if ($deeplink_symb) { |
|
if ($deeplink_symb =~ /\.(page|sequence)$/) { |
|
my $mapname = &Apache::lonnet::deversion((&Apache::lonnet::decode_symb($deeplink_symb))[2]); |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (ref($navmap)) { |
|
$deeplink = $navmap->get_mapparam(undef,$mapname,'0.deeplink'); |
|
} |
|
} else { |
|
$deeplink = &Apache::lonnet::EXT('resource.0.deeplink',$deeplink_symb); |
|
} |
|
if ($deeplink ne '') { |
|
my ($state,$others,$listed,$scope,$protect,$display,$target,$exit) = split(/,/,$deeplink); |
|
my %lt = &Apache::lonlocal::texthash( |
|
title => 'Exit Tool', |
|
okdone => 'Click "OK" to exit embedded tool', |
|
cancel => 'Click "Cancel" to continue working.', |
|
ok => 'OK', |
|
exit => 'Cancel', |
|
); |
|
if ($exit) { |
|
my ($show,$text) = split(/:/,$exit); |
|
unless ($show eq 'no') { |
|
my $height = 250; |
|
my $width = 300; |
|
my $exitbuttontext; |
|
if ($text eq '') { |
|
$exitbuttontext = &mt('Exit Tool'); |
|
} else { |
|
$exitbuttontext = $text; |
|
} |
|
return <<END; |
|
<form method="post" name="LCexitButton" action="/adm/linkexit"> |
|
<input type="hidden" name="LC_deeplink_exit" value="" /> |
|
<button id="LC_exit-confirm-opener" type="button">$exitbuttontext</button> |
|
</form> |
|
|
|
<div id="LC_exit-confirm" title="$lt{'title'}"> |
|
<p>$lt{'okdone'} $lt{'cancel'}</p> |
|
</div> |
|
|
|
<script type="text/javascript"> |
|
// <![CDATA[ |
|
\$( "#LC_exit-confirm" ).dialog({ autoOpen: false }); |
|
\$( "#LC_exit-confirm-opener" ).click(function() { |
|
\$( "#LC_exit-confirm" ).dialog( "open" ); |
|
\$( "#LC_exit-confirm" ).dialog({ |
|
resizable: false, |
|
height: $height, |
|
width: $width, |
|
modal: true, |
|
buttons: [ |
|
{ |
|
text: "$lt{'ok'}", |
|
click: function() { |
|
\$( this ).dialog( "close" ); |
|
\$( '[name="LC_deeplink_exit"]' )[0].value = 'true'; |
|
\$( '[name="LCexitButton"]' )[0].submit(); |
|
}, |
|
}, |
|
{ |
|
text: "$lt{'exit'}", |
|
click: function() { |
|
\$( this ).dialog( "close" ); |
|
}, |
|
}, |
|
], |
|
}); |
|
}); |
|
// ]]> |
|
</script> |
|
|
|
END |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return; |
|
} |
|
|
# ================================================================ Main Program |
# ================================================================ Main Program |
|
|
BEGIN { |
BEGIN { |
Line 3002 BEGIN {
|
Line 3533 BEGIN {
|
$category_positions{$entries[2]}=$entries[1]; |
$category_positions{$entries[2]}=$entries[1]; |
$category_names{$entries[2]}=$entries[3]; |
$category_names{$entries[2]}=$entries[3]; |
} elsif ($configline=~/^prim\:/) { |
} elsif ($configline=~/^prim\:/) { |
my @entries = (split(/\:/, $configline))[1..6]; |
my @entries = (split(/\:/, $configline))[1..7]; |
push(@primary_menu,\@entries); |
push(@primary_menu,\@entries); |
} elsif ($configline=~/^primsub\:/) { |
} elsif ($configline=~/^primsub\:/) { |
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
my ($parent,@entries) = (split(/\:/, $configline))[1..5]; |
push(@{$primary_submenu{$parent}},\@entries); |
push(@{$primary_submenu{$parent}},\@entries); |
} elsif ($configline=~/^scnd\:/) { |
} elsif ($configline=~/^scnd\:/) { |
my @entries = (split(/\:/, $configline))[1..5]; |
my @entries = (split(/\:/, $configline))[1..6]; |
push(@secondary_menu,\@entries); |
push(@secondary_menu,\@entries); |
} elsif ($configline=~/^scndsub\:/) { |
} elsif ($configline=~/^scndsub\:/) { |
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |
my ($parent,@entries) = (split(/\:/, $configline))[1..4]; |