version 1.1400, 2022/12/31 14:08:58
|
version 1.1407, 2023/06/11 20:45:35
|
Line 1851 sub colorfuleditor_js {
|
Line 1851 sub colorfuleditor_js {
|
if (document.getElementById('crsres_include_'+element)) { |
if (document.getElementById('crsres_include_'+element)) { |
include = document.getElementById('crsres_include_'+element).value; |
include = document.getElementById('crsres_include_'+element).value; |
} |
} |
populateCrsSelects(form,dirsel,filesel,1,include,1,0,1,1); |
populateCrsSelects(form,dirsel,filesel,1,include,1,0,1,1,0); |
} |
} |
} |
} |
if (document.getElementById('chooser_'+element+'_upload')) { |
if (document.getElementById('chooser_'+element+'_upload')) { |
Line 1859 sub colorfuleditor_js {
|
Line 1859 sub colorfuleditor_js {
|
if (currcrsupload == 'none') { |
if (currcrsupload == 'none') { |
dirsel = 'crsauthorpath_'+element; |
dirsel = 'crsauthorpath_'+element; |
filesel = ''; |
filesel = ''; |
populateCrsSelects(form,dirsel,filesel,0,'',1,0,1,0); |
populateCrsSelects(form,dirsel,filesel,0,'',1,0,1,0,1); |
} |
} |
} |
} |
} |
} |
Line 1874 sub colorfuleditor_js {
|
Line 1874 sub colorfuleditor_js {
|
if (document.getElementById('coursepath_'+element).length) { |
if (document.getElementById('coursepath_'+element).length) { |
numdirs = document.getElementById('coursepath_'+element).length; |
numdirs = document.getElementById('coursepath_'+element).length; |
} |
} |
|
if ((document.getElementById('hascrsres_'+element)) && |
|
(document.getElementById('nocrsres_'+element))) { |
|
if (numdirs) { |
|
document.getElementById('hascrsres_'+element).style.display='inline-block'; |
|
document.getElementById('nocrsres_'+element).style.display='none'; |
|
} else { |
|
document.getElementById('hascrsres_'+element).style.display='none'; |
|
document.getElementById('nocrsres_'+element).style.display='inline-block'; |
|
} |
|
} |
form.elements['coursepath_'+element].selectedIndex = 0; |
form.elements['coursepath_'+element].selectedIndex = 0; |
if (numdirs > 1) { |
if (numdirs > 1) { |
var selelem = form.elements['coursefile_'+element]; |
var selelem = form.elements['coursefile_'+element]; |
Line 2266 sub import_crsauthor_form {
|
Line 2276 sub import_crsauthor_form {
|
return (0) unless (($cnum ne '') && ($cdom ne '')); |
return (0) unless (($cnum ne '') && ($cdom ne '')); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my ($output,$is_home,$toppath,%subdirs,%files,%selimport_menus,$include,$exclude); |
my ($output,$is_home,$toppath,%subdirs,%files,%selimport_menus,$include,$exclude); |
|
|
if (grep(/^\Q$crshome\E$/,@ids)) { |
if (grep(/^\Q$crshome\E$/,@ids)) { |
$is_home = 1; |
$is_home = 1; |
} |
} |
Line 2278 sub import_crsauthor_form {
|
Line 2288 sub import_crsauthor_form {
|
$js_only = join(',',map { &js_escape($_); } sort(keys(%{$include}))); |
$js_only = join(',',map { &js_escape($_); } sort(keys(%{$include}))); |
} |
} |
$exclude = &Apache::lonnet::priv_exclude(); |
$exclude = &Apache::lonnet::priv_exclude(); |
&Apache::lonnet::recursedirs($is_home,1,$include,$exclude,1,$toppath,'',\%subdirs,\%files); |
&Apache::lonnet::recursedirs($is_home,1,$include,$exclude,1,0,$toppath,'',\%subdirs,\%files); |
my $numdirs = scalar(keys(%files)); |
my $numdirs = scalar(keys(%files)); |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
fnam => 'Filename', |
fnam => 'Filename', |
dire => 'Directory', |
dire => 'Directory', |
se => 'Select', |
se => 'Select', |
); |
); |
$output = $lt{'dire'}. |
$output = $lt{'dire'}.': '. |
'<select id="'.$firstselectname.'" name="'.$firstselectname.'" '. |
'<select id="'.$firstselectname.'" name="'.$firstselectname.'" '. |
'onchange="populateCrsSelects(this.form,'."'$firstselectname','$secondselectname',1,'$js_only',0,1,0,0".');">'. |
'onchange="populateCrsSelects(this.form,'."'$firstselectname','$secondselectname',1,'$js_only',0,1,0,0,0".');">'. |
'<option value="" selected="selected">'.$lt{'se'}.'</option>'; |
'<option value="" selected="selected">'.$lt{'se'}.'</option>'; |
|
if ($files{'/'}) { |
|
$output .= '<option value="/">/</option>'."\n"; |
|
} |
foreach my $key (sort { lc($a) cmp lc($b) } (keys(%files))) { |
foreach my $key (sort { lc($a) cmp lc($b) } (keys(%files))) { |
|
next if ($key eq '/'); |
$output .= '<option value="'.$key.'">'.$key.'</option>'."\n"; |
$output .= '<option value="'.$key.'">'.$key.'</option>'."\n"; |
} |
} |
$output .= '</select><br />'."\n". |
$output .= '</select><br />'."\n". |
$lt{'fnam'}.'<select id="'.$secondselectname.'" name="'.$secondselectname.'">'."\n". |
$lt{'fnam'}.': <select id="'.$secondselectname.'" name="'.$secondselectname.'">'."\n". |
'<option value="" selected="selected"></option>'."\n". |
'<option value="" selected="selected"></option>'."\n". |
'</select>'."\n"; |
'</select>'."\n". |
$output .= '<input type="hidden" id="crsres_include_'.$suffix.'" value="'.$only.'" />'; |
'<input type="hidden" id="crsres_include_'.$suffix.'" value="'.$only.'" />'; |
return ($numdirs,$output); |
return ($numdirs,$output); |
} |
} |
|
|
Line 2310 sub show_crsfiles_js {
|
Line 2324 sub show_crsfiles_js {
|
my $js = <<"END"; |
my $js = <<"END"; |
|
|
|
|
function populateCrsSelects (form,dirsel,filesel,exc,include,setdir,setfile,recurse,nonemptydir) { |
function populateCrsSelects (form,dirsel,filesel,exc,include,setdir,setfile,recurse,nonemptydir,addtopdir) { |
var relpath = ''; |
var relpath = ''; |
if ((setfile) && (dirsel != null) && (dirsel != 'undefined') && (dirsel != '')) { |
if ((setfile) && (dirsel != null) && (dirsel != 'undefined') && (dirsel != '')) { |
var currdir = form.elements[dirsel].options[form.elements[dirsel].selectedIndex].value; |
var currdir = form.elements[dirsel].options[form.elements[dirsel].selectedIndex].value; |
Line 2340 sub show_crsfiles_js {
|
Line 2354 sub show_crsfiles_js {
|
if (exc) { |
if (exc) { |
exclude = '$exclude'; |
exclude = '$exclude'; |
} |
} |
var params = "role=course&files=1&rec="+recurse+"&nonempty="+nonemptydir+"&exc="+exclude+"&inc="+include+"&path="+relpath; |
var params = "role=course&files=1&rec="+recurse+"&nonempty="+nonemptydir+"&exc="+exclude+"&inc="+include+"&addtop="+addtopdir+"&path="+relpath; |
http.open("POST", url, true); |
http.open("POST", url, true); |
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); |
http.onreadystatechange = function() { |
http.onreadystatechange = function() { |
Line 2358 sub show_crsfiles_js {
|
Line 2372 sub show_crsfiles_js {
|
} |
} |
var len = data.dirs.length; |
var len = data.dirs.length; |
if (len) { |
if (len) { |
if (len > 1) { |
selelem.options[selelem.options.length] = new Option('$se',''); |
selelem.options[selelem.options.length] = new Option('$se',''); |
|
} |
|
} |
|
if (len) { |
|
var j; |
var j; |
for (j = 0; j < len; j++) { |
for (j = 0; j < len; j++) { |
selelem.options[selelem.options.length] = new Option(data.dirs[j],data.dirs[j]); |
selelem.options[selelem.options.length] = new Option(data.dirs[j],data.dirs[j]); |
Line 2771 sub display_filter {
|
Line 2781 sub display_filter {
|
my $onchange = "javascript:toggleHistoryOptions(this,'containingphrase','$context', |
my $onchange = "javascript:toggleHistoryOptions(this,'containingphrase','$context', |
'$secondid','$thirdid')"; |
'$secondid','$thirdid')"; |
return '<span class="LC_nobreak"><label>'.&mt('Records: [_1]', |
return '<span class="LC_nobreak"><label>'.&mt('Records: [_1]', |
&Apache::lonmeta::selectbox('show',$env{'form.show'},undef, |
&Apache::lonmeta::selectbox('show',$env{'form.show'},'',undef, |
(&mt('all'),10,20,50,100,1000,10000))). |
(&mt('all'),10,20,50,100,1000,10000))). |
'</label></span> <span class="LC_nobreak">'. |
'</label></span> <span class="LC_nobreak">'. |
&mt('Filter: [_1]', |
&mt('Filter: [_1]', |
Line 6359 Input: (optional) filename from which br
|
Line 6369 Input: (optional) filename from which br
|
If page header is being requested for use in a frameset, then |
If page header is being requested for use in a frameset, then |
the second (option) argument -- frameset will be true, and |
the second (option) argument -- frameset will be true, and |
the target attribute set for links should be target="_parent". |
the target attribute set for links should be target="_parent". |
|
If $title is supplied as the thitd arg, that will be used to |
|
the left of the breadcrumbs tail for the current path. |
|
|
Returns: HTML div with CSTR path and recent box |
Returns: HTML div with CSTR path and recent box |
To be included on Authoring Space pages |
To be included on Authoring Space pages |
Line 6366 Returns: HTML div with CSTR path and rec
|
Line 6378 Returns: HTML div with CSTR path and rec
|
=cut |
=cut |
|
|
sub CSTR_pageheader { |
sub CSTR_pageheader { |
my ($trailfile,$frameset) = @_; |
my ($trailfile,$frameset,$title) = @_; |
if ($trailfile eq '') { |
if ($trailfile eq '') { |
$trailfile = $env{'request.filename'}; |
$trailfile = $env{'request.filename'}; |
} |
} |
Line 6389 sub CSTR_pageheader {
|
Line 6401 sub CSTR_pageheader {
|
$lastitem = $thisdisfn; |
$lastitem = $thisdisfn; |
} |
} |
|
|
my ($crsauthor,$title); |
my $crsauthor; |
if (($env{'request.course.id'}) && |
if (($env{'request.course.id'}) && |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
($env{'course.'.$env{'request.course.id'}.'.num'} eq $uname) && |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
($env{'course.'.$env{'request.course.id'}.'.domain'} eq $udom)) { |
$crsauthor = 1; |
$crsauthor = 1; |
$title = &mt('Course Authoring Space'); |
if ($title eq '') { |
} else { |
$title = &mt('Course Authoring Space'); |
|
} |
|
} elsif ($title eq '') { |
$title = &mt('Authoring Space'); |
$title = &mt('Authoring Space'); |
} |
} |
|
|
Line 8150 fieldset {
|
Line 8164 fieldset {
|
/* overflow: hidden; */ |
/* overflow: hidden; */ |
} |
} |
|
|
|
fieldset#LC_selectuser { |
|
margin: 0; |
|
padding: 0; |
|
} |
|
|
article.geogebraweb div { |
article.geogebraweb div { |
margin: 0; |
margin: 0; |
} |
} |
Line 9749 sub symb_from_tinyurl {
|
Line 9768 sub symb_from_tinyurl {
|
} |
} |
} |
} |
|
|
|
sub usable_exttools { |
|
my %tooltypes; |
|
if ($env{'request.course.id'}) { |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'}) { |
|
if ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'both') { |
|
%tooltypes = ( |
|
crs => 1, |
|
dom => 1, |
|
); |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'crs') { |
|
$tooltypes{'crs'} = 1; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.exttool'} eq 'dom') { |
|
$tooltypes{'dom'} = 1; |
|
} |
|
} else { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $crstype = lc($env{'course.'.$env{'request.course.id'}.'.type'}); |
|
if ($crstype eq '') { |
|
$crstype = 'course'; |
|
} |
|
if ($crstype eq 'course') { |
|
if ($env{'course.'.$env{'request.course.id'}.'internal.coursecode'}) { |
|
$crstype = 'official'; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.textbook'}) { |
|
$crstype = 'textbook'; |
|
} elsif ($env{'course.'.$env{'request.course.id'}.'.internal.lti'}) { |
|
$crstype = 'lti'; |
|
} else { |
|
$crstype = 'unofficial'; |
|
} |
|
} |
|
my %domdefaults = &Apache::lonnet::get_domain_defaults($cdom); |
|
if ($domdefaults{$crstype.'domexttool'}) { |
|
$tooltypes{'dom'} = 1; |
|
} |
|
if ($domdefaults{$crstype.'exttool'}) { |
|
$tooltypes{'crs'} = 1; |
|
} |
|
} |
|
} |
|
return %tooltypes; |
|
} |
|
|
sub wishlist_window { |
sub wishlist_window { |
return(<<'ENDWISHLIST'); |
return(<<'ENDWISHLIST'); |
<script type="text/javascript"> |
<script type="text/javascript"> |
Line 18599 sub parse_supplemental_title {
|
Line 18662 sub parse_supplemental_title {
|
my $name = &plainname($uname,$udom); |
my $name = &plainname($uname,$udom); |
$name = &HTML::Entities::encode($name,'"<>&\''); |
$name = &HTML::Entities::encode($name,'"<>&\''); |
$renametitle = &HTML::Entities::encode($renametitle,'"<>&\''); |
$renametitle = &HTML::Entities::encode($renametitle,'"<>&\''); |
$title='<i>'.&Apache::lonlocal::locallocaltime($time).'</i> '. |
$title='<i>'.&Apache::lonlocal::locallocaltime($time).'</i> '.$name; |
$name.': <br />'.$foldertitle; |
if ($foldertitle ne '') { |
|
$title .= ': <br />'.$foldertitle; |
|
} |
} |
} |
if (wantarray) { |
if (wantarray) { |
return ($title,$foldertitle,$renametitle); |
return ($title,$foldertitle,$renametitle); |