version 1.621, 2017/02/18 23:39:15
|
version 1.622, 2017/02/20 18:29:22
|
Line 920 sub docs_change_log {
|
Line 920 sub docs_change_log {
|
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
&Apache::loncommon::display_filter_js('docslog')."\n". |
&Apache::loncommon::display_filter_js('docslog')."\n". |
&editing_js($env{'user.domain'},$env{'user.name'},$supplementalflag, |
&editing_js($env{'user.domain'},$env{'user.name'},$supplementalflag, |
$coursedom,$coursenum,'','',$canedit,\$navmap)."\n". |
$coursedom,$coursenum,'','',$canedit,'',\$navmap)."\n". |
&history_tab_js()."\n". |
&history_tab_js()."\n". |
&Apache::lonratedt::editscript('simple')."\n". |
&Apache::lonratedt::editscript('simple')."\n". |
'// ]]>'."\n". |
'// ]]>'."\n". |
Line 3009 sub handle_edit_cmd {
|
Line 3009 sub handle_edit_cmd {
|
sub editor { |
sub editor { |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
my ($r,$coursenum,$coursedom,$folder,$allowed,$upload_output,$crstype, |
$supplementalflag,$orderhash,$iconpath,$pathitem,$ltitoolsref, |
$supplementalflag,$orderhash,$iconpath,$pathitem,$ltitoolsref, |
$canedit,$navmapref,$hiddentop)=@_; |
$canedit,$hostname,$navmapref,$hiddentop)=@_; |
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order,$container); |
my ($randompick,$ishidden,$isencrypted,$plain,$is_random_order,$container); |
if ($allowed) { |
if ($allowed) { |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain, |
(my $breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain, |
Line 3340 sub editor {
|
Line 3340 sub editor {
|
$coursenum,$coursedom,$crstype, |
$coursenum,$coursedom,$crstype, |
$pathitem,$supplementalflag,$container, |
$pathitem,$supplementalflag,$container, |
\%filters,\%curr_groups,$ltitoolsref,$canedit, |
\%filters,\%curr_groups,$ltitoolsref,$canedit, |
$isencrypted,$navmapref); |
$isencrypted,$navmapref,$hostname); |
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
Line 3721 sub is_supplemental_title {
|
Line 3721 sub is_supplemental_title {
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, |
$ltitoolsref,$canedit,$isencrypted,$navmapref)=@_; |
$ltitoolsref,$canedit,$isencrypted,$navmapref,$hostname)=@_; |
my ($foldertitle,$renametitle,$oldtitle); |
my ($foldertitle,$renametitle,$oldtitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
Line 4064 END
|
Line 4064 END
|
} elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { |
} elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { |
if (($ENV{'SERVER_PORT'} == 443) && |
if (($ENV{'SERVER_PORT'} == 443) && |
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
if ($hostname ne '') { |
|
$url = 'http://'.$hostname.$url; |
|
} |
$url .= (($url =~ /\?/) ? '&':'?').'usehttp=1'; |
$url .= (($url =~ /\?/) ? '&':'?').'usehttp=1'; |
$nomodal = 1; |
$nomodal = 1; |
} |
} |
Line 4200 $form_end;
|
Line 4203 $form_end;
|
$forceedit, |
$forceedit, |
undef,$symb, |
undef,$symb, |
&escape($env{'form.folderpath'}), |
&escape($env{'form.folderpath'}), |
$renametitle,'','',1,$suppanchor); |
$renametitle,$hostname, |
|
'','',1,$suppanchor); |
if ($jscall) { |
if ($jscall) { |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$editlink = '<a class="LC_docs_ext_edit" href="javascript:'. |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
$jscall.'" >'.&mt('Edit').'</a> '."\n"; |
Line 4228 $form_end;
|
Line 4232 $form_end;
|
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
$anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); |
} |
} |
} |
} |
$link = &js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
if ((!$supplementalflag) && ($nomodal) && ($hostname ne '')) { |
|
$link = 'http://'.$hostname.$url; |
|
} else { |
|
$link = $url; |
|
} |
|
$link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. |
(($anchor ne '')?$anchor:'')); |
(($anchor ne '')?$anchor:'')); |
if ($nomodal) { |
if ($nomodal) { |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
Line 5370 sub handler {
|
Line 5379 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 $hostname = $r->hostname(); |
$script .= &editing_js($udom,$uname,$supplementalflag,$coursedom,$coursenum,$posslti, |
$script .= &editing_js($udom,$uname,$supplementalflag,$coursedom,$coursenum,$posslti, |
$londocroot,$canedit,\$navmap). |
$londocroot,$canedit,$hostname,\$navmap). |
&history_tab_js(). |
&history_tab_js(). |
&inject_data_js(). |
&inject_data_js(). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
Line 5773 HIDDENFORM
|
Line 5783 HIDDENFORM
|
} |
} |
|
|
# |
# |
|
my $hostname = $r->hostname(); |
my $savefolderpath; |
my $savefolderpath; |
|
|
if ($allowed) { |
if ($allowed) { |
Line 6243 unless ($container eq 'page') {
|
Line 6253 unless ($container eq 'page') {
|
unless (($supplementalflag || $toolsflag)) { |
unless (($supplementalflag || $toolsflag)) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%orderhash,$iconpath,$pathitem, |
$supplementalflag,\%orderhash,$iconpath,$pathitem, |
\%ltitools,$canedit,\$navmap,$hiddentop); |
\%ltitools,$canedit,$hostname,\$navmap,$hiddentop); |
undef($navmap); |
undef($navmap); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
Line 6392 my %suporderhash = (
|
Line 6402 my %suporderhash = (
|
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%suporderhash,$iconpath,$pathitem, |
$supplementalflag,\%suporderhash,$iconpath,$pathitem, |
\%ltitools,$canedit); |
\%ltitools,$canedit,$hostname); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} else { |
} else { |
Line 6412 my %suporderhash = (
|
Line 6422 my %suporderhash = (
|
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,'',$iconpath,$pathitem); |
$supplementalflag,'',$iconpath,$pathitem,'','',$hostname); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
Line 6786 END
|
Line 6796 END
|
} |
} |
|
|
sub editing_js { |
sub editing_js { |
my ($udom,$uname,$supplementalflag,$coursedom,$coursenum,$posslti,$londocroot,$canedit,$navmapref) = @_; |
my ($udom,$uname,$supplementalflag,$coursedom,$coursenum,$posslti, |
|
$londocroot,$canedit,$hostname,$navmapref) = @_; |
my %js_lt = &Apache::lonlocal::texthash( |
my %js_lt = &Apache::lonlocal::texthash( |
p_mnf => 'Name of New Folder', |
p_mnf => 'Name of New Folder', |
t_mnf => 'New Folder', |
t_mnf => 'New Folder', |
Line 6863 sub editing_js {
|
Line 6874 sub editing_js {
|
} |
} |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='. |
$backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='. |
&HTML::Entities::encode($caller,'<>&"'); |
&HTML::Entities::encode($caller,'<>&"'); |
|
if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { |
|
if (($ENV{'SERVER_PORT'} == 443) && |
|
($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { |
|
if ($hostname ne '') { |
|
$backtourl = 'http://'.$hostname.$backtourl; |
|
} |
|
$backtourl .= (($backtourl =~ /\?/) ? '&':'?').'usehttp=1'; |
|
} |
|
} |
if ($anchor ne '') { |
if ($anchor ne '') { |
$backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"'); |
$backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"'); |
} |
} |