--- loncom/interface/lonextresedit.pm 2015/06/09 21:22:56 1.8
+++ loncom/interface/lonextresedit.pm 2019/07/30 19:53:22 1.8.2.4
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: lonextresedit.pm,v 1.8 2015/06/09 21:22:56 damieng Exp $
+# $Id: lonextresedit.pm,v 1.8.2.4 2019/07/30 19:53:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -201,7 +201,7 @@ sub process_changes {
}
sub extedit_form {
- my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller,$symb) = @_;
+ my ($supplementalflag,$residx,$orig_url,$orig_title,$pathitem,$helpitem,$caller,$symb,$disabled) = @_;
my %lt = &Apache::lonlocal::texthash(
ex => 'External Resource',
ed => 'Edit',
@@ -229,6 +229,7 @@ sub extedit_form {
$fieldsetstyle,$action,$hiddenelem,$form);
$fieldsetstyle = 'display: none;';
$action = '/adm/coursedocs';
+ my $protocol = ($ENV{'SERVER_PORT'} == 443?'https':'http');
if ($residx) {
if ($caller eq 'direct') {
$fieldsetstyle = 'display: block;';
@@ -252,7 +253,7 @@ sub extedit_form {
$urlid = "exturl_$residx";
$srcclass = ' class="LC_nobreak"';
$extsrc = ''.$lt{'ul'}.' ';
- $preview = ' '.$lt{'pr'}.'';
+ $preview = ' '.$lt{'pr'}.'';
$title = ''.$lt{'ti'}.' ';
$save = $lt{'sv'};
} else {
@@ -263,7 +264,7 @@ sub extedit_form {
$residx = 0;
$orig_url = 'http://';
$orig_title = $lt{'ex'};
- $preview = '';
+ $preview = '';
$save = $lt{'al'};
$pathitem .= '
';
}
@@ -274,17 +275,17 @@ $legend
$active
$extsrc
-
+
$preview
$title
-
+
$pathitem
$hiddenelem
-
+
@@ -297,8 +298,8 @@ ENDFORM
}
sub display_editor {
- my ($url,$folderpath,$symb,$idx) = @_;
- my ($residx,$supplementalflag,$title,$pathitem,$output);
+ my ($url,$folderpath,$symb,$idx,$type,$cdom,$cnum,$hostname) = @_;
+ my ($residx,$supplementalflag,$title,$pathitem,$output,$js,$navmap);
if ($folderpath =~ /^supplemental/) {
$supplementalflag = 1;
$residx = $idx;
@@ -308,11 +309,14 @@ sub display_editor {
(my $map,$residx,my $res) =
&Apache::lonnet::decode_symb($symb);
$title = &Apache::lonnet::gettitle($symb);
- my $path = &Apache::loncommon::symb_to_docspath($symb);
+ my $path = &Apache::loncommon::symb_to_docspath($symb,\$navmap);
$pathitem = '';
}
- my $js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript());
+ $js = &Apache::lonhtmlcommon::scripttag(&extedit_javascript());
my $args = { 'force_register' => $env{'form.register'} };
+ if ($hostname) {
+ $args->{'hostname'} = $hostname;
+ }
return &Apache::loncommon::start_page('External Resource Editor',$js,$args).
'