version 1.603, 2016/05/09 02:25:33
|
version 1.604, 2016/06/06 17:40:48
|
Line 619 sub group_import {
|
Line 619 sub group_import {
|
$url = $1; |
$url = $1; |
my $marker = $2; |
my $marker = $2; |
my $info = $3; |
my $info = $3; |
my ($toolid,%toolhash); |
my ($toolid,%toolhash,%toolsettings); |
my @toolinfo = split(/:/,$info); |
my @toolinfo = split(/:/,$info); |
if ($residx) { |
if ($residx) { |
my %toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); |
%toolsettings=&Apache::lonnet::dump('exttool_'.$marker,$coursedom,$coursenum); |
$toolid = $toolsettings{'id'}; |
$toolid = $toolsettings{'id'}; |
} else { |
} else { |
$toolid = shift(@toolinfo); |
$toolid = shift(@toolinfo); |
} |
} |
$toolid =~ s/\D//g; |
$toolid =~ s/\D//g; |
($toolhash{'target'},$toolhash{'width'},$toolhash{'height'}) = @toolinfo; |
($toolhash{'target'},$toolhash{'width'},$toolhash{'height'}, |
|
$toolhash{'crslabel'},$toolhash{'crstitle'}) = @toolinfo; |
|
$toolhash{'crslabel'} = &unescape($toolhash{'crslabel'}); |
|
$toolhash{'crstitle'} = &unescape($toolhash{'crstitle'}); |
if (ref($ltitoolsref) eq 'HASH') { |
if (ref($ltitoolsref) eq 'HASH') { |
|
my @deleted; |
if (ref($ltitoolsref->{$toolid}) eq 'HASH') { |
if (ref($ltitoolsref->{$toolid}) eq 'HASH') { |
if ($ltitoolsref->{$toolid}->{'url'} =~ m{^https://}) { |
if ($ltitoolsref->{$toolid}->{'url'} =~ m{^https://}) { |
$url =~ s/exttool$/exttools/; |
$url =~ s/exttool$/exttools/; |
} |
} |
$toolhash{'id'} = $toolid; |
$toolhash{'id'} = $toolid; |
|
if (($toolhash{'target'} eq 'iframe') || ($toolhash{'target'} eq 'window')) { |
|
if ($toolhash{'target'} eq 'window') { |
|
foreach my $item ('width','height') { |
|
$toolhash{$item} =~ s/^\s+//; |
|
$toolhash{$item} =~ s/\s+$//; |
|
} |
|
} |
|
} elsif ($residx) { |
|
$toolhash{'target'} = $toolsettings{'target'}; |
|
if ($toolhash{'target'} eq 'window') { |
|
$toolhash{'width'} = $toolsettings{'width'}; |
|
$toolhash{'height'} = $toolsettings{'height'}; |
|
} |
|
} elsif (ref($ltitoolsref->{$toolid}->{'display'}) eq 'HASH') { |
|
$toolhash{'target'} = $ltitoolsref->{$toolid}->{'display'}->{'target'}; |
|
if ($toolhash{'target'} eq 'window') { |
|
$toolhash{'width'} = $ltitoolsref->{$toolid}->{'display'}->{'width'}; |
|
$toolhash{'height'} = $ltitoolsref->{$toolid}->{'display'}->{'height'}; |
|
} |
|
} |
if ($toolhash{'target'} eq 'iframe') { |
if ($toolhash{'target'} eq 'iframe') { |
delete($toolhash{'width'}); |
delete($toolhash{'width'}); |
delete($toolhash{'height'}); |
delete($toolhash{'height'}); |
} elsif ($toolhash{'target'} eq 'window') { |
if ($residx) { |
foreach my $item ('width','height') { |
if ($toolsettings{'width'}) { |
$toolhash{$item} =~ s/^\s+//; |
push(@deleted,'width'); |
$toolhash{$item} =~ s/\s+$//; |
} |
|
if ($toolsettings{'height'}) { |
|
push(@deleted,'height'); |
|
} |
|
} |
|
} |
|
if (ref($ltitoolsref->{$toolid}->{'crsconf'}) eq 'HASH') { |
|
foreach my $item ('label','title') { |
|
if ($ltitoolsref->{$toolid}->{'crsconf'}->{$item}) { |
|
$toolhash{'crs'.$item} =~ s/^\s+//; |
|
$toolhash{'crs'.$item} =~ s/\s+$//; |
|
if ($toolhash{'crs'.$item} eq '') { |
|
delete($toolhash{'crs'.$item}); |
|
} |
|
} else { |
|
delete($toolhash{'crs'.$item}); |
|
} |
|
if (($residx) && (exists($toolsettings{'crs'.$item}))) { |
|
unless (exists($toolhash{'crs'.$item})) { |
|
push(@deleted,'crs'.$item); |
|
} |
|
} |
} |
} |
} |
} |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); |
my $putres = &Apache::lonnet::put('exttool_'.$marker,\%toolhash,$coursedom,$coursenum); |
|
if ($putres eq 'ok') { |
|
if (@deleted) { |
|
&Apache::lonnet::del('exttool_'.$marker,\@deleted,$coursedom,$coursenum); |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
Line 4999 sub handler {
|
Line 5049 sub handler {
|
my $tabidstr = join("','",@tabids); |
my $tabidstr = join("','",@tabids); |
%ltitools = &Apache::lonnet::get_domain_ltitools($coursedom); |
%ltitools = &Apache::lonnet::get_domain_ltitools($coursedom); |
my $posslti = keys(%ltitools); |
my $posslti = keys(%ltitools); |
my $exttoolurl = "/adm/$coursedom/$coursenum/new/exttool"; |
|
$script .= &editing_js($udom,$uname,$supplementalflag,$posslti). |
$script .= &editing_js($udom,$uname,$supplementalflag,$posslti). |
&history_tab_js(). |
&history_tab_js(). |
&inject_data_js(). |
&inject_data_js(). |
Line 5451 NROSTFORM
|
Line 5500 NROSTFORM
|
$help{'Web_Page'} |
$help{'Web_Page'} |
</form> |
</form> |
NWEBFORM |
NWEBFORM |
|
|
|
|
my $specialdocumentsform; |
my $specialdocumentsform; |
my @specialdocumentsforma; |
my @specialdocumentsforma; |
Line 6109 sub editing_js {
|
Line 6158 sub editing_js {
|
p_msb => 'Title for the Problem', |
p_msb => 'Title for the Problem', |
p_mdb => 'Title for the Drop Box', |
p_mdb => 'Title for the Drop Box', |
p_mbb => 'Title for the Discussion Board', |
p_mbb => 'Title for the Discussion Board', |
p_mwp => 'Title for Web Page', |
p_mwp => 'Title for Web Page', |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab => "Enter user:domain for User's Personal Information Page", |
p_mab2 => 'Personal Information Page of ', |
p_mab2 => 'Personal Information Page of ', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt1 => 'Not a valid user:domain', |