version 1.8, 2013/11/13 01:40:07
|
version 1.14, 2016/10/16 21:49:51
|
Line 75 select items. Checking a folder causes
|
Line 75 select items. Checking a folder causes
|
within the folder. Unchecking a resource causing unchecking of folders |
within the folder. Unchecking a resource causing unchecking of folders |
containing the item back up to the top level. |
containing the item back up to the top level. |
|
|
Inputs: 9. |
Inputs: 11. |
- $navmap -- Reference to LON-CAPA navmap object |
- $navmap -- Reference to LON-CAPA navmap object |
(encapsulates information about resources in the course). |
(encapsulates information about resources in the course). |
|
|
Line 106 Inputs: 9.
|
Line 106 Inputs: 9.
|
|
|
- $uploadedfiles -- Reference to hash: keys are paths to files in |
- $uploadedfiles -- Reference to hash: keys are paths to files in |
/home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles. |
/home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles. |
|
|
|
- $readonly -- if true, no "check all" or "uncheck all" buttons will |
|
be displayed, and checkboxes will be disabled, if this |
|
is for an exam block. |
|
|
|
|
Output: $output is the HTML mark-up for display/selection of content |
Output: $output is the HTML mark-up for display/selection of content |
Line 151 Inputs: 2.
|
Line 155 Inputs: 2.
|
|
|
Takes incoming title and replaces non-alphanumeric characters with underscore, |
Takes incoming title and replaces non-alphanumeric characters with underscore, |
so title can be used as suggested file name (with appended extension) for file |
so title can be used as suggested file name (with appended extension) for file |
copied from course to Authoring space. |
copied from course to Authoring Space. |
|
|
|
|
=item &enumerate_course_contents() |
=item &enumerate_course_contents() |
Line 162 map url, or symb, for an iteration throu
|
Line 166 map url, or symb, for an iteration throu
|
a Course Coordinator. Used to generate numerical IDs to facilitate |
a Course Coordinator. Used to generate numerical IDs to facilitate |
(a) storage of lists of maps or resources to be blocked during an exam, |
(a) storage of lists of maps or resources to be blocked during an exam, |
(b) processing selected form element during dumping of selected course |
(b) processing selected form element during dumping of selected course |
content to Authoring space. |
content to Authoring Space. |
|
|
Inputs: 7 |
Inputs: 7 |
|
|
Line 206 use Apache::lonlocal;
|
Line 210 use Apache::lonlocal;
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub create_picker { |
sub create_picker { |
my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,$numhome,$uploadedfiles) = @_; |
my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble, |
|
$numhome,$uploadedfiles,$readonly) = @_; |
return unless (ref($navmap)); |
return unless (ref($navmap)); |
my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files); |
my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files); |
$it = $navmap->getIterator(undef,undef,undef,1,undef,undef); |
$it = $navmap->getIterator(undef,undef,undef,1,undef,undef); |
Line 236 sub create_picker {
|
Line 241 sub create_picker {
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crsprefix = &propath($cdom,$cnum).'/userfiles/'; |
my $crsprefix = &propath($cdom,$cnum).'/userfiles/'; |
|
|
my ($info,$display,$onsubmit,$togglebuttons); |
my ($info,$display,$onsubmit,$togglebuttons,$disabled); |
if ($context eq 'examblock') { |
if ($context eq 'examblock') { |
my $maps_elem = 'docs_maps_'.$block; |
my $maps_elem = 'docs_maps_'.$block; |
my $res_elem = 'docs_resources_'.$block; |
my $res_elem = 'docs_resources_'.$block; |
$onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"'; |
$onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"'; |
$info = &mt('Items in '.lc($crstype).' for which access will be blocked.'); |
$info = &mt('Items in '.lc($crstype).' for which access will be blocked.'); |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
} |
} |
if ($context eq 'dumpdocs') { |
if ($context eq 'dumpdocs') { |
$info = '<span class="LC_fontsize_medium">'. |
$info = '<span class="LC_fontsize_medium">'. |
&mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring space.'). |
&mt('Choose the uploaded course items and templated pages/problems to be copied to Authoring Space.'). |
'</span><br /><br />'; |
'</span><br /><br />'; |
$startcount = 3 + $numhome; |
$startcount = 3 + $numhome; |
$onsubmit = ' onsubmit="return checkUnique(document.'.$formname.',document.'.$formname.'.archive);"'; |
$onsubmit = ' onsubmit="return checkUnique(document.'.$formname.',document.'.$formname.'.archive);"'; |
Line 253 sub create_picker {
|
Line 261 sub create_picker {
|
$info = &mt('Choose which items you wish to export from your '.$crstype.'.'); |
$info = &mt('Choose which items you wish to export from your '.$crstype.'.'); |
$startcount = 5; |
$startcount = 5; |
} |
} |
$togglebuttons = '<input type="button" value="'.&mt('check all').'" '. |
if ($disabled) { |
'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'. |
$togglebuttons = '<br />'; |
' <input type="button" value="'.&mt('uncheck all').'"'. |
} else { |
' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />'; |
$togglebuttons = '<input type="button" value="'.&mt('check all').'" '. |
|
'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'. |
|
' <input type="button" value="'.&mt('uncheck all').'"'. |
|
' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />'; |
|
} |
$display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n"; |
$display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n"; |
if ($context eq 'imsexport') { |
if ($context eq 'imsexport') { |
$display .= $info. |
$display .= $info. |
Line 353 sub create_picker {
|
Line 365 sub create_picker {
|
$display .= 'checked="checked"'; |
$display .= 'checked="checked"'; |
} |
} |
} |
} |
$display .= ' />'."\n"; |
$display .= $disabled.' />'."\n"; |
if ($context eq 'dumpdocs') { |
if ($context eq 'dumpdocs') { |
$display .= '</td><td valign="top">'; |
$display .= '</td><td valign="top">'; |
} |
} |
Line 450 sub create_picker {
|
Line 462 sub create_picker {
|
&mt('Export').'" /></p>'; |
&mt('Export').'" /></p>'; |
$numcount = $count + $boards + $startcount; |
$numcount = $count + $boards + $startcount; |
} elsif ($context eq 'examblock') { |
} elsif ($context eq 'examblock') { |
$display .= |
unless ($readonly) { |
'<p>'. |
$display .= |
'<input type="submit" name="resourceblocks" value="'. |
'<p>'. |
&mt('Copy Choices to Main Window').'" /></p>'; |
'<input type="submit" name="resourceblocks" value="'. |
|
&mt('Copy Choices to Main Window').'" /></p>'; |
|
} |
$numcount = $count + $startcount; |
$numcount = $count + $startcount; |
} elsif ($context eq 'dumpdocs') { |
} elsif ($context eq 'dumpdocs') { |
$display .= '</fieldset>'. |
$display .= '</fieldset>'. |
Line 466 sub create_picker {
|
Line 480 sub create_picker {
|
$display .= '</form>'; |
$display .= '</form>'; |
my $scripttag = |
my $scripttag = |
&respicker_javascript($startcount,$numcount,$context,$formname,\%children, |
&respicker_javascript($startcount,$numcount,$context,$formname,\%children, |
\%hierarchy,\@checked_maps); |
\%hierarchy,\@checked_maps,$numhome); |
if ($context eq 'dumpdocs') { |
if ($context eq 'dumpdocs') { |
return $scripttag.$display; |
return $scripttag.$display; |
} |
} |
Line 498 sub create_picker {
|
Line 512 sub create_picker {
|
|
|
sub respicker_javascript { |
sub respicker_javascript { |
my ($startcount,$numitems,$context,$formname,$children,$hierarchy, |
my ($startcount,$numitems,$context,$formname,$children,$hierarchy, |
$checked_maps) = @_; |
$checked_maps,$numhome) = @_; |
return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH') |
return unless ((ref($children) eq 'HASH') && (ref($hierarchy) eq 'HASH') |
&& (ref($checked_maps) eq 'ARRAY')); |
&& (ref($checked_maps) eq 'ARRAY')); |
my ($elem,$nested,$nameforelem); |
my ($elem,$nested,$nameforelem); |
Line 591 EXTRA
|
Line 605 EXTRA
|
} elsif ($context eq 'dumpdocs') { |
} elsif ($context eq 'dumpdocs') { |
my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.'); |
my $blankmsg = &mt('An item selected has no filename set in the "Save as ..." column.'); |
my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.'); |
my $dupmsg = &mt('Items selected for copying need unique filenames in the "Save as ..." column.'); |
|
my $homemsg = &mt('An Authoring Space needs to be selected.'); |
|
&js_escape(\$blankmsg); |
|
&js_escape(\$dupmsg); |
|
&js_escape(\$homemsg); |
$scripttag .= <<"EXTRA"; |
$scripttag .= <<"EXTRA"; |
|
|
function checkUnique(form,field) { |
function checkUnique(form,field) { |
var duplicate = 0; |
var duplicate = 0; |
var blank = 0; |
var blank = 0; |
|
var numhome = '$numhome'; |
if (field.length > 0) { |
if (field.length > 0) { |
for (i=0; i<field.length; i++) { |
for (i=0; i<field.length; i++) { |
if (field[i].checked) { |
if (field[i].checked) { |
Line 635 function checkUnique(form,field) {
|
Line 654 function checkUnique(form,field) {
|
alert('$dupmsg'); |
alert('$dupmsg'); |
return false; |
return false; |
} |
} |
|
if (numhome > 1) { |
|
if (!form.authorspace.options[form.authorspace.selectedIndex].value) { |
|
alert('$homemsg'); |
|
return false; |
|
} |
|
} |
return true; |
return true; |
} |
} |
|
|
Line 685 function writeToOpener(maps,resources) {
|
Line 710 function writeToOpener(maps,resources) {
|
} |
} |
} |
} |
if (isResource == 1) { |
if (isResource == 1) { |
if (nesting[elemnum].length > 0) { |
if (nesting[elemnum] != null) { |
var lastelem = nesting[elemnum].length-1; |
if (nesting[elemnum].length > 0) { |
if (document.$formname.elements[nesting[elemnum][lastelem]].checked) { |
var lastelem = nesting[elemnum].length-1; |
include = 0; |
if (document.$formname.elements[nesting[elemnum][lastelem]].checked) { |
|
include = 0; |
|
} |
} |
} |
} |
} |
} |
} |
Line 730 sub get_navmap_object {
|
Line 757 sub get_navmap_object {
|
undef,{'only_body' => 1,}). |
undef,{'only_body' => 1,}). |
'<h2>'.&mt('Resource Display Failed').'</h2>'; |
'<h2>'.&mt('Resource Display Failed').'</h2>'; |
} elsif ($context eq 'dumpdocs') { |
} elsif ($context eq 'dumpdocs') { |
$outcome = '<h2>'.&mt('Copying to Authoring Space unavilable'); |
$outcome = '<h2>'.&mt('Copying to Authoring Space unavailable'); |
} |
} |
$outcome .= '<div class="LC_error">'; |
$outcome .= '<div class="LC_error">'; |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |