version 1.8.2.4.4.1, 2023/07/05 18:10:06
|
version 1.10, 2016/06/06 17:40:48
|
Line 60 sub handler {
|
Line 60 sub handler {
|
$symb,$type); |
$symb,$type); |
if (($env{'form.folderpath'} =~ /^supplemental/) && ($env{'form.suppurl'})) { |
if (($env{'form.folderpath'} =~ /^supplemental/) && ($env{'form.suppurl'})) { |
$supplementalflag = 1; |
$supplementalflag = 1; |
if (&unescape($env{'form.suppurl'}) =~ m{^/adm/$cdom/$cnum/\d+/ext\.tool$}) { |
if (&unescape($env{'form.suppurl'}) =~ m{^/adm/$cdom/$cnum/\d+/exttools?$}) { |
$type = 'tool'; |
$type = 'tool'; |
} |
} |
} |
} |
Line 79 sub handler {
|
Line 79 sub handler {
|
if ($symb ne $env{'form.symb'}) { |
if ($symb ne $env{'form.symb'}) { |
$env{'form.symb'} = $symb; |
$env{'form.symb'} = $symb; |
} |
} |
if ($url =~ m{/adm/$cdom/$cnum/\d+/ext\.tool$}) { |
if ($url =~ m{/adm/$cdom/$cnum/\d+/exttools?$}) { |
$type = 'tool'; |
$type = 'tool'; |
} |
} |
} |
} |
Line 98 sub handler {
|
Line 98 sub handler {
|
} |
} |
my %ltitools; |
my %ltitools; |
if ($type eq 'tool') { |
if ($type eq 'tool') { |
%ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer'); |
%ltitools = &Apache::lonnet::get_domain_ltitools($cdom); |
} |
} |
my $js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript()); |
my $js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript()); |
my $pathitem = '<input type="hidden" name="folderpath" value="'. |
my $pathitem = '<input type="hidden" name="folderpath" value="'. |
Line 146 sub process_changes {
|
Line 146 sub process_changes {
|
$oldtitle = &unescape($env{'form.title'}); |
$oldtitle = &unescape($env{'form.title'}); |
$container = 'sequence'; |
$container = 'sequence'; |
$supplementalflag = 1; |
$supplementalflag = 1; |
if ($oldurl =~ m{^/adm/$cdom/$cnum/\d+/ext\.tool$}) { |
if ($oldurl =~ m{^/adm/$cdom/$cnum/\d+/exttools?$}) { |
$type = 'tool'; |
$type = 'tool'; |
} else { |
} else { |
$type = 'ext'; |
$type = 'ext'; |
Line 157 sub process_changes {
|
Line 157 sub process_changes {
|
if ($env{'form.importdetail'}) { |
if ($env{'form.importdetail'}) { |
($newtitle,$newurl,$newidx) = |
($newtitle,$newurl,$newidx) = |
map {&unescape($_)} split(/\=/,$env{'form.importdetail'}); |
map {&unescape($_)} split(/\=/,$env{'form.importdetail'}); |
if ($newurl =~ m{^(/adm/$cdom/$cnum/(\d+)/ext\.tool)\:?(.*)$}) { |
if ($newurl =~ m{^(/adm/$cdom/$cnum/(\d+)/exttools?)\:?(.*)$}) { |
$newurl = $1; |
$newurl = $1; |
$marker = $2; |
$marker = $2; |
$args = $3; |
$args = $3; |
Line 258 sub process_changes {
|
Line 258 sub process_changes {
|
|
|
sub update_exttool { |
sub update_exttool { |
my ($marker,$cdom,$cnum,$args) = @_; |
my ($marker,$cdom,$cnum,$args) = @_; |
|
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my (%newhash,$changed,@deleted,$errormsg); |
my (%newhash,$changed,@deleted,$errormsg); |
($newhash{'target'},$newhash{'width'},$newhash{'height'},$newhash{'linktext'},$newhash{'explanation'}, |
($newhash{'target'},$newhash{'width'},$newhash{'height'},$newhash{'crslabel'},$newhash{'crstitle'}) = split(/:/,$args); |
$newhash{'crslabel'},$newhash{'crstitle'},$newhash{'crsappend'}) = split(/:/,$args); |
$newhash{'crslabel'} = &unescape($newhash{'crslabel'}); |
foreach my $item ('linktext','explanation','crslabel','crstitle','crsappend') { |
$newhash{'crstitle'} = &unescape($newhash{'crstitle'}); |
$newhash{$item} = &unescape($newhash{$item}); |
|
} |
|
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
foreach my $item ('target','width','height','linktext','explanation','crslabel','crstitle','crsappend') { |
foreach my $item ('target','width','height','crslabel','crstitle') { |
$newhash{$item} =~ s/^\s+//; |
$newhash{$item} =~ s/^\s+//; |
$newhash{$item} =~ s/\s+$//; |
$newhash{$item} =~ s/\s+$//; |
if (($item eq 'width') || ($item eq 'height') || ($item eq 'linktext') || ($item eq 'explanation')) { |
if (($item eq 'width') || ($item eq 'height')) { |
if ($newhash{'target'} eq 'iframe') { |
if ($newhash{'target'} eq 'iframe') { |
$newhash{$item} = ''; |
$newhash{$item} = ''; |
} elsif ($newhash{'target'} eq 'tab') { |
|
if (($item eq 'width') || ($item eq 'height')) { |
|
$newhash{$item} = ''; |
|
} |
|
} |
} |
} |
} |
if ($toolhash{$item} ne $newhash{$item}) { |
if ($toolhash{$item} ne $newhash{$item}) { |
Line 282 sub update_exttool {
|
Line 277 sub update_exttool {
|
unless (($item eq 'target') || |
unless (($item eq 'target') || |
((($item eq 'width') || ($item eq 'height')) && |
((($item eq 'width') || ($item eq 'height')) && |
(($newhash{'target'} eq 'window') || |
(($newhash{'target'} eq 'window') || |
(($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window')))) || |
(($newhash{'target'} eq '') && ($toolhash{'target'} eq 'window'))))) { |
((($item eq 'linktext') || ($item eq 'explanation')) && |
|
((($newhash{'target'} =~ /^(window|tab)$/)) || |
|
(($newhash{'target'} eq '') && ($toolhash{'target'} =~ /^(window|tab)$/))))) { |
|
delete($toolhash{$item}); |
delete($toolhash{$item}); |
push(@deleted,$item); |
push(@deleted,$item); |
$changed = 1; |
$changed = 1; |
Line 310 sub update_exttool {
|
Line 302 sub update_exttool {
|
|
|
sub extedit_form { |
sub extedit_form { |
my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller, |
my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller, |
$symb,$type,$cdom,$cnum,$ltitools,$disabled) = @_; |
$symb,$type,$cdom,$cnum,$ltitools) = @_; |
if ($type ne 'tool') { |
if ($type ne 'tool') { |
$type = 'ext'; |
$type = 'ext'; |
} |
} |
Line 333 sub extedit_form {
|
Line 325 sub extedit_form {
|
$tabid = 'ee'; |
$tabid = 'ee'; |
} |
} |
my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle, |
my ($formname,$formid,$toggle,$fieldsetid,$urlid,$dispdivstyle,$dimendivstyle, |
$windivstyle,$linktextstyle,$explanationstyle,$labelstyle,$titlestyle, |
$labelstyle,$titlestyle,$legend,$urlelem,$toolelem,%toolattr); |
$appendstyle,$legend,$urlelem,$toolelem,%toolattr); |
|
$formname = 'new'.$type; |
$formname = 'new'.$type; |
$toggle = $type; |
$toggle = $type; |
$fieldsetid = 'upload'.$type.'form'; |
$fieldsetid = 'upload'.$type.'form'; |
$urlid = $type.'url'; |
$urlid = $type.'url'; |
map { $toolattr{$_} = $type.$_; } ('dispdiv','dimendiv','dimenwidth','dimenheight', |
map { $toolattr{$_} = $type.$_; } ('dispdiv','dimendiv','dimenwidth','dimenheight', |
'crstitlediv','crslabeldiv','crsappenddiv', |
'crstitlediv','crslabeldiv','crstitle','crslabel'); |
'crstitle','crslabel','crsappend','windiv', |
|
'linktextdiv','explanationdiv','linktext', |
|
'explanation','providerurl'); |
|
$dispdivstyle = 'display:none'; |
$dispdivstyle = 'display:none'; |
$dimendivstyle = 'display:none'; |
$dimendivstyle = 'display:none'; |
$windivstyle = 'display:none'; |
|
$linktextstyle = 'display:none'; |
|
$explanationstyle = 'display:none'; |
|
$labelstyle = 'display:none'; |
$labelstyle = 'display:none'; |
$titlestyle = 'display:none'; |
$titlestyle = 'display:none'; |
$appendstyle = 'display:none'; |
|
if ($supplementalflag) { |
if ($supplementalflag) { |
$formname = 'newsupp'.$type; |
$formname = 'newsupp'.$type; |
$toggle = 'supp'.$type; |
$toggle = 'supp'.$type; |
Line 360 sub extedit_form {
|
Line 344 sub extedit_form {
|
map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr)); |
map { $toolattr{$_} = 'supp'.$toolattr{$_}; } (keys(%toolattr)); |
} |
} |
my ($link,$legend,$active,$srcclass,$extsrc,$preview,$title,$save,$crstitle,$crslabel, |
my ($link,$legend,$active,$srcclass,$extsrc,$preview,$title,$save,$crstitle,$crslabel, |
$crsappend,$fieldsetstyle,$action,$hiddenelem,$form,$width,$height,$tooltarget, |
$fieldsetstyle,$action,$hiddenelem,$form,$width,$height,$tooltarget,%chkstate); |
$linktext,$explanation,$providerurl,%chkstate); |
|
$fieldsetstyle = 'display: none;'; |
$fieldsetstyle = 'display: none;'; |
$action = '/adm/coursedocs'; |
$action = '/adm/coursedocs'; |
my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http'); |
|
my $rows = 2; |
|
my $cols = 20; |
|
if ($residx) { |
if ($residx) { |
if ($caller eq 'direct') { |
if ($caller eq 'direct') { |
$fieldsetstyle = 'display: block;'; |
$fieldsetstyle = 'display: block;'; |
$action = '/adm/extresedit'; |
$action = '/adm/extresedit'; |
$rows = 10; |
|
$cols = 45; |
|
if ($type eq 'tool') { |
if ($type eq 'tool') { |
$legend = $lt{'te'}; |
|
} else { |
|
$legend = $lt{'ee'}; |
$legend = $lt{'ee'}; |
|
} else { |
|
$legend = $lt{'te'}; |
} |
} |
$legend = '<legend>'.$legend.'</legend>'; |
$legend = '<legend>'.$legend.'</legend>'; |
if ($symb) { |
if ($symb) { |
Line 399 sub extedit_form {
|
Line 377 sub extedit_form {
|
$srcclass = ' class="LC_nobreak"'; |
$srcclass = ' class="LC_nobreak"'; |
if ($type eq 'ext') { |
if ($type eq 'ext') { |
$extsrc = '<span class="LC_docs_ext_edit">'.$lt{'ul'}.' </span>'; |
$extsrc = '<span class="LC_docs_ext_edit">'.$lt{'ul'}.' </span>'; |
$preview = ' <a class="LC_docs_ext_edit" href="javascript:extUrlPreview('."'$urlid','$protocol'".');">'.$lt{'pr'}.'</a>'; |
$preview = ' <a class="LC_docs_ext_edit" href="javascript:extUrlPreview('."'$urlid'".');">'.$lt{'pr'}.'</a>'; |
} |
} |
$title = '<span class="LC_docs_ext_edit">'.$lt{'ti'}.' </span>'; |
$title = '<span class="LC_docs_ext_edit">'.$lt{'ti'}.' </span>'; |
$save = $lt{'sv'}; |
$save = $lt{'sv'}; |
Line 421 sub extedit_form {
|
Line 399 sub extedit_form {
|
$orig_url = 'http://'; |
$orig_url = 'http://'; |
$orig_title = $lt{'ex'}; |
$orig_title = $lt{'ex'}; |
$extsrc = $lt{'ul'}.':<br />'; |
$extsrc = $lt{'ul'}.':<br />'; |
$preview = '<input type="button" name="view" value="'.$lt{'pr'}.'" onclick="javascript:extUrlPreview('."'$urlid','$protocol'".');"'.$disabled.' />'; |
$preview = '<input type="button" name="view" value="'.$lt{'pr'}.'" onclick="javascript:extUrlPreview('."'$urlid'".');" />'; |
$save = $lt{'al'}; |
$save = $lt{'al'}; |
} else { |
} else { |
$orig_title = $lt{'et'}; |
$orig_title = $lt{'et'}; |
$save = $lt{'at'}; |
$save = $lt{'at'}; |
$orig_url = "/adm/$cdom/$cnum/new/ext\.tool"; |
$orig_url = "/adm/$cdom/$cnum/new/exttool"; |
} |
} |
$pathitem .= '<br />'; |
$pathitem .= '<br />'; |
} |
} |
$formid = $formname; |
$formid = $formname; |
if ($type eq 'ext') { |
if ($type eq 'ext') { |
$urlelem = '<input type="text" size="'.$size.'" name="exturl" id="'.$urlid.'" value="'.$orig_url.'"'.$disabled.' />'; |
$urlelem = '<input type="text" size="'.$size.'" name="exturl" id="'.$urlid.'" value="'.$orig_url.'" />'; |
} else { |
} else { |
my $class = 'LC_nobreak'; |
my $class = 'LC_nobreak'; |
if ($residx) { |
if ($residx) { |
$class = 'LC_docs_ext_edit LC_nobreak'; |
$class = 'LC_docs_ext_edit LC_nobreak'; |
if ($orig_url =~ m{^/adm/$cdom/$cnum/(\d+)/ext\.tool$}) { |
if ($orig_url =~ m{^/adm/$cdom/$cnum/(\d+)/exttools?$}) { |
my $marker = $1; |
my $marker = $1; |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
my %toolhash=&Apache::lonnet::dump('exttool_'.$marker,$cdom,$cnum); |
if ($toolhash{'id'}) { |
if ($toolhash{'id'}) { |
Line 450 sub extedit_form {
|
Line 428 sub extedit_form {
|
if ($icon) { |
if ($icon) { |
$image = '<img src="'.$icon.'" alt="'.$tooltitle.'" />'; |
$image = '<img src="'.$icon.'" alt="'.$tooltitle.'" />'; |
} |
} |
if ($ltitools->{$toolhash{'id'}}->{'url'} =~ m{://}) { |
|
(my $prot,my $host,$providerurl) = ($ltitools->{$toolhash{'id'}}->{'url'} =~ m{^([^/]+)://([^/]+)(|/.+)$}); |
|
} else { |
|
$providerurl = $ltitools->{$toolhash{'id'}}->{'url'}; |
|
} |
|
$tooltarget = $toolhash{'target'}; |
$tooltarget = $toolhash{'target'}; |
if ($tooltarget eq 'window') { |
if ($tooltarget eq 'window') { |
$dimendivstyle = 'display:block'; |
$dimendivstyle = 'display:block'; |
$windivstyle = 'display:block'; |
|
$chkstate{'window'} = 'checked="checked" '; |
$chkstate{'window'} = 'checked="checked" '; |
} elsif ($tooltarget eq 'tab') { |
|
$windivstyle = 'display:block'; |
|
$chkstate{'tab'} = 'checked="checked" '; |
|
} else { |
} else { |
$chkstate{'iframe'} = 'checked="checked" '; |
$chkstate{'iframe'} = 'checked="checked" '; |
} |
} |
$width = $toolhash{'width'}; |
$width = $toolhash{'width'}; |
$height = $toolhash{'height'}; |
$height = $toolhash{'height'}; |
$linktext = $toolhash{'linktext'}; |
|
$explanation = $toolhash{'explanation'}; |
|
if (ref($ltitools->{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') { |
if (ref($ltitools->{$toolhash{'id'}}->{'crsconf'}) eq 'HASH') { |
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) { |
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'title'}) { |
$crstitle = $toolhash{'crstitle'}; |
$crstitle = $toolhash{'crstitle'}; |
Line 479 sub extedit_form {
|
Line 446 sub extedit_form {
|
$crslabel = $toolhash{'crslabel'}; |
$crslabel = $toolhash{'crslabel'}; |
$labelstyle = 'display:inline'; |
$labelstyle = 'display:inline'; |
} |
} |
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'append'}) { |
|
$crsappend = $toolhash{'crsappend'}; |
|
$appendstyle = 'display:inline'; |
|
} |
|
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'target'}) { |
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'target'}) { |
$dispdivstyle = 'display:block'; |
$dispdivstyle = 'display:block'; |
} |
} |
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'linktext'}) { |
|
$linktextstyle = 'padding:0;display:inline'; |
|
} |
|
if ($ltitools->{$toolhash{'id'}}->{'crsconf'}->{'explanation'}) { |
|
$explanationstyle = 'padding:0;display:inline'; |
|
} |
|
} |
} |
$toolelem = '<span class="LC_nobreak">'.$image.' '.$tooltitle.'</span><br />'; |
$toolelem = '<span class="LC_nobreak">'.$image.' '.$tooltitle.'</span><br />'; |
} |
} |
Line 502 sub extedit_form {
|
Line 459 sub extedit_form {
|
} else { |
} else { |
$toolelem = '<span class="LC_docs_ext_edit">'."\n". |
$toolelem = '<span class="LC_docs_ext_edit">'."\n". |
'<select name="exttoolid" id="LC_exttoolid" onchange="javascript:updateExttool(this,'. |
'<select name="exttoolid" id="LC_exttoolid" onchange="javascript:updateExttool(this,'. |
'this.form,'."'$supplementalflag'".');"'.$disabled.'>'."\n". |
'this.form,'."'$supplementalflag'".');">'."\n". |
'<option value="" selected="selected">'.&mt('Select').'</option>'; |
'<option value="" selected="selected">'.&mt('Select').'</option>'; |
my %bynum; |
my %bynum; |
if (ref($ltitools) eq 'HASH') { |
if (ref($ltitools) eq 'HASH') { |
Line 525 sub extedit_form {
|
Line 482 sub extedit_form {
|
$toolelem .= '</select></span><br />'; |
$toolelem .= '</select></span><br />'; |
$crslabel = $env{'course.'.$cdom.'_'.$cnum.'.internal.coursecode'}; |
$crslabel = $env{'course.'.$cdom.'_'.$cnum.'.internal.coursecode'}; |
$crstitle = $env{'course.'.$cdom.'_'.$cnum.'.description'}; |
$crstitle = $env{'course.'.$cdom.'_'.$cnum.'.description'}; |
$crsappend = ''; |
|
} |
} |
$toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'. |
$toolelem .= '<div id="'.$toolattr{'dispdiv'}.'" style="'.$dispdivstyle.'">'. |
'<span class="'.$class.'">'.&mt('Display target:').' '. |
'<span class="'.$class.'">'.&mt('Display target:').' '. |
'<label><input type="radio" name="exttooltarget" value="iframe" '.$chkstate{'iframe'}.'onclick="updateTooldim(this.form,'. |
'<label><input type="radio" name="exttooltarget" value="iframe" '.$chkstate{'iframe'}.'onclick="updateTooldim(this.form,'. |
"'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}', |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');">'.&mt('iframe').'</label>'.(' 'x2). |
'$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('iframe').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="exttooltarget" value="tab" '.$chkstate{'tab'}.'onclick="updateTooldim(this.form,'. |
|
"'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}', |
|
'$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('tab').'</label>'.(' 'x2). |
|
'<label><input type="radio" name="exttooltarget" value="window" '.$chkstate{'window'}.'onclick="updateTooldim(this.form,'. |
'<label><input type="radio" name="exttooltarget" value="window" '.$chkstate{'window'}.'onclick="updateTooldim(this.form,'. |
"'$toolattr{dimendiv}','$toolattr{windiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}', |
"'$toolattr{dimendiv}','$toolattr{dimenwidth}','$toolattr{dimenheight}'".');">'.&mt('window').'</label>'. |
'$toolattr{linktext}','$toolattr{explanation}'".');"'.$disabled.' />'.&mt('window').'</label></span>'. |
'</span><div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'">'. |
'<div id="'.$toolattr{'dimendiv'}.'" style="'.$dimendivstyle.'"><span class="'.$class.'">'. |
'<span class="'.$class.'">'. |
&mt('Width').': <input type="text" size="4" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'"'.$disabled.' />'.(' 'x2). |
&mt('Width').'<input type="text" id="'.$toolattr{'dimenwidth'}.'" name="exttoolwidth" value="'.$width.'">'.(' 'x2). |
&mt('Height').': <input type="text" size="4" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"'.$disabled.' /></span>'."\n". |
&mt('Height').'<input type="text" id="'.$toolattr{'dimenheight'}.'" name="exttoolheight" value="'.$height.'"></span>'."\n". |
'</div></div>'; |
'</div></div>'. |
$toolelem .= '<div id="'.$toolattr{'windiv'}.'" style="'.$windivstyle.'">'. |
'<div id="'.$toolattr{'crslabeldiv'}.'" style="'.$labelstyle.'">'. |
'<div id="'.$toolattr{'linktextdiv'}.'" class="LC_left_float" style="'.$linktextstyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Link Text').'</span><br /><input type="text" size="25" id="'.$toolattr{'linktext'}. |
|
'" name="exttoollinktext" value="'.$linktext.'"'.$disabled.' />'. |
|
'</div><div id="'.$toolattr{'explanationdiv'}.'" class="LC_left_float" style="'.$explanationstyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Explanation').'</span><br />'. |
|
'<textarea rows="'.$rows.'" cols="'.$cols.'" id="'.$toolattr{'explanation'}.'" name="exttoolexplanation" '.$disabled.'>'. |
|
$explanation.'</textarea></div><div style="padding:0;clear:both;margin:0;border:0"></div>'. |
|
'</div>'; |
|
$toolelem .= '<div id="'.$toolattr{'crslabeldiv'}.'" style="'.$labelstyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Course label:').' '. |
'<span class="'.$class.'">'.&mt('Course label:').' '. |
'<input type="text" id="'.$toolattr{'crslabel'}.'" name="exttoollabel" value="'.$crslabel.'"'.$disabled.' /></span><br />'. |
'<input type="text" id="'.$toolattr{'crslabel'}.'" name="exttoollabel" value="'.$crslabel.'"><br />'. |
'</div>'. |
'</div>'. |
'<div id="'.$toolattr{'crstitlediv'}.'" style="'.$titlestyle.'">'. |
'<div id="'.$toolattr{'crstitlediv'}.'" style="'.$titlestyle.'">'. |
'<span class="'.$class.'">'.&mt('Course title:').' '. |
'<span class="'.$class.'">'.&mt('Course title:').' '. |
'<input type="text" id="'.$toolattr{'crstitle'}.'" name="exttooltitle" value="'.$crstitle.'"'.$disabled.' /></span><br />'. |
'<input type="text" id="'.$toolattr{'crstitle'}.'" name="exttooltitle" value="'.$crstitle.'"><br />'. |
'</div>'. |
|
'<div id="'.$toolattr{'crsappenddiv'}.'" style="'.$appendstyle.'">'. |
|
'<span class="'.$class.'">'.&mt('Append to URL[_1]', |
|
'<span id="'.$toolattr{'providerurl'}.'"> ('.$providerurl.')<br /></span>'). |
|
'<input type="text" id="'.$toolattr{'crsappend'}.'" size="30" name="exttoolappend" value="'.$crsappend.'"'.$disabled.' /></span><br />'. |
|
'</div>'; |
'</div>'; |
} |
} |
my $chooser = $toolelem; |
my $chooser = $toolelem; |
Line 586 $chooser
|
Line 524 $chooser
|
<div> |
<div> |
<span$srcclass> |
<span$srcclass> |
$title |
$title |
<input type="text" size="$size" name="exttitle" value="$orig_title" $disabled /> |
<input type="text" size="$size" name="exttitle" value="$orig_title" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
$pathitem |
$pathitem |
$hiddenelem |
$hiddenelem |
<input type="button" value="$save" onclick="javascript:setExternal(this.form,'$residx','$type','$orig_url','$supplementalflag');" $disabled /> |
<input type="button" value="$save" onclick="javascript:setExternal(this.form,'$residx','$type','$orig_url','$supplementalflag');" /> |
</span> |
</span> |
</div> |
</div> |
</fieldset> |
</fieldset> |
Line 604 ENDFORM
|
Line 542 ENDFORM
|
} |
} |
|
|
sub display_editor { |
sub display_editor { |
my ($url,$folderpath,$symb,$idx,$type,$cdom,$cnum,$hostname) = @_; |
my ($url,$folderpath,$symb,$idx,$type,$cdom,$cnum) = @_; |
my ($residx,$supplementalflag,$title,$pathitem,$output,$js,$navmap); |
my ($residx,$supplementalflag,$title,$pathitem,$output,$js); |
if ($folderpath =~ /^supplemental/) { |
if ($folderpath =~ /^supplemental/) { |
$supplementalflag = 1; |
$supplementalflag = 1; |
$residx = $idx; |
$residx = $idx; |
Line 615 sub display_editor {
|
Line 553 sub display_editor {
|
(my $map,$residx,my $res) = |
(my $map,$residx,my $res) = |
&Apache::lonnet::decode_symb($symb); |
&Apache::lonnet::decode_symb($symb); |
$title = &Apache::lonnet::gettitle($symb); |
$title = &Apache::lonnet::gettitle($symb); |
my $path = &Apache::loncommon::symb_to_docspath($symb,\$navmap); |
my $path = &Apache::loncommon::symb_to_docspath($symb); |
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($path,'<>&"').'" />'; |
$pathitem = '<input type="hidden" name="folderpath" value="'.&HTML::Entities::encode($path,'<>&"').'" />'; |
} |
} |
my %ltitools; |
my %ltitools; |
if ($type eq 'tool') { |
if ($type eq 'tool') { |
%ltitools = &Apache::lonnet::get_domain_lti($cdom,'consumer'); |
%ltitools = &Apache::lonnet::get_domain_ltitools($cdom); |
} |
} |
$js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript()); |
$js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript()); |
my $args = { 'force_register' => $env{'form.register'} }; |
my $args = { 'force_register' => $env{'form.register'} }; |
if ($hostname) { |
|
$args->{'hostname'} = $hostname; |
|
} |
|
my $description = 'External Resource Editor'; |
my $description = 'External Resource Editor'; |
if ($type eq 'tool') { |
if ($type eq 'tool') { |
$description = 'External Tool Editor'; |
$description = 'External Tool Editor'; |
Line 645 sub extedit_javascript {
|
Line 580 sub extedit_javascript {
|
if (ref($toolsref) eq 'HASH') { |
if (ref($toolsref) eq 'HASH') { |
my $num = scalar(keys(%{$toolsref})); |
my $num = scalar(keys(%{$toolsref})); |
$toolsjs = " var ltitools = new Array($num);\n". |
$toolsjs = " var ltitools = new Array($num);\n". |
" var ltitoolsUrl = new Array($num);\n". |
|
" var ltitoolsTarget = new Array($num);\n". |
" var ltitoolsTarget = new Array($num);\n". |
" var ltitoolsWidth = new Array($num);\n". |
" var ltitoolsWidth = new Array($num);\n". |
" var ltitoolsHeight = new Array($num);\n". |
" var ltitoolsHeight = new Array($num);\n". |
" var ltitoolsLinkDef = new Array($num);\n". |
|
" var ltitoolsExplainDef = new Array($num);\n". |
|
" var ltitoolsDisplay = new Array($num);\n". |
" var ltitoolsDisplay = new Array($num);\n". |
" var ltitoolsLink = new Array($num);\n". |
|
" var ltitoolsExplain = new Array($num);\n". |
|
" var ltitoolsLabel = new Array($num);\n". |
" var ltitoolsLabel = new Array($num);\n". |
" var ltitoolsTitle = new Array($num);\n". |
" var ltitoolsTitle = new Array($num);\n"; |
" var ltitoolsAppend = new Array($num);\n"; |
|
my $i = 0; |
my $i = 0; |
foreach my $key (sort { $a <=> $b } keys(%{$toolsref})) { |
foreach my $key (sort { $a <=> $b } keys(%{$toolsref})) { |
if (ref($toolsref->{$key}) eq 'HASH') { |
if (ref($toolsref->{$key})) { |
if (ref($toolsref->{$key}->{'display'}) eq 'HASH') { |
my $target = $toolsref->{$key}->{'target'}; |
my $target = $toolsref->{$key}->{'display'}->{'target'}; |
my $width = $toolsref->{$key}->{'width'}; |
my $width = $toolsref->{$key}->{'display'}->{'width'}; |
my $height = $toolsref->{$key}->{'height'}; |
my $height = $toolsref->{$key}->{'display'}->{'height'}; |
$toolsjs .= ' ltitools['.$i.'] = '."'$key';\n". |
my $linkdef = $toolsref->{$key}->{'display'}->{'linktext'}; |
' ltitoolsTarget['.$i.'] = '."'$target';\n". |
my $explaindef = $toolsref->{$key}->{'display'}->{'explanation'}; |
' ltitoolsWidth['.$i.'] = '."'$width';\n". |
my $providerurl; |
' ltitoolsHeight['.$i.'] = '."'$height';\n"; |
if ($toolsref->{$key}->{'url'} =~ m{://}) { |
my %courseconfig; |
(my $prot,my $host,$providerurl) = ($toolsref->{$key}->{'url'} =~ m{^([^/]+)://([^/]+)(|/.+)$}); |
|
} else { |
|
$providerurl = $toolsref->{$key}->{'url'}; |
|
} |
|
$providerurl = &LONCAPA::map::qtunescape($providerurl); |
|
$toolsjs .= ' ltitools['.$i.'] = '."'$key';\n". |
|
' ltitoolsTarget['.$i.'] = '."'$target';\n". |
|
' ltitoolsWidth['.$i.'] = '."'$width';\n". |
|
' ltitoolsHeight['.$i.'] = '."'$height';\n". |
|
' ltitoolsLinkDef['.$i.'] = '."'$linkdef';\n". |
|
' ltitoolsExplainDef['.$i.'] = '."'$explaindef';\n". |
|
' ltitoolsUrl['.$i.'] = '."'$providerurl';\n"; |
|
} |
|
if (ref($toolsref->{$key}->{'crsconf'}) eq 'HASH') { |
if (ref($toolsref->{$key}->{'crsconf'}) eq 'HASH') { |
my $display = $toolsref->{$key}->{'crsconf'}->{'target'}; |
my $display = $toolsref->{$key}->{'crsconf'}->{'target'}; |
$toolsjs .= ' ltitoolsDisplay['.$i.'] = '."'$display';\n"; |
$toolsjs .= ' ltitoolsDisplay['.$i.'] = '."'$display';\n"; |
my $linktext = $toolsref->{$key}->{'crsconf'}->{'linktext'}; |
|
$toolsjs .= ' ltitoolsLink['.$i.'] = '."'$linktext';\n"; |
|
my $explanation = $toolsref->{$key}->{'crsconf'}->{'explanation'}; |
|
$toolsjs .= ' ltitoolsExplain['.$i.'] = '."'$explanation';\n"; |
|
my $label = $toolsref->{$key}->{'crsconf'}->{'label'}; |
my $label = $toolsref->{$key}->{'crsconf'}->{'label'}; |
$toolsjs .= ' ltitoolsLabel['.$i.'] = '."'$label';\n"; |
$toolsjs .= ' ltitoolsLabel['.$i.'] = '."'$label';\n"; |
my $title = $toolsref->{$key}->{'crsconf'}->{'title'}; |
my $title = $toolsref->{$key}->{'crsconf'}->{'title'}; |
$toolsjs .= ' ltitoolsTitle['.$i.'] = '."'$title';\n"; |
$toolsjs .= ' ltitoolsTitle['.$i.'] = '."'$title';\n"; |
my $append = $toolsref->{$key}->{'crsconf'}->{'append'}; |
|
$toolsjs .= ' ltitoolsAppend['.$i.'] = '."'$append';\n"; |
|
} |
} |
$i++; |
$i++; |
} |
} |
Line 702 sub extedit_javascript {
|
Line 612 sub extedit_javascript {
|
my %js_lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
invurl => 'Invalid URL', |
invurl => 'Invalid URL', |
titbl => 'Title is blank', |
titbl => 'Title is blank', |
mixfra => 'Show preview in pop-up? (http in https page + no framing)', |
|
mixonly => 'Show preview in pop-up? (http in https page)', |
|
fraonly => 'Show preview in pop-up? (framing disallowed)', |
|
nopopup => 'Pop-up blocked', |
|
nopriv => 'Insufficient privileges to use preview', |
|
badurl => 'URL is not: http://hostname/path or https://hostname/path', |
|
invtool => 'Please select an external tool', |
invtool => 'Please select an external tool', |
); |
); |
&js_escape(\%js_lt); |
&js_escape(\%js_lt); |
Line 760 function setExternal(extform,residx,type
|
Line 664 function setExternal(extform,residx,type
|
prefix = 'supp'; |
prefix = 'supp'; |
} |
} |
var dispdiv = prefix+'tooldispdiv'; |
var dispdiv = prefix+'tooldispdiv'; |
var windiv = prefix+'toolwindiv'; |
|
if (residx > 0) { |
if (residx > 0) { |
dispdiv += '_'+residx; |
dispdiv += '_'+residx; |
windiv += '_'+residx; |
|
} |
} |
if (document.getElementById(dispdiv)) { |
if (document.getElementById(dispdiv)) { |
if (document.getElementById(dispdiv).style.display == 'block') { |
if (document.getElementById(dispdiv).style.display == 'block') { |
Line 775 function setExternal(extform,residx,type
|
Line 677 function setExternal(extform,residx,type
|
width.trim(); |
width.trim(); |
var height = extform.exttoolheight.value; |
var height = extform.exttoolheight.value; |
height.trim(); |
height.trim(); |
info += ':window:'+width+':'+height; |
info += ':window:'+width+':'+height; |
} else if (extform.exttooltarget[i].value == 'tab') { |
|
info += ':tab::'; |
|
} else { |
} else { |
info += ':iframe::'; |
info += ':iframe::'; |
} |
} |
Line 790 function setExternal(extform,residx,type
|
Line 690 function setExternal(extform,residx,type
|
} else { |
} else { |
info += ':::'; |
info += ':::'; |
} |
} |
if (document.getElementById(windiv)) { |
|
if (document.getElementById(windiv).style.display == 'block') { |
|
var linktextdiv = prefix+'toollinktextdiv'; |
|
var explanationdiv = prefix+'toolexplanationdiv'; |
|
if (residx > 0) { |
|
linktextdiv += '_'+residx; |
|
explanationdiv += '_'+residx; |
|
} |
|
if (document.getElementById(linktextdiv).style.display == 'inline') { |
|
var linktext = extform.exttoollinktext.value; |
|
linktext.trim(); |
|
info += ':'+escape(linktext); |
|
} else { |
|
info += ':'; |
|
} |
|
if (document.getElementById(explanationdiv).style.display == 'inline') { |
|
var explaintext = extform.exttoolexplanation.value; |
|
explaintext.trim(); |
|
info += ':'+escape(explaintext); |
|
} else { |
|
info += ':'; |
|
} |
|
} else { |
|
info += '::'; |
|
} |
|
} else { |
|
info += '::'; |
|
} |
|
var labelinput = prefix+'toolcrslabel'; |
var labelinput = prefix+'toolcrslabel'; |
var titleinput = prefix+'toolcrstitle'; |
var titleinput = prefix+'toolcrstitle'; |
var appendinput = prefix+'toolcrsappend'; |
|
if (residx > 0) { |
if (residx > 0) { |
labelinput += '_'+residx; |
labelinput += '_'+residx; |
titleinput += '_'+residx; |
titleinput += '_'+residx; |
appendinput += '_'+residx; |
|
} |
} |
if (document.getElementById(labelinput)) { |
if (document.getElementById(labelinput)) { |
var crslabel = document.getElementById(labelinput).value; |
var crslabel = document.getElementById(labelinput).value; |
Line 840 function setExternal(extform,residx,type
|
Line 710 function setExternal(extform,residx,type
|
} else { |
} else { |
info += ':'; |
info += ':'; |
} |
} |
if (document.getElementById(appendinput)) { |
|
var crsappend = document.getElementById(appendinput).value; |
|
crsappend.trim(); |
|
info += ':'+escape(crsappend); |
|
} else { |
|
info += ':'; |
|
} |
|
info=escape(info); |
info=escape(info); |
if (residx > 0) { |
if (residx > 0) { |
eval("extform.importdetail.value=title+'='+info+'='+residx;extform.submit();"); |
eval("extform.importdetail.value=title+'='+info+'='+residx;extform.submit();"); |
Line 870 function editext(residx,type) {
|
Line 733 function editext(residx,type) {
|
return; |
return; |
} |
} |
|
|
function extUrlPreview(caller,protocol) { |
function extUrlPreview(caller) { |
if (document.getElementById(caller)) { |
if (document.getElementById(caller)) { |
var url = document.getElementById(caller).value; |
var url = document.getElementById(caller).value; |
if (regexp.test(url)) { |
if (regexp.test(url)) { |
var http_regex = /^http\:\/\//gi; |
openMyModal(url,500,400,'yes'); |
var mixed = 0; |
|
var noiframe = 0; |
|
var nopriv = 0; |
|
var badurl = 0; |
|
var name = "externalpreview"; |
|
if ((protocol == 'https') && (http_regex.test(url))) { |
|
mixed = 1; |
|
} |
|
var http = new XMLHttpRequest(); |
|
var lcurl = "/adm/exturlcheck"; |
|
var params = "exturl="+url; |
|
http.open("POST",lcurl, true); |
|
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
|
http.onreadystatechange = function() { |
|
if (http.readyState == 4) { |
|
if (http.status == 200) { |
|
if (http.responseText.length > 0) { |
|
if (http.responseText == 1) { |
|
noiframe = 1; |
|
} else if (http.responseText == -1) { |
|
nopriv = 1; |
|
} else if (http.responseText == 0) { |
|
badurl = 1; |
|
} |
|
} |
|
openPreviewWindow(url,name,noiframe,mixed,nopriv,badurl); |
|
} |
|
} |
|
} |
|
http.send(params); |
|
} else { |
} else { |
alert("$js_lt{'invurl'}"); |
alert("$js_lt{'invurl'}"); |
} |
} |
} |
} |
} |
} |
|
|
var previewLCWindow = null; |
|
function openPreviewWindow(url,name,noiframe,mixed,nopriv,badurl) { |
|
if (previewLCWindow !=null) { |
|
previewLCWindow.close(); |
|
} |
|
if (badurl) { |
|
alert("$js_lt{'badurl'}"); |
|
} else if (nopriv) { |
|
alert("$js_lt{'nopriv'}"); |
|
} else if ((noiframe == 1) || (mixed == 1)) { |
|
var encurl = encodeURI(url); |
|
var msg; |
|
if (mixed == 1) { |
|
if (noiframe == 1) { |
|
msg = "$js_lt{'mixfra'}"; |
|
} else { |
|
msg = "$js_lt{'mixonly'}"; |
|
} |
|
} else { |
|
msg = "$js_lt{'fraonly'}"; |
|
} |
|
if (confirm(msg)) { |
|
previewLCWindow = window.open(url,name,"height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1"); |
|
if (previewLCWindow != null) { |
|
previewLCWindow.focus(); |
|
} else { |
|
alert("$js_lt{'nopopup'}"); |
|
} |
|
} |
|
} else { |
|
openMyModal(url,500,400,'yes'); |
|
} |
|
} |
|
|
|
function updateExttool(caller,form,supplementalflag) { |
function updateExttool(caller,form,supplementalflag) { |
var prefix = ''; |
var prefix = ''; |
if (supplementalflag == 1) { |
if (supplementalflag == 1) { |
Line 952 function updateExttool(caller,form,suppl
|
Line 751 function updateExttool(caller,form,suppl
|
} |
} |
dispdiv = prefix+'tooldispdiv'; |
dispdiv = prefix+'tooldispdiv'; |
dimendiv = prefix+'tooldimendiv'; |
dimendiv = prefix+'tooldimendiv'; |
widthinput = prefix+'tooldimenwidth'; |
widthinput = prefix+'toolwidth'; |
heightinput = prefix+'tooldimenheight'; |
heightinput = prefix+'toolheight'; |
labeldiv = prefix+'toolcrslabeldiv'; |
labeldiv = prefix+'toolcrslabeldiv'; |
titlediv = prefix+'toolcrstitlediv'; |
titlediv = prefix+'toolcrstitlediv'; |
appenddiv = prefix+'toolcrsappenddiv'; |
|
providerurl = prefix+'toolproviderurl'; |
|
labelinput = prefix+'toolcrslabel'; |
labelinput = prefix+'toolcrslabel'; |
titleinput = prefix+'toolcrstitle'; |
titleinput = prefix+'toolcrstitle'; |
appendinput = prefix+'toolcrsappend'; |
|
windiv = prefix+'toolwindiv'; |
|
linktextdiv = prefix+'toollinktextdiv'; |
|
linktextinput = prefix+'toollinktext'; |
|
explanationdiv = prefix+'toolexplanationdiv'; |
|
explanationinput = prefix+'toolexplanation'; |
|
if (document.getElementById(dispdiv)) { |
if (document.getElementById(dispdiv)) { |
var toolpick = caller.options[caller.selectedIndex].value; |
var toolpick = caller.options[caller.selectedIndex].value; |
$toolsjs |
$toolsjs |
Line 976 function updateExttool(caller,form,suppl
|
Line 767 function updateExttool(caller,form,suppl
|
if (document.getElementById(dimendiv)) { |
if (document.getElementById(dimendiv)) { |
document.getElementById(dimendiv).style.display = 'none'; |
document.getElementById(dimendiv).style.display = 'none'; |
} |
} |
if (document.getElementById(windiv)) { |
|
document.getElementById(windiv).style.display = 'none'; |
|
} |
|
if (document.getElementById(linktextdiv)) { |
|
document.getElementById(linktextdiv).style.display = 'none'; |
|
} |
|
if (document.getElementById(explanationdiv)) { |
|
document.getElementById(explanationdiv).style.display = 'none'; |
|
} |
|
if (document.getElementById(labeldiv)) { |
if (document.getElementById(labeldiv)) { |
document.getElementById(labeldiv).style.display = 'none'; |
document.getElementById(labeldiv).style.display = 'none'; |
} |
} |
if (document.getElementById(titlediv)) { |
if (document.getElementById(titlediv)) { |
document.getElementById(titlediv).style.display = 'none'; |
document.getElementById(titlediv).style.display = 'none'; |
} |
} |
if (document.getElementById(appenddiv)) { |
|
document.getElementById(appenddiv).style.display = 'none'; |
|
} |
|
} else { |
} else { |
if (ltitools.length > 0) { |
if (ltitools.length > 0) { |
for (var j=0; j<ltitools.length; j++) { |
for (var j=0; j<ltitools.length; j++) { |
Line 1009 function updateExttool(caller,form,suppl
|
Line 788 function updateExttool(caller,form,suppl
|
} |
} |
} |
} |
} |
} |
} |
if (ltitoolsTarget[j] == 'window') { |
var dimen = 'none'; |
dimen = 'block'; |
var dimenwidth = ''; |
dimenwidth = ltitoolsWidth[j]; |
var dimenheight = ''; |
dimenheight = ltitoolsHeight[j]; |
if ((ltitoolsDisplay[j]) && (ltitoolsTarget[j] == 'window')) { |
|
dimen = 'block'; |
|
dimenwidth = ltitoolsWidth[j]; |
|
dimenheight = ltitoolsHeight[j]; |
|
} |
|
if (document.getElementById(dimendiv)) { |
|
document.getElementById(dimendiv).style.display = dimen; |
|
} |
|
if (document.getElementById(widthinput)) { |
|
document.getElementById(widthinput).value = dimenwidth; |
|
} |
|
if (document.getElementById(heightinput)) { |
|
document.getElementById(heightinput).value = dimenheight; |
|
} |
|
} |
|
if (document.getElementById(windiv)) { |
|
if ((ltitoolsTarget[j] == 'window') || (ltitoolsTarget[j] == 'tab')) { |
|
document.getElementById(windiv).style.display = 'block'; |
|
} else { |
|
document.getElementById(windiv).style.display = 'none'; |
|
} |
|
if (document.getElementById(linktextdiv)) { |
|
if (ltitoolsLink[j]) { |
|
document.getElementById(linktextdiv).style.display = 'inline'; |
|
} else { |
} else { |
document.getElementById(linktextdiv).style.display = 'none'; |
dimen = 'none'; |
|
dimenwidth = ''; |
|
dimenheight = ''; |
} |
} |
} |
if (document.getElementById(dimendiv)) { |
if (document.getElementById(linktextinput)) { |
document.getElementById(dimendiv).style.display = dimen; |
if (ltitoolsLink[j]) { |
|
document.getElementById(linktextinput).value = ltitoolsLinkDef[j]; |
|
} else { |
|
document.getElementById(linktextinput).value = ''; |
|
} |
} |
} |
if (document.getElementById(widthinput)) { |
if (document.getElementById(explanationdiv)) { |
document.getElementById(widthinput).value = dimenwidth; |
if (ltitoolsExplain[j]) { |
|
document.getElementById(explanationdiv).style.display = 'inline'; |
|
} else { |
|
document.getElementById(explanationdiv).style.display = 'none'; |
|
} |
} |
} |
if (document.getElementById(heightinput)) { |
if (document.getElementById(explanationinput)) { |
document.getElementById(heightinput).value = dimenheight; |
if (ltitoolsExplain[j]) { |
|
document.getElementById(explanationinput).value = ltitoolsExplainDef[j]; |
|
} else { |
|
document.getElementById(explananationinput).value = ''; |
|
} |
} |
} |
} |
} |
} |
Line 1077 function updateExttool(caller,form,suppl
|
Line 822 function updateExttool(caller,form,suppl
|
document.getElementById(titlediv).style.display = 'none'; |
document.getElementById(titlediv).style.display = 'none'; |
} |
} |
} |
} |
if (document.getElementById(appenddiv)) { |
|
if (ltitoolsAppend[j]) { |
|
document.getElementById(appenddiv).style.display = 'inline'; |
|
if (document.getElementById(providerurl)) { |
|
if ((ltitoolsUrl[j] != '') && (ltitoolsUrl[j] != null)) { |
|
document.getElementById(providerurl).innerHTML = ' ('+ltitoolsUrl[j]+')<br />'; |
|
} |
|
} |
|
} else { |
|
document.getElementById(appenddiv).style.display = 'none'; |
|
if (document.getElementById(providerurl)) { |
|
document.getElementById(providerurl).innerHTML = ''; |
|
} |
|
} |
|
} |
|
break; |
break; |
} |
} |
} |
} |
Line 1100 function updateExttool(caller,form,suppl
|
Line 830 function updateExttool(caller,form,suppl
|
} |
} |
} |
} |
|
|
function updateTooldim(form,dimendiv,windiv,widthinput,heightinput,linkinput,explaininput) { |
function updateTooldim(form,dimendiv,widthinput,heightinput) { |
if (form.exttooltarget.length) { |
if (form.exttooltarget.length) { |
for (var i=0; i<form.exttooltarget.length; i++) { |
for (var i=0; i<form.exttooltarget.length; i++) { |
if (form.exttooltarget[i].checked) { |
if (form.exttooltarget[i].checked) { |
var dimen = 'none'; |
var dimen = 'none'; |
var linkconf = 'none'; |
|
if (form.exttooltarget[i].value == 'window') { |
if (form.exttooltarget[i].value == 'window') { |
dimen = 'block'; |
dimen = 'block'; |
linkconf = 'block'; |
|
} else { |
} else { |
if (form.exttooltarget[i].value == 'tab') { |
if (document.getElementById(widthinput)) { |
linkconf = 'block'; |
document.getElementById(widthinput).value = ''; |
} else { |
} |
if (document.getElementById(widthinput)) { |
if (document.getElementById(heightinput)) { |
document.getElementById(widthinput).value = ''; |
document.getElementById(heightinput).value = ''; |
} |
|
if (document.getElementById(heightinput)) { |
|
document.getElementById(heightinput).value = ''; |
|
} |
|
if (document.getElementById(linkinput)) { |
|
document.getElementById(linkinput).value = ''; |
|
} |
|
if (document.getElementById(explaininput)) { |
|
document.getElementById(explaininput).value = ''; |
|
} |
|
} |
} |
} |
} |
if (document.getElementById(dimendiv)) { |
if (document.getElementById(dimendiv)) { |
document.getElementById(dimendiv).style.display = dimen; |
document.getElementById(dimendiv).style.display = dimen; |
} |
} |
if (document.getElementById(windiv)) { |
|
document.getElementById(windiv).style.display = linkconf; |
|
} |
|
break; |
break; |
} |
} |
} |
} |