version 1.190, 2003/10/07 20:30:13
|
version 1.191, 2003/10/24 21:09:24
|
Line 200 sub handler {
|
Line 200 sub handler {
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['catalogmode','launch','acts','mode','form','element','pause', |
['catalogmode','launch','acts','mode','form','element','pause', |
'phase','persistent_db_id','table','start','show', |
'phase','persistent_db_id','table','start','show', |
'cleargroupsort']); |
'cleargroupsort','titleelement']); |
## |
## |
## The following is a trick - we wait a few seconds if asked to so |
## The following is a trick - we wait a few seconds if asked to so |
## the daemon running the search can get ahead of the daemon |
## the daemon running the search can get ahead of the daemon |
Line 282 END
|
Line 282 END
|
$hidden_fields .= '<input type="hidden" name="element" value="'. |
$hidden_fields .= '<input type="hidden" name="element" value="'. |
$ENV{'form.element'}.'" />'."\n"; |
$ENV{'form.element'}.'" />'."\n"; |
} |
} |
|
if (exists($ENV{'form.titleelement'})) { |
|
$hidden_fields .= '<input type="hidden" name="titleelement" value="'. |
|
$ENV{'form.titleelement'}.'" />'."\n"; |
|
} |
if (exists($ENV{'form.mode'})) { |
if (exists($ENV{'form.mode'})) { |
$hidden_fields .= '<input type="hidden" name="mode" value="'. |
$hidden_fields .= '<input type="hidden" name="mode" value="'. |
$ENV{'form.mode'}.'" />'."\n"; |
$ENV{'form.mode'}.'" />'."\n"; |
Line 2688 Checked for existance & 'edit' mode.
|
Line 2692 Checked for existance & 'edit' mode.
|
|
|
=item 'form.form' |
=item 'form.form' |
|
|
|
Contains the name of the form that has the input fields to set |
|
|
=item 'form.element' |
=item 'form.element' |
|
|
|
the name of the input field to put the URL into |
|
|
|
=item 'form.titleelement' |
|
|
|
the name of the input field to put the title into |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 2726 SCRIPT
|
Line 2738 SCRIPT
|
} elsif ($ENV{'form.mode'} eq 'edit') { |
} elsif ($ENV{'form.mode'} eq 'edit') { |
my $form = $ENV{'form.form'}; |
my $form = $ENV{'form.form'}; |
my $element = $ENV{'form.element'}; |
my $element = $ENV{'form.element'}; |
|
my $titleelement = $ENV{'form.titleelement'}; |
|
my $changetitle; |
|
if (!$titleelement) { |
|
$changetitle='function changeTitle(val) {}'; |
|
} else { |
|
$changetitle=<<END; |
|
function changeTitle(val) { |
|
if (parent.targetwin.document) { |
|
parent.targetwin.document.forms["$form"].elements["$titleelement"].value=val; |
|
} else { |
|
var url = 'forms[\"$form\"].elements[\"$titleelement\"].value'; |
|
alert("Unable to transfer data to "+url); |
|
} |
|
} |
|
END |
|
} |
|
|
$result.=<<SCRIPT; |
$result.=<<SCRIPT; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function select_data(title,url) { |
function select_data(title,url) { |
changeURL(url); |
changeURL(url); |
|
changeTitle(title); |
parent.close(); |
parent.close(); |
} |
} |
function changeTitle(val) { |
$changetitle |
} |
|
function changeURL(val) { |
function changeURL(val) { |
if (parent.targetwin.document) { |
if (parent.targetwin.document) { |
parent.targetwin.document.forms["$form"].elements["$element"].value=val; |
parent.targetwin.document.forms["$form"].elements["$element"].value=val; |