version 1.369.2.69, 2017/01/30 19:06:46
|
version 1.369.2.78, 2019/08/17 12:58:00
|
Line 399 sub secondary_menu {
|
Line 399 sub secondary_menu {
|
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec); |
my $canmgr = &Apache::lonnet::allowed('mgr', $crs_sec); |
my $author = &getauthor(); |
my $author = &getauthor(); |
|
|
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv); |
my ($cdom,$cnum,$showsyllabus,$showfeeds,$showresv,$grouptools); |
|
$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'}; |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
Line 422 sub secondary_menu {
|
Line 423 sub secondary_menu {
|
$showresv = 1; |
$showresv = 1; |
} |
} |
} |
} |
|
if ($env{'request.course.groups'} ne '') { |
|
foreach my $group (split(/:/,$env{'request.course.groups'})) { |
|
next unless ($group =~ /^\w+$/); |
|
my @privs = split(/:/,$env{"user.priv.$env{'request.role'}./$cdom/$cnum/$group"}); |
|
shift(@privs); |
|
if (@privs) { |
|
$grouptools ++; |
|
} |
|
} |
|
} |
} |
} |
|
|
my ($canmodifycoauthor); |
my ($canmodifycoauthor); |
Line 433 sub secondary_menu {
|
Line 444 sub secondary_menu {
|
} |
} |
} |
} |
|
|
my %groups = &Apache::lonnet::get_active_groups( |
|
$env{'user.domain'}, $env{'user.name'}, |
|
$env{'course.' . $env{'request.course.id'} . '.domain'}, |
|
$env{'course.' . $env{'request.course.id'} . '.num'}); |
|
|
|
my ($roleswitcher_js,$roleswitcher_form); |
my ($roleswitcher_js,$roleswitcher_form); |
|
|
foreach my $menuitem (@secondary_menu) { |
foreach my $menuitem (@secondary_menu) { |
Line 469 sub secondary_menu {
|
Line 475 sub secondary_menu {
|
next if $$menuitem[4] eq 'params' |
next if $$menuitem[4] eq 'params' |
&& (!$canmodpara && !$canviewpara); |
&& (!$canmodpara && !$canviewpara); |
next if $$menuitem[4] eq 'nvcg' |
next if $$menuitem[4] eq 'nvcg' |
&& ($canviewgrps || !%groups); |
&& ($canviewgrps || !$grouptools); |
next if $$menuitem[4] eq 'showsyllabus' |
next if $$menuitem[4] eq 'showsyllabus' |
&& !$showsyllabus; |
&& !$showsyllabus; |
next if $$menuitem[4] eq 'showfeeds' |
next if $$menuitem[4] eq 'showfeeds' |
Line 499 sub secondary_menu {
|
Line 505 sub secondary_menu {
|
next if ($item->[2] eq 'mgr' && !$canmgr); |
next if ($item->[2] eq 'mgr' && !$canmgr); |
next if ($item->[2] eq 'vcg' && !$canviewgrps); |
next if ($item->[2] eq 'vcg' && !$canviewgrps); |
next if ($item->[2] eq 'crsedit' && !$canedit && !$canvieweditor); |
next if ($item->[2] eq 'crsedit' && !$canedit && !$canvieweditor); |
|
next if ($item->[2] eq 'params' && !$canmodpara && !$canviewpara); |
|
next if ($item->[2] eq 'author' && !$author); |
|
next if ($item->[2] eq 'cca' && !$canmodifycoauthor); |
push(@scndsub,$item); |
push(@scndsub,$item); |
} |
} |
} |
} |
Line 522 sub secondary_menu {
|
Line 531 sub secondary_menu {
|
my $url = $$menuitem[0]; |
my $url = $$menuitem[0]; |
$url =~ s{\[cdom\]/\[cnum\]}{$cdom/$cnum}; |
$url =~ s{\[cdom\]/\[cnum\]}{$cdom/$cnum}; |
if (&Apache::lonnet::is_on_map($url)) { |
if (&Apache::lonnet::is_on_map($url)) { |
unless ($$menuitem[0] =~ /\?register=1/) { |
unless ($$menuitem[0] =~ /(\?|\&)register=1/) { |
$$menuitem[0] .= '?register=1'; |
$$menuitem[0] .= (($$menuitem[0]=~/\?/)? '&' : '?').'register=1'; |
} |
} |
} else { |
} else { |
$$menuitem[0] =~ s{\?register=1}{}; |
$$menuitem[0] =~ s{\&?register=1}{}; |
} |
} |
|
if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { |
|
if (($ENV{'SERVER_PORT'} == 443) || ($env{'request.use_absolute'} =~ m{^https://})) { |
|
unless (&Apache::lonnet::uses_sts()) { |
|
unless ($$menuitem[0] =~ m{^https?://}) { |
|
$$menuitem[0] = 'http://'.$ENV{'SERVER_NAME'}.$$menuitem[0]; |
|
} |
|
unless ($$menuitem[0] =~ /(\&|\?)usehttp=1/) { |
|
$$menuitem[0] .= (($$menuitem[0]=~/\?/) ? '&' : '?').'usehttp=1'; |
|
} |
|
} |
|
} |
|
} |
|
$$menuitem[0] = &HTML::Entities::encode($$menuitem[0],'&<>"'); |
} |
} |
$menu .= &prep_menuitem(\@$menuitem); |
$menu .= &prep_menuitem(\@$menuitem); |
} |
} |
Line 546 sub secondary_menu {
|
Line 568 sub secondary_menu {
|
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
($escurl = $env{'request.filename'}) =~ s{^\Q$londocroot\E}{}; |
($escurl = $env{'request.filename'}) =~ s{^\Q$londocroot\E}{}; |
$escurl = &escape($escurl); |
$escurl = &escape($escurl); |
} |
} |
$menu =~ s/\[url\]/$escurl/g; |
$menu =~ s/\[url\]/$escurl/g; |
$menu =~ s/\[symb\]/$escsymb/g; |
$menu =~ s/\[symb\]/$escsymb/g; |
} |
} |
Line 635 sub build_submenu {
|
Line 657 sub build_submenu {
|
next unless (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')); |
next unless (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')); |
$href =~ s/\[domain\]/$env{'user.domain'}/g; |
$href =~ s/\[domain\]/$env{'user.domain'}/g; |
$href =~ s/\[user\]/$env{'user.name'}/g; |
$href =~ s/\[user\]/$env{'user.name'}/g; |
|
} elsif (($href =~ m{^/adm/preferences\?}) && ($href =~ /\[returnurl\]/)) { |
|
my $returnurl = $ENV{'REQUEST_URI'}; |
|
if ($ENV{'REQUEST_URI'} =~ m{/adm/preferences\?action=(?:changedomcoord|authorsettings)\&returnurl=([^\&]+)$}) { |
|
$returnurl = $1; |
|
} |
|
if (($returnurl =~ m{^/adm/createuser($|\?action=)}) || |
|
($returnurl =~ m{^/priv/$match_domain/$match_username}) || |
|
($returnurl =~ m{^/res(/?$|/$match_domain/$match_username)})) { |
|
$returnurl =~ s{\?.*$}{}; |
|
$returnurl = '&returnurl='.&HTML::Entities::encode($returnurl,'"<>&\''); |
|
} else { |
|
undef($returnurl); |
|
} |
|
$href =~ s/\[returnurl\]/$returnurl/; |
} |
} |
unless (($href eq '') || ($href =~ /^\#/)) { |
unless (($href eq '') || ($href =~ /^\#/)) { |
$target = ' target="_top"'; |
$target = ' target="_top"'; |
Line 678 sub registerurl {
|
Line 714 sub registerurl {
|
} |
} |
|
|
sub innerregister { |
sub innerregister { |
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide) = @_; |
my ($forcereg,$bread_crumbs,$group,$pagebuttonshide,$hostname) = @_; |
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 699 sub innerregister {
|
Line 735 sub innerregister {
|
$newmail= 'swmenu.setstatus("you have","messages");'; |
$newmail= 'swmenu.setstatus("you have","messages");'; |
} |
} |
|
|
my ($mapurl,$resurl); |
my ($mapurl,$resurl,$crstype,$navmap); |
|
|
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
|
# |
|
#course_type: Course or Community |
|
# |
|
$crstype = &Apache::loncommon::course_type(); |
if ($env{'request.symb'}) { |
if ($env{'request.symb'}) { |
($mapurl, my $rid, $resurl) = &Apache::lonnet::decode_symb(&Apache::lonnet::symbread()); |
my $ignorenull; |
|
unless ($env{'request.noversionuri'} eq '/adm/navmaps') { |
|
$ignorenull = 1; |
|
} |
|
my $symb = &Apache::lonnet::symbread('','',$ignorenull); |
|
($mapurl, my $rid, $resurl) = &Apache::lonnet::decode_symb($symb); |
my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'}; |
my $coursetitle = $env{'course.'.$env{'request.course.id'}.'.description'}; |
|
|
my $maptitle = &Apache::lonnet::gettitle($mapurl); |
my $maptitle = &Apache::lonnet::gettitle($mapurl); |
my $restitle = &Apache::lonnet::gettitle(&Apache::lonnet::symbread()); |
my $restitle = &Apache::lonnet::gettitle($symb); |
|
|
|
my (@crumbs,@mapcrumbs); |
#SD |
if (($env{'request.noversionuri'} ne '/adm/navmaps') && ($mapurl ne '') && |
#course_type only Course and Community? |
($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'})) { |
# |
$navmap = Apache::lonnavmaps::navmap->new(); |
my @crumbs; |
if (ref($navmap)) { |
|
@mapcrumbs = $navmap->recursed_crumbs($mapurl,$restitle); |
|
} |
|
} |
unless (($forcereg) && |
unless (($forcereg) && |
($env{'request.noversionuri'} eq '/adm/navmaps') && |
($env{'request.noversionuri'} eq '/adm/navmaps') && |
($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { |
($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { |
@crumbs = ({text => Apache::loncommon::course_type() |
@crumbs = ({text => $crstype.' Contents', |
. ' Contents', |
|
href => "Javascript:gopost('/adm/navmaps','')"}); |
href => "Javascript:gopost('/adm/navmaps','')"}); |
} |
} |
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { |
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { |
push(@crumbs, {text => '...', |
if (@mapcrumbs) { |
no_mt => 1}); |
push(@crumbs,@mapcrumbs); |
|
} else { |
|
push(@crumbs, {text => '...', |
|
no_mt => 1}); |
|
} |
} |
} |
|
|
push @crumbs, {text => $maptitle, no_mt => 1} if ($maptitle |
unless ((@mapcrumbs) || (!$maptitle) || ($maptitle eq 'default.sequence') || |
&& $maptitle ne 'default.sequence' |
($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { |
&& $maptitle ne $coursetitle); |
push @crumbs, {text => $maptitle, no_mt => 1, |
|
href => &Apache::lonnet::clutter($mapurl).'?navmap=1'}; |
push @crumbs, {text => $restitle, no_mt => 1} if $restitle; |
} |
|
if ($restitle && !@mapcrumbs) { |
|
push(@crumbs,{text => $restitle, no_mt => 1}); |
|
} |
my @tools; |
my @tools; |
if ($env{'request.filename'} =~ /\.page$/) { |
if ($env{'request.filename'} =~ /\.page$/) { |
my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools(); |
my %breadcrumb_tools = &Apache::lonhtmlcommon::current_breadcrumb_tools(); |
Line 746 sub innerregister {
|
Line 800 sub innerregister {
|
} else { |
} else { |
$resurl = $env{'request.noversionuri'}; |
$resurl = $env{'request.noversionuri'}; |
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'}); |
my $courseurl = &Apache::lonnet::courseid_to_courseurl($env{'request.course.id'}); |
my $crstype = &Apache::loncommon::course_type(); |
|
my $title = &mt('View Resource'); |
my $title = &mt('View Resource'); |
if ($resurl =~ m{^\Q/uploaded$courseurl/supplemental/\E(default|\d+)/}) { |
if ($resurl =~ m{^\Q/uploaded$courseurl/supplemental/\E(default|\d+)/}) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folderpath','title']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['folderpath','title']); |
Line 756 sub innerregister {
|
Line 809 sub innerregister {
|
} |
} |
my $trail; |
my $trail; |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1); |
&prepare_functions($resurl,$forcereg,$group,undef,undef,1,$hostname); |
($trail) = |
($trail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
} else { |
} else { |
Line 771 sub innerregister {
|
Line 824 sub innerregister {
|
} 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); |
$forcereg,$group,undef,undef,1,$hostname); |
$title = &mt('Syllabus File'); |
$title = &mt('Syllabus File'); |
my ($trail) = |
my ($trail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs(undef,$crstype,undef,$title,1,$hostname); |
return $trail; |
return $trail; |
} |
} |
unless ($env{'request.state'} eq 'construct') { |
unless ($env{'request.state'} eq 'construct') { |
Line 811 sub innerregister {
|
Line 864 sub innerregister {
|
if (($env{'environment.remote'} eq 'on') && ($env{'request.symb'})) { |
if (($env{'environment.remote'} eq 'on') && ($env{'request.symb'})) { |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
} |
} |
$editbutton = &prepare_functions($resurl,$forcereg,$group); |
$editbutton = &prepare_functions($resurl,$forcereg,$group,'','','',$hostname); |
} |
} |
if ($editbutton eq '') { |
if ($editbutton eq '') { |
$editbutton = &clear(6,1); |
$editbutton = &clear(6,1); |
Line 1400 ENDOPEN
|
Line 1453 ENDOPEN
|
} |
} |
|
|
sub get_editbutton { |
sub get_editbutton { |
my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg) = @_; |
my ($cfile,$home,$switchserver,$forceedit,$forceview,$forcereg,$hostname) = @_; |
my $jscall; |
my $jscall; |
if (($forceview) && ($env{'form.todocs'})) { |
if (($forceview) && ($env{'form.todocs'})) { |
my ($folderpath,$command,$navmap); |
my ($folderpath,$command,$navmap); |
Line 1420 sub get_editbutton {
|
Line 1473 sub get_editbutton {
|
$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'}, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
&escape($env{'form.title'}),$env{'form.idx'}, |
&escape($env{'form.title'}),$hostname, |
&escape($env{'form.suppurl'}),$env{'form.todocs'}, |
$env{'form.idx'},&escape($env{'form.suppurl'}), |
$suppanchor); |
$env{'form.todocs'},$suppanchor); |
} |
} |
if ($jscall) { |
if ($jscall) { |
my $icon = 'pcstr.png'; |
my $icon = 'pcstr.png'; |
Line 1455 sub get_editbutton {
|
Line 1508 sub get_editbutton {
|
} |
} |
|
|
sub prepare_functions { |
sub prepare_functions { |
my ($resurl,$forcereg,$group,$bread_crumbs,$advtools,$docscrumbs,$forbodytag) = @_; |
my ($resurl,$forcereg,$group,$bread_crumbs,$advtools,$docscrumbs,$hostname,$forbodytag) = @_; |
unless ($env{'request.registered'}) { |
unless ($env{'request.registered'}) { |
undef(@inlineremote); |
undef(@inlineremote); |
} |
} |
Line 1469 sub prepare_functions {
|
Line 1522 sub prepare_functions {
|
} |
} |
|
|
my $editbutton = ''; |
my $editbutton = ''; |
|
my $viewsrcbutton = ''; |
# |
# |
# Determine whether or not to display 'Edit' 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 $file=&Apache::lonnet::declutter($env{'request.filename'}); |
my $file=&Apache::lonnet::declutter($env{'request.filename'}); |
Line 1501 sub prepare_functions {
|
Line 1555 sub prepare_functions {
|
# This applies in course context |
# This applies in course context |
# |
# |
if (($perms{'mdc'}) && |
if (($perms{'mdc'}) && |
(($resurl eq "/public/$cdom/$cnum/syllabus") || |
(($resurl =~ m{^/?public/$cdom/$cnum/syllabus}) || |
($resurl =~ m{^/uploaded/$cdom/$cnum/portfolio/syllabus/}))) { |
($resurl =~ m{^/?uploaded/$cdom/$cnum/portfolio/syllabus/}) || |
$cfile = $resurl; |
(($resurl =~ m{^/?uploaded/$cdom/$cnum/default_\d+\.sequence$}) && ($env{'form.navmap'})))) { |
|
if ($resurl =~ m{^/}) { |
|
$cfile = $resurl; |
|
} else { |
|
$cfile = "/$resurl"; |
|
} |
$home = &Apache::lonnet::homeserver($cnum,$cdom); |
$home = &Apache::lonnet::homeserver($cnum,$cdom); |
if ($env{'form.forceedit'}) { |
if ($env{'form.forceedit'}) { |
$forceview = 1; |
$forceview = 1; |
} else { |
} else { |
$forceedit = 1; |
$forceedit = 1; |
} |
} |
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
if ($cfile =~ m{^/uploaded/$cdom/$cnum/default_\d+\.sequence$}) { |
$forceedit,$forceview,$forcereg); |
my $text = 'Edit Folder'; |
|
&switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]', |
|
"gocmd('/adm/coursedocs','direct')", |
|
'Folder/Page Content'); |
|
$editbutton = 1; |
|
} else { |
|
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
|
$forceedit,$forceview,$forcereg, |
|
$hostname); |
|
} |
} elsif (($resurl eq '/adm/extresedit') && |
} elsif (($resurl eq '/adm/extresedit') && |
(($env{'form.symb'}) || ($env{'form.folderpath'}))) { |
(($env{'form.symb'}) || ($env{'form.folderpath'}))) { |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
($cfile,$home,$switchserver,$forceedit,$forceview) = |
Line 1540 sub prepare_functions {
|
Line 1608 sub prepare_functions {
|
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$editbutton = &get_editbutton($cfile,$home,$switchserver, |
$forceedit,$forceview,$forcereg); |
$forceedit,$forceview,$forcereg); |
} |
} |
|
if ((($cfile eq '') || (!$editbutton)) && |
|
($resurl =~ /$LONCAPA::assess_re/)) { |
|
my $showurl = &Apache::lonnet::clutter($resurl); |
|
if ((&Apache::lonnet::allowed('cre','/')) && |
|
(&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open')) { |
|
$viewsrcbutton = 1; |
|
} elsif (&Apache::lonnet::allowed('vxc',$env{'request.course.id'})) { |
|
if ($showurl =~ m{^\Q/res/$cdom/\E($match_username)/}) { |
|
my $auname = $1; |
|
if (($env{'request.course.adhocsrcaccess'} ne '') && |
|
(grep(/^\Q$auname\E$/,split(/,/,$env{'request.course.adhocsrcaccess'})))) { |
|
$viewsrcbutton = 1; |
|
} elsif ((&Apache::lonnet::metadata($resurl,'sourceavail') eq 'open') && |
|
(&Apache::lonnet::allowed('bre','/'))) { |
|
$viewsrcbutton = 1; |
|
} |
|
} |
|
} |
|
if ($viewsrcbutton) { |
|
&switch('','',6,1,'pcstr.png','View Source','resource[_2]','open_source()', |
|
'View source code'); |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 1599 sub prepare_functions {
|
Line 1690 sub prepare_functions {
|
$suppanchor = $env{'form.anchor'}; |
$suppanchor = $env{'form.anchor'}; |
} |
} |
my $esc_path=&escape(&HTML::Entities::encode(&escape($env{'form.folderpath'}),'<>&"')); |
my $esc_path=&escape(&HTML::Entities::encode(&escape($env{'form.folderpath'}),'<>&"')); |
|
my $link = '/adm/coursedocs?command=direct&forcesupplement=1&supppath='. |
|
"$esc_path&anchor=$suppanchor"; |
|
if ($env{'request.use_absolute'} ne '') { |
|
$link = $env{'request.use_absolute'}.$link; |
|
} |
&switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]', |
&switch('','',7,4,'docs-22x22.png','Edit Folder','parms[_2]', |
"location.href='/adm/coursedocs?command=direct&forcesupplement=1&supppath=$esc_path&anchor=$suppanchor'", |
"location.href='$link'",'Folder/Page Content'); |
'Folder/Page Content','','',1); |
|
} |
} |
} |
} |
} |
} |
Line 2097 END
|
Line 2192 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])); |
if ($currenturl =~ m{^/adm/wrapper/ext/} |
my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'}); |
&& $env{'request.external.querystring'} ) { |
if ($currenturl =~ m{^/adm/wrapper/ext/}) { |
|
if ($env{'request.external.querystring'}) { |
$currenturl .= ($currenturl=~/\?/)?'&':'?'.$env{'request.external.querystring'}; |
$currenturl .= ($currenturl=~/\?/)?'&':'?'.$env{'request.external.querystring'}; |
|
} |
|
my ($anchor) = ($env{'request.symb'} =~ /(\#[^\#]+)$/); |
|
if (($anchor) && ($currenturl !~ /\Q$anchor\E$/)) { |
|
$currenturl .= $1; |
|
} |
} |
} |
$currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl)); |
$currenturl=&Apache::lonenc::check_encrypt(&unescape($currenturl)); |
|
|
my $currentsymb=&Apache::lonenc::check_encrypt($env{'request.symb'}); |
|
|
|
my $dc_popup_cid; |
my $dc_popup_cid; |
if ($env{'user.adv'} && exists($env{'user.role.dc./'. |
if ($env{'user.adv'} && exists($env{'user.role.dc./'. |
$env{'course.'.$env{'request.course.id'}. |
$env{'course.'.$env{'request.course.id'}. |
Line 2130 sub utilityfunctions {
|
Line 2229 sub utilityfunctions {
|
|
|
my $countdown = &countdown_toggle_js(); |
my $countdown = &countdown_toggle_js(); |
|
|
|
my $annotateurl = '/adm/annotation'; |
|
if ($httphost) { |
|
$annotateurl = '/adm/annotations'; |
|
} |
my $hostvar = ' |
my $hostvar = ' |
function setLCHost() { |
function setLCHost() { |
var lcHostname=""; |
var lcHostname=""; |
Line 2156 return (<<ENDUTILITY)
|
Line 2259 return (<<ENDUTILITY)
|
|
|
$dc_popup_cid |
$dc_popup_cid |
|
|
function go(url) { |
|
if (url!='' && url!= null) { |
|
currentURL = null; |
|
currentSymb= null; |
|
var lcHostname = setLCHost(); |
|
window.location.href=lcHostname+url; |
|
} |
|
} |
|
|
|
$jumptores |
$jumptores |
|
|
function gopost(url,postdata) { |
function gopost(url,postdata) { |
Line 2267 function annotate() {
|
Line 2361 function annotate() {
|
annotator.document.write( |
annotator.document.write( |
'$start_page_annotate' |
'$start_page_annotate' |
+"<form name='goannotate' target='Annotator' method='post' " |
+"<form name='goannotate' target='Annotator' method='post' " |
+"action='/adm/annotations'>" |
+"action='$annotateurl'>" |
+"<input type='hidden' name='symbnew' value='"+currentSymb+"' />" |
+"<input type='hidden' name='symbnew' value='"+currentSymb+"' />" |
+"<\\/form>" |
+"<\\/form>" |
+'$end_page_annotate'); |
+'$end_page_annotate'); |
Line 2371 sub roles_selector {
|
Line 2465 sub roles_selector {
|
} |
} |
my ($privref,$gotsymb,$destsymb); |
my ($privref,$gotsymb,$destsymb); |
my $destinationurl = $ENV{'REQUEST_URI'}; |
my $destinationurl = $ENV{'REQUEST_URI'}; |
if ($destinationurl =~ /\?symb=/) { |
if ($destinationurl =~ /(\?|\&)symb=/) { |
$gotsymb = 1; |
$gotsymb = 1; |
} elsif ($destinationurl =~ m{^/enc/}) { |
} elsif ($destinationurl =~ m{^/enc/}) { |
my $plainurl = &Apache::lonenc::unencrypted($destinationurl); |
my $plainurl = &Apache::lonenc::unencrypted($destinationurl); |
if ($plainurl =~ /\?symb=/) { |
if ($plainurl =~ /(\?|\&)symb=/) { |
$gotsymb = 1; |
$gotsymb = 1; |
} |
} |
} |
} |