version 1.149, 2021/04/29 17:45:22
|
version 1.151, 2022/09/18 22:33:45
|
Line 314 sub handler {
|
Line 314 sub handler {
|
if ($allowed) { |
if ($allowed) { |
#---------------------------------- Print External URL Syllabus Info if editing |
#---------------------------------- Print External URL Syllabus Info if editing |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
my $hostname = &Apache::lonnet::hostname($homeserver); |
my $link = &Apache::lonnet::url_prefix($r,$cdom,$homeserver,'web'). |
my $protocol = $Apache::lonnet::protocol{$homeserver}; |
$r->uri; |
$protocol = 'http' if ($protocol ne 'https'); |
|
my $link = $protocol.'://'.$hostname.$r->uri; |
|
$r->print('<div class="LC_left_float">' |
$r->print('<div class="LC_left_float">' |
.'<span class="LC_help_open_topic LC_info">' |
.'<span class="LC_help_open_topic LC_info">' |
.'<span class="LC_info">' |
.'<span class="LC_info">' |
Line 326 sub handler {
|
Line 324 sub handler {
|
.'</span>' |
.'</span>' |
.'</div><div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"); |
.'</div><div style="padding:0;clear:both;margin:0;border:0"></div>'."\n"); |
my $lonhost = $r->dir_config('lonHostID'); |
my $lonhost = $r->dir_config('lonHostID'); |
$r->print(&chooser($external,$uploaded,$minimal,$cdom,$cnum,$lonhost, |
$r->print(&chooser($r,$external,$uploaded,$minimal,$cdom,$cnum,$lonhost, |
\%syllabusfields,\%syllabus)); |
\%syllabusfields,\%syllabus)); |
} |
} |
} else { |
} else { |
Line 789 sub get_breadcrumbs{
|
Line 787 sub get_breadcrumbs{
|
} |
} |
|
|
sub chooser { |
sub chooser { |
my ($external,$uploaded,$minimal,$cdom,$cnum,$lonhost,$fields,$values) = @_; |
my ($r,$external,$uploaded,$minimal,$cdom,$cnum,$lonhost,$fields,$values) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'type' => 'Syllabus Type', |
'type' => 'Syllabus Type', |
'url' => 'External URL', |
'url' => 'External URL', |
Line 854 sub chooser {
|
Line 852 sub chooser {
|
'<div id="minimal" class="LC_left_float" style="display: '.$display{'minimal'}.'">'."\n". |
'<div id="minimal" class="LC_left_float" style="display: '.$display{'minimal'}.'">'."\n". |
'<fieldset><legend>'.$lt{'minimal'}.'</legend>'; |
'<fieldset><legend>'.$lt{'minimal'}.'</legend>'; |
if ($minimal) { |
if ($minimal) { |
my ($absurl,$filename,$depbutton) = &syllabus_file_info($minimal,$cnum,$cdom,$lonhost,'minimal'); |
my ($absurl,$filename,$depbutton) = &syllabus_file_info($r,$minimal,$cnum,$cdom,$lonhost,'minimal'); |
$output .= '<a href="javascript:extUrlPreview('."'currminimal'".');">'.$lt{'pr'}.'</a>'. |
$output .= '<a href="javascript:extUrlPreview('."'currminimal'".');">'.$lt{'pr'}.'</a>'. |
'<input type="hidden" name="minimalfile" value="'.&HTML::Entities::encode($absurl).'?inhibitmenu=yes" id="currminimal" />'. |
'<input type="hidden" name="minimalfile" value="'.&HTML::Entities::encode($absurl).'?inhibitmenu=yes" id="currminimal" />'. |
$depbutton; |
$depbutton; |
Line 867 sub chooser {
|
Line 865 sub chooser {
|
'<div id="file" class="LC_left_float" style="display: '.$display{'file'}.'">'."\n". |
'<div id="file" class="LC_left_float" style="display: '.$display{'file'}.'">'."\n". |
'<fieldset><legend>'.$lt{'file'}.'</legend>'; |
'<fieldset><legend>'.$lt{'file'}.'</legend>'; |
if ($uploaded) { |
if ($uploaded) { |
my ($absurl,$filename,$depbutton) = &syllabus_file_info($uploaded,$cnum,$cdom,$lonhost,'file'); |
my ($absurl,$filename,$depbutton) = &syllabus_file_info($r,$uploaded,$cnum,$cdom,$lonhost,'file'); |
$output .= '<span class="LC_nobreak">'.$lt{'curr'}.' '. |
$output .= '<span class="LC_nobreak">'.$lt{'curr'}.' '. |
'<input type="hidden" name="uploadedfile" value="'.&HTML::Entities::encode($absurl).'?inhibitmenu=yes" id="currfile" />'. |
'<input type="hidden" name="uploadedfile" value="'.&HTML::Entities::encode($absurl).'?inhibitmenu=yes" id="currfile" />'. |
'<a href="javascript:extUrlPreview('."'currfile'".');">'.$filename.'</a></span>'.$depbutton. |
'<a href="javascript:extUrlPreview('."'currfile'".');">'.$filename.'</a></span>'.$depbutton. |
Line 902 sub chooser {
|
Line 900 sub chooser {
|
} |
} |
|
|
sub syllabus_file_info { |
sub syllabus_file_info { |
my ($item,$cnum,$cdom,$lonhost,$context) = @_; |
my ($r,$item,$cnum,$cdom,$lonhost,$context) = @_; |
my $hostname = &Apache::lonnet::hostname($lonhost); |
my $hostname = &Apache::lonnet::hostname($lonhost); |
my $protocol = $Apache::lonnet::protocol{$lonhost}; |
my $protocol = $Apache::lonnet::protocol{$lonhost}; |
$protocol = 'http' if ($protocol ne 'https'); |
$protocol = 'http' if ($protocol ne 'https'); |
|
my $alias = &Apache::lonnet::use_proxy_alias($r,$lonhost); |
|
$hostname = $alias if ($alias ne ''); |
my $absurl = $protocol.'://'.$hostname.$item; |
my $absurl = $protocol.'://'.$hostname.$item; |
my ($filename) = ($item =~ m{([^/]+)$}); |
my ($filename) = ($item =~ m{([^/]+)$}); |
my $file=&Apache::lonnet::filelocation("",$item); |
my $file=&Apache::lonnet::filelocation("",$item); |