version 1.325, 2008/12/19 18:57:43
|
version 1.325.2.5, 2010/01/22 01:23:34
|
Line 145 sub dumpcourse {
|
Line 145 sub dumpcourse {
|
my ($r) = @_; |
my ($r) = @_; |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
$r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space'). |
$r->print(&Apache::loncommon::start_page('Dump '.$type.' DOCS to Construction Space'). |
'<form name="dumpdoc" method="post">'); |
'<form name="dumpdoc" action="" method="post">'); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$type.' DOCS to Construction Space')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Dump '.$type.' DOCS to Construction Space')); |
my ($home,$other,%outhash)=&authorhosts(); |
my ($home,$other,%outhash)=&authorhosts(); |
unless ($home) { return ''; } |
unless ($home) { return ''; } |
Line 265 sub dumpcourse {
|
Line 265 sub dumpcourse {
|
|
|
sub exportbutton { |
sub exportbutton { |
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
return '<div>'. |
return '<input type="submit" name="exportcourse"' |
'<input type="submit" name="exportcourse" value="'. |
.' value="'.&mt('IMS Export').'"' |
&mt('Export '.$type.' to IMS').'" />'. |
.' title="'.&mt('Export '.$type.' to IMS Package').'" />'. |
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'</div>'; |
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />'; |
} |
} |
|
|
|
|
Line 281 sub exportcourse {
|
Line 281 sub exportcourse {
|
my $numdisc = keys(%discussiontime); |
my $numdisc = keys(%discussiontime); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
if (!defined($navmap)) { |
if (!defined($navmap)) { |
$r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package'). |
$r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package'). |
'<h2>IMS Export Failed</h2>'. |
'<h2>'.&mt('IMS Export Failed').'</h2>'. |
'<div class="LC_error">'. |
'<div class="LC_error">'); |
&mt('Unable to retrieve information about course contents'). |
if ($crstype eq 'Community') { |
'</div><a href="/adm/coursedocs">'.&mt('Return to Course Editor').'</a>'); |
$r->print(&mt('Unable to retrieve information about community contents')); |
&Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($type).':'.$env{'request.course.id'}); |
} else { |
|
$r->print(&mt('Unable to retrieve information about course contents')); |
|
} |
|
$r->print('</div><a href="/adm/coursedocs">'); |
|
if ($crstype eq 'Community') { |
|
$r->print(&mt('Return to Community Editor')); |
|
} else { |
|
$r->print(&mt('Return to Course Editor')); |
|
} |
|
$r->print('</a>'); |
|
&Apache::lonnet::logthis('IMS export failed - could not create navmap object in '.lc($crstype).':'.$env{'request.course.id'}); |
return; |
return; |
} |
} |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
Line 302 sub exportcourse {
|
Line 312 sub exportcourse {
|
my @exportitems = &Apache::loncommon::get_env_multiple('form.archive'); |
my @exportitems = &Apache::loncommon::get_env_multiple('form.archive'); |
my @discussions = &Apache::loncommon::get_env_multiple('form.discussion'); |
my @discussions = &Apache::loncommon::get_env_multiple('form.discussion'); |
if (@exportitems == 0 && @discussions == 0) { |
if (@exportitems == 0 && @discussions == 0) { |
$outcome = '<br />As you did not select any content items or discussions for export, an IMS package has not been created. Please <a href="javascript:history.go(-1)">go back</a> to select either content items or discussions for export'; |
$outcome = |
|
'<p class="LC_warning">' |
|
.&mt('As you did not select any content items or discussions' |
|
.' for export, an IMS package has not been created.') |
|
.'</p>' |
|
.'<p>' |
|
.&mt('Please [_1]go back[_2] to select either content items' |
|
.' or discussions for export.' |
|
,'<a href="javascript:history.go(-1)">' |
|
,'</a>') |
|
.'</p>'; |
} else { |
} else { |
my $now = time; |
my $now = time; |
my %symbs; |
my %symbs; |
Line 325 sub exportcourse {
|
Line 345 sub exportcourse {
|
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); |
close(OUTPUT); |
close(OUTPUT); |
chdir $cwd; |
chdir $cwd; |
$outcome .= &mt('Download the zip file from <a href="[_1]">IMS '.lc($type).' archive</a><br />',$imszipfile,); |
$outcome .= '<p>' |
|
.&mt('[_1]Your IMS package[_2] is ready for download.' |
|
,'<a href="'.$imszipfile.'">','</a>') |
|
.'</p>'; |
if ($copyresult) { |
if ($copyresult) { |
$outcome .= &mt('The following errors occurred during export - [_1]',$copyresult); |
$outcome .= '<p class="LC_error">' |
|
.&mt('The following errors occurred during export - [_1]' |
|
,$copyresult) |
|
.'</p>'; |
} |
} |
} else { |
} else { |
$outcome = '<br />'.&mt('Unfortunately you will not be able to retrieve an IMS archive of this posts at this time, because there was a problem creating a manifest file.').'<br />'; |
$outcome = '<p class="LC_error">' |
|
.&mt('Unfortunately you will not be able to retrieve' |
|
.' an IMS archive of this posts at this time,' |
|
.' because there was a problem creating a' |
|
.' manifest file.') |
|
.'</p>' |
|
.'<p><a href="javascript:history.go(-1)">' |
|
.&mt('Go Back') |
|
.'</a></p>'; |
} |
} |
} |
} |
$r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package')); |
$r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('IMS Export')); |
$r->print($outcome); |
$r->print($outcome); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} else { |
} else { |
my $display; |
my $display='<form name="exportdoc" action="" method="post">'."\n". |
$display = '<form name="exportdoc" method="post">'."\n"; |
'<p>'. |
$display .= &mt('Choose which items you wish to export from your '.$type.'.<br /><br />'); |
&mt('Choose which items you wish to export from your '.$crstype.'.'). |
$display .= '<table border="0" cellspacing="0" cellpadding="3">'. |
'</p>'. |
'<tr><td><fieldset><legend> <b>Content items</b></legend>'. |
'<div class="LC_columnSection"><fieldset>'. |
'<input type="button" value="check all" '. |
'<legend>'.&mt('Content items').'</legend>'. |
|
'<input type="button" value="'.&mt('check all').'" '. |
'onclick="javascript:checkAll(document.exportdoc.archive)" />'. |
'onclick="javascript:checkAll(document.exportdoc.archive)" />'. |
' <input type="button" value="uncheck all"'. |
' <input type="button" value="'.&mt('uncheck all').'"'. |
' onclick="javascript:uncheckAll(document.exportdoc.archive)" /></fieldset></td>'. |
' onclick="javascript:uncheckAll(document.exportdoc.archive)" /></fieldset>'; |
'<td> </td><td> </td>'. |
if ($numdisc > 0) { |
'<td align="right"><fieldset><legend> <b>Discussion posts'. |
$display .= '<fieldset>'. |
'</b></legend><input type="button" value="check all"'. |
'<legend>'.&mt('Discussion posts').'</legend>'. |
' onclick="javascript:checkAll(document.exportdoc.discussion)" />'. |
'<input type="button" value="'.&mt('check all').'"'. |
' <input type="button" value="uncheck all"'. |
' onclick="javascript:checkAll(document.exportdoc.discussion)" />'. |
' onclick="javascript:uncheckAll(document.exportdoc.discussion)" /></fieldset></td>'. |
' <input type="button" value="'.&mt('uncheck all').'"'. |
'</tr></table>'; |
' onclick="javascript:uncheckAll(document.exportdoc.discussion)" />'. |
|
'</fieldset>'; |
|
} |
|
$display .= '</div>'; |
my $curRes; |
my $curRes; |
my $depth = 0; |
my $depth = 0; |
my $count = 0; |
my $count = 0; |
Line 362 sub exportcourse {
|
Line 400 sub exportcourse {
|
my %parent = (); |
my %parent = (); |
my %children = (); |
my %children = (); |
my $lastcontainer = $startcount; |
my $lastcontainer = $startcount; |
my @bgcolors = ('#F6F6F6','#FFFFFF'); |
$display .= &Apache::loncommon::start_data_table() |
$display .= '<table cellspacing="0"><tr>'. |
.&Apache::loncommon::start_data_table_header_row() |
'<td><b>Export content item?<br /></b></td><td> </td><td align="right">'."\n"; |
.'<th>'.&mt('Export content item?').'</th>'; |
if ($numdisc > 0) { |
if ($numdisc > 0) { |
$display.='<b>Export discussion posts?</b>'."\n"; |
$display .= '<th>'.&mt('Export discussion posts?').'</th>'; |
} |
} |
$display.=' </td></tr>'; |
$display .= &Apache::loncommon::end_data_table_header_row(); |
while ($curRes = $it->next()) { |
while ($curRes = $it->next()) { |
if (ref($curRes)) { |
if (ref($curRes)) { |
$count ++; |
$count ++; |
Line 389 sub exportcourse {
|
Line 427 sub exportcourse {
|
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard'; |
} |
} |
} |
} |
my $color = $count%2; |
my $currelem = $count+$boards+$startcount; |
$display .='<tr bgcolor='.$bgcolors[$color].'><td>'."\n". |
$display .= &Apache::loncommon::start_data_table_row() |
'<input type="checkbox" name="archive" value="'.$count.'" '; |
.'<td>'."\n" |
|
.'<input type="checkbox" name="archive" value="'.$count.'" '; |
if (($curRes->is_sequence()) || ($curRes->is_page())) { |
if (($curRes->is_sequence()) || ($curRes->is_page())) { |
my $checkitem = $count + $boards + $startcount; |
$lastcontainer = $currelem; |
$display .= 'onClick="javascript:propagateCheck('."'$checkitem'".')"'; |
$display .= 'onclick="javascript:propagateCheck('."'$currelem'".')"'; |
} |
} |
$display .= ' />'."\n"; |
$display .= ' />'."\n"; |
for (my $i=0; $i<$depth; $i++) { |
for (my $i=0; $i<$depth; $i++) { |
$display .= '<img src="/adm/lonIcons/whitespace1.gif" class="LC_docs_spacer" /><img src="/adm/lonIcons/whitespace1.gif" class="LC_docs_spacer" />'."\n"; |
$display .= ('<img src="/adm/lonIcons/whitespace1.gif" class="LC_docs_spacer" />' x2)."\n"; |
} |
} |
if ($curRes->is_sequence()) { |
if ($curRes->is_sequence()) { |
$display .= '<img src="/adm/lonIcons/navmap.folder.open.gif"> '."\n"; |
$display .= '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" /> '."\n"; |
$lastcontainer = $count + $startcount + $boards; |
|
} elsif ($curRes->is_page()) { |
} elsif ($curRes->is_page()) { |
$display .= '<img src="/adm/lonIcons/navmap.page.open.gif"> '."\n"; |
$display .= '<img src="/adm/lonIcons/navmap.page.open.gif" alt="" /> '."\n"; |
$lastcontainer = $count + $startcount + $boards; |
|
} |
} |
my $currelem = $count+$boards+$startcount; |
|
$children{$parent{$depth}} .= $currelem.':'; |
$children{$parent{$depth}} .= $currelem.':'; |
$display .= ' '.$curRes->title().'</td>'; |
$display .= ' '.$curRes->title().'</td>'."\n"; |
|
|
|
# Existing discussion posts? |
|
|
if ($discussiontime{$ressymb} > 0) { |
if ($discussiontime{$ressymb} > 0) { |
$boards ++; |
$boards ++; |
$currelem = $count+$boards+$startcount; |
$display .= '<td align="right">' |
$display .= '<td> </td><td align="right"><input type="checkbox" name="discussion" value="'.$count.'" /> </td>'."\n"; |
.'<input type="checkbox" name="discussion" value="'.$count.'" />' |
|
.'</td>'."\n"; |
} else { |
} else { |
$display .= '<td colspan="2"> </td>'."\n"; |
$display .= '<td> </td>'."\n"; |
} |
} |
|
$display .= &Apache::loncommon::end_data_table_row(); |
} |
} |
} |
} |
|
$display .= &Apache::loncommon::end_data_table(); |
my $scripttag = qq| |
my $scripttag = qq| |
<script> |
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
function checkAll(field) { |
function checkAll(field) { |
if (field.length > 0) { |
if (field.length > 0) { |
Line 472 function containerCheck(item) {
|
Line 515 function containerCheck(item) {
|
} |
} |
} |
} |
|
|
|
// ]]> |
</script> |
</script> |
|; |
|; |
$r->print(&Apache::loncommon::start_page('Export '.lc($type).' to IMS content package', |
$r->print(&Apache::loncommon::start_page('Export '.$type.' to IMS Package', |
$scripttag)); |
$scripttag)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Export '.lc($type).' to IMS content package')); |
$r->print($display.'</table>'. |
$r->print($display. |
'<p><input type="hidden" name="finishexport" value="1">'. |
'<p><input type="hidden" name="finishexport" value="1" />'. |
'<input type="submit" name="exportcourse" value="'. |
'<input type="submit" name="exportcourse" value="'. |
&mt('Export '.$type.' DOCS').'" /></p></form>'); |
&mt('Export').'" /></p></form>'); |
} |
} |
} |
} |
|
|
Line 507 sub create_ims_store {
|
Line 551 sub create_ims_store {
|
my $manifestfilename = $$tempexport.$manifest; |
my $manifestfilename = $$tempexport.$manifest; |
if ($ims_manifest = Apache::File->new('>'.$manifestfilename)) { |
if ($ims_manifest = Apache::File->new('>'.$manifestfilename)) { |
$$manifestok=1; |
$$manifestok=1; |
print $ims_manifest |
print $ims_manifest |
'<?xml version="1.0" encoding="UTF-8"?>'."\n". |
'<?xml version="1.0" encoding="UTF-8"?>'."\n". |
'<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"'. |
'<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"'. |
' xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2"'. |
' xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2"'. |
Line 1227 sub update_paste_buffer {
|
Line 1271 sub update_paste_buffer {
|
&Apache::lonnet::appenv({'docs.markedcopy_supplemental' => $title}); |
&Apache::lonnet::appenv({'docs.markedcopy_supplemental' => $title}); |
($title) = &parse_supplemental_title($title); |
($title) = &parse_supplemental_title($title); |
} elsif ($env{'docs.markedcopy_supplemental'}) { |
} elsif ($env{'docs.markedcopy_supplemental'}) { |
&Apache::lonnet::delenv('docs\\.markedcopy_supplemental'); |
&Apache::lonnet::delenv('docs.markedcopy_supplemental'); |
} |
} |
$url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{http(:|:)//https(:|:)//}{https$2//}; |
|
|
Line 1331 sub do_paste_from_buffer {
|
Line 1375 sub do_paste_from_buffer {
|
} |
} |
# published maps can only exists once, so remove it from paste buffer when done |
# published maps can only exists once, so remove it from paste buffer when done |
if (($url=~/\.(page|sequence)$/) && ($url=~m {^/res/})) { |
if (($url=~/\.(page|sequence)$/) && ($url=~m {^/res/})) { |
&Apache::lonnet::delenv('docs\\.markedcopy'); |
&Apache::lonnet::delenv('docs.markedcopy'); |
} |
} |
if ($url=~ m{/smppg$}) { |
if ($url=~ m{/smppg$}) { |
my $db_name = &Apache::lonsimplepage::get_db_name($url); |
my $db_name = &Apache::lonsimplepage::get_db_name($url); |
Line 1653 sub process_file_upload {
|
Line 1697 sub process_file_upload {
|
return 'failed'; |
return 'failed'; |
} else { |
} else { |
if ($parseaction eq 'parse') { |
if ($parseaction eq 'parse') { |
my $total_embedded = keys(%{$allfiles}); |
my $total_embedded = scalar(keys(%{$allfiles})); |
if ($total_embedded > 0) { |
if ($total_embedded > 0) { |
my $num = 0; |
my $num = 0; |
my $state = ' |
my $state = ' |
Line 1779 sub entryline {
|
Line 1823 sub entryline {
|
'<select name="newpos" onChange="this.form.submit()">'; |
'<select name="newpos" onChange="this.form.submit()">'; |
for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) { |
for (my $i=1;$i<=$#LONCAPA::map::order+1;$i++) { |
if ($i==$incindex) { |
if ($i==$incindex) { |
$selectbox.='<option value="" selected="1">('.$i.')</option>'; |
$selectbox.='<option value="" selected="selected">('.$i.')</option>'; |
} else { |
} else { |
$selectbox.='<option value="'.$i.'">'.$i.'</option>'; |
$selectbox.='<option value="'.$i.'">'.$i.'</option>'; |
} |
} |
Line 1903 END
|
Line 1947 END
|
} |
} |
|
|
my $orig_url = $url; |
my $orig_url = $url; |
|
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
my $external = ($url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}); |
if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) { |
if ((!$isfolder) && ($residx) && ($folder!~/supplemental/) && (!$ispage)) { |
my $symb=&Apache::lonnet::symbclean( |
my $symb=&Apache::lonnet::symbclean( |
Line 1965 END
|
Line 2010 END
|
my $ro_set= |
my $ro_set= |
((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':''); |
((&LONCAPA::map::getparameter($orderidx,'parameter_randomorder'))[0]=~/^yes$/i?' checked="checked"':''); |
$rand_order_text =' |
$rand_order_text =' |
<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" onClick="this.form.changeparms.value=\'randomorder\';this.form.submit()" '.$ro_set.' /> '.&mt('Random Order').' </label></span>'; |
<span class="LC_nobreak"><label><input type="checkbox" name="randomorder_'.$orderidx.'" onclick="this.form.changeparms.value=\'randomorder\';this.form.submit()" '.$ro_set.' /> '.&mt('Random Order').' </label></span>'; |
} |
} |
if ($ispage) { |
if ($ispage) { |
my $pagename=&escape($pagetitle); |
my $pagename=&escape($pagetitle); |
Line 2003 END
|
Line 2048 END
|
'hd' => 'Hidden', |
'hd' => 'Hidden', |
'ec' => 'URL hidden'); |
'ec' => 'URL hidden'); |
my $enctext= |
my $enctext= |
((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="1"':''); |
((&LONCAPA::map::getparameter($orderidx,'parameter_encrypturl'))[0]=~/^yes$/i?' checked="checked"':''); |
my $hidtext= |
my $hidtext= |
((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="1"':''); |
((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i?' checked="checked"':''); |
$line.=(<<ENDPARMS); |
$line.=(<<ENDPARMS); |
<td class="LC_docs_entry_parameter"> |
<td class="LC_docs_entry_parameter"> |
$form_start |
$form_start |
<label><input type="checkbox" name="hiddenresource_$orderidx" onClick="this.form.changeparms.value='hiddenresource';this.form.submit()" $hidtext /> $lt{'hd'}</label> |
<label><input type="checkbox" name="hiddenresource_$orderidx" onclick="this.form.changeparms.value='hiddenresource';this.form.submit()" $hidtext /> $lt{'hd'}</label> |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_parameter"> |
<td class="LC_docs_entry_parameter"> |
$form_start |
$form_start |
<label><input type="checkbox" name="encrypturl_$orderidx" onClick="this.form.changeparms.value='encrypturl';this.form.submit()" $enctext /> $lt{'ec'}</label> |
<label><input type="checkbox" name="encrypturl_$orderidx" onclick="this.form.changeparms.value='encrypturl';this.form.submit()" $enctext /> $lt{'ec'}</label> |
$form_end |
$form_end |
</td> |
</td> |
<td class="LC_docs_entry_parameter">$form_start $rand_order_text $form_end</td> |
<td class="LC_docs_entry_parameter">$form_start $rand_order_text $form_end</td> |
Line 2097 sub checkonthis {
|
Line 2142 sub checkonthis {
|
if (($errorcount) || |
if (($errorcount) || |
($warningcount)) { |
($warningcount)) { |
if ($errorcount) { |
if ($errorcount) { |
$r->print('<img src="/adm/lonMisc/bomb.gif" /><span class="LC_error">'. |
$r->print('<img src="/adm/lonMisc/bomb.gif" alt="'.&mt('bomb').'" /><span class="LC_error">'. |
&mt('[quant,_1,error]',$errorcount).'</span>'); |
&mt('[quant,_1,error]',$errorcount).'</span>'); |
} |
} |
if ($warningcount) { |
if ($warningcount) { |
Line 2122 sub checkonthis {
|
Line 2167 sub checkonthis {
|
unless ($url=~/\$/) { |
unless ($url=~/\$/) { |
$r->print('<span class="LC_error">'.&mt('not found').'</b></span>'); |
$r->print('<span class="LC_error">'.&mt('not found').'</b></span>'); |
} else { |
} else { |
$r->print('<span class="LC_unknown">'.&mt('unable to verify variable URL').'</span>'); |
$r->print('<span class="LC_error">'.&mt('unable to verify variable URL').'</span>'); |
} |
} |
} else { |
} else { |
$r->print('<span class="LC_error">'.&mt('access denied').'</span>'); |
$r->print('<span class="LC_error">'.&mt('access denied').'</span>'); |
Line 2487 sub changewarning {
|
Line 2532 sub changewarning {
|
$message='Changes will become active for your current session after [_1], or the next time you log in.'; |
$message='Changes will become active for your current session after [_1], or the next time you log in.'; |
} |
} |
$r->print("\n\n". |
$r->print("\n\n". |
'<script type="text/javascript">function reinit(tf) { tf.submit();'.$postexec.' }</script>'."\n". |
'<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
|
'function reinit(tf) { tf.submit();'.$postexec.' }'."\n". |
|
'// ]]>'."\n". |
|
'</script>'."\n". |
'<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'. |
'<form name="reinitform" method="post" action="/adm/roles" target="loncapaclient">'. |
'<input type="hidden" name="orgurl" value="'.$url. |
'<input type="hidden" name="orgurl" value="'.$url. |
'" /><input type="hidden" name="selectrole" value="1" /><h3><span class="LC_warning">'. |
'" /><input type="hidden" name="selectrole" value="1" /><p class="LC_warning">'. |
&mt($message,' <input type="hidden" name="'. |
&mt($message,' <input type="hidden" name="'. |
$env{'request.role'}.'" value="1" /><input type="button" value="'. |
$env{'request.role'}.'" value="1" /><input type="button" value="'. |
&mt('re-initializing '.$course_type).'" onClick="reinit(this.form)" />'). |
&mt('re-initializing '.$course_type).'" onclick="reinit(this.form)" />'). |
$help{'Caching'}.'</span></h3></form>'."\n\n"); |
$help{'Caching'}.'</p></form>'."\n\n"); |
|
|
} |
} |
|
|
|
|
Line 2502 sub init_breadcrumbs {
|
Line 2552 sub init_breadcrumbs {
|
my ($form,$text)=@_; |
my ($form,$text)=@_; |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", |
text=>"Edit ".&Apache::loncommon::course_type(), |
text=>&Apache::loncommon::course_type().' Editor', |
faq=>273, |
faq=>273, |
bug=>'Instructor Interface', |
bug=>'Instructor Interface', |
help => 'Docs_Adding_Course_Doc'}); |
help => 'Docs_Adding_Course_Doc'}); |
Line 2563 sub handler {
|
Line 2613 sub handler {
|
&init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space'); |
&init_breadcrumbs('dumpcourse','Dump '.&Apache::loncommon::course_type().' DOCS to Construction Space'); |
&dumpcourse($r); |
&dumpcourse($r); |
} elsif ($allowed && $env{'form.exportcourse'}) { |
} elsif ($allowed && $env{'form.exportcourse'}) { |
&init_breadcrumbs('exportcourse','Export '.&Apache::loncommon::course_type().' to IMS'); |
&init_breadcrumbs('exportcourse','IMS Export'); |
&exportcourse($r); |
&exportcourse($r); |
} else { |
} else { |
# is this a standard course? |
# is this a standard course? |
Line 2647 sub handler {
|
Line 2697 sub handler {
|
$script .= &editing_js($udom,$uname); |
$script .= &editing_js($udom,$uname); |
} |
} |
# -------------------------------------------------------------------- Body tag |
# -------------------------------------------------------------------- Body tag |
$script = '<script type="text/javascript">'."\n".$script."\n".'</script>'; |
$script = '<script type="text/javascript">'."\n" |
|
.'// <![CDATA['."\n" |
|
.$script."\n" |
|
.'// ]]>'."\n" |
|
.'</script>'."\n"; |
my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}]; |
my $brcrum = [{href=>"/adm/createuser",text=>"$type Documents"}]; |
$r->print(&Apache::loncommon::start_page("$type Documents", $script, |
$r->print(&Apache::loncommon::start_page("$type Documents", $script, |
{'force_register' => $showdoc, |
{'force_register' => $showdoc, |
Line 2762 sub handler {
|
Line 2816 sub handler {
|
'extr' => 'External Resource', |
'extr' => 'External Resource', |
'syll' => 'Syllabus', |
'syll' => 'Syllabus', |
'navc' => 'Navigate Contents', |
'navc' => 'Navigate Contents', |
'sipa' => 'Simple Page', |
'sipa' => 'Simple Course Page', |
'sipr' => 'Simple Problem', |
'sipr' => 'Simple Problem', |
'drbx' => 'Drop Box', |
'drbx' => 'Drop Box', |
'scuf' => 'Score Upload Form', |
'scuf' => 'Score Upload Form', |
'bull' => 'Bulletin Board', |
'bull' => 'Discussion Board', |
'mypi' => 'My Personal Info', |
'mypi' => 'My Personal Information Page', |
'grpo' => 'Group Files', |
'grpo' => 'Group Portfolios', |
'rost' => 'Course Roster', |
'rost' => 'Course Roster', |
'abou' => 'About User', |
'abou' => 'About User', |
'imsf' => 'Import IMS package', |
'imsf' => 'IMS Import', |
|
'imsl' => 'Import IMS package', |
'file' => 'File', |
'file' => 'File', |
'title' => 'Title', |
'title' => 'Title', |
'comment' => 'Comment', |
'comment' => 'Comment', |
'parse' => 'If HTML file, upload embedded images/multimedia files' |
'parse' => 'If HTML file, upload embedded images/multimedia files' |
); |
); |
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
|
my %tabtitles = ( |
|
main => { |
|
Course => &mt('Main Course Documents'), |
|
Community => &mt('Main Community Documents'), |
|
}, |
|
supplemental => { |
|
Course => &mt('Supplemental Course Documents'), |
|
Community => &mt('Supplemental Community Documents'), |
|
}, |
|
); |
if ($allowed) { |
if ($allowed) { |
&update_paste_buffer($coursenum,$coursedom); |
&update_paste_buffer($coursenum,$coursedom); |
my $dumpbut=&dumpbutton(); |
my $dumpbut=&dumpbutton(); |
Line 2793 sub handler {
|
Line 2858 sub handler {
|
if (!$folderpath) { |
if (!$folderpath) { |
if ($env{'form.folder'} eq '' || |
if ($env{'form.folder'} eq '' || |
$env{'form.folder'} eq 'supplemental') { |
$env{'form.folder'} eq 'supplemental') { |
$folderpath='default&'. |
$folderpath='default&'.&escape($tabtitles{'main'}{$type}); |
&escape(&mt('Main '.$type.' Documents')); |
|
} |
} |
} |
} |
unless ($env{'form.pagepath'}) { |
unless ($env{'form.pagepath'}) { |
Line 2855 ENDCOURSEVERIFY
|
Line 2919 ENDCOURSEVERIFY
|
} |
} |
my $postexec=''; |
my $postexec=''; |
if ($folder eq 'default') { |
if ($folder eq 'default') { |
$r->print('<script type="text/javascript">this.window.name="loncapaclient";</script>'); |
$r->print('<script type="text/javascript">'."\n" |
|
.'// <![CDATA['."\n" |
|
.'this.window.name="loncapaclient";'."\n" |
|
.'// ]]>'."\n" |
|
.'</script>'."\n" |
|
); |
} else { |
} else { |
#$postexec='self.close();'; |
#$postexec='self.close();'; |
} |
} |
Line 2913 $uploadtag
|
Line 2982 $uploadtag
|
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
$lt{'pubd'}<br /> |
$lt{'pubd'}<br /> |
$uploadtag |
$uploadtag |
<input type="button" onClick="javascript:groupsearch()" value="$lt{'srch'}" /> |
<input type="button" onclick="javascript:groupsearch()" value="$lt{'srch'}" /> |
<br /> |
<br /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input type="button" onClick="javascript:groupimport();" value="$lt{'impo'}" /> |
<input type="button" onclick="javascript:groupimport();" value="$lt{'impo'}" /> |
$help{'Importing_LON-CAPA_Resource'} |
$help{'Importing_LON-CAPA_Resource'} |
</span> |
</span> |
<br /> |
<br /> |
<input type="button" onClick="javascript:groupopen(0,1,1);" value="$lt{'book'}" /> |
<input type="button" onclick="javascript:groupopen(0,1,1);" value="$lt{'book'}" /> |
<hr /> |
<hr /> |
<p> |
<p> |
$lt{'copm'}<br /> |
$lt{'copm'}<br /> |
<input type="text" size="40" name="importmap" /><br /> |
<input type="text" size="40" name="importmap" /><br /> |
<span class="LC_nobreak"><input type="button" |
<span class="LC_nobreak"><input type="button" |
onClick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')" |
onclick="javascript:openbrowser('simpleeditdefault','importmap','sequence,page','')" |
value="$lt{'selm'}" /> <input type="submit" name="loadmap" value="$lt{'load'}" /> |
value="$lt{'selm'}" /> <input type="submit" name="loadmap" value="$lt{'load'}" /> |
$help{'Load_Map'}</span> |
$help{'Load_Map'}</span> |
</p> |
</p> |
</form> |
</form> |
<hr /> |
<hr /> |
<form action="/adm/groupsort" method="post" name="recover"> |
<form action="/adm/groupsort" method="post" name="recover"> |
<input type="button" name="recovermap" onClick="javascript:groupopen('$readfile',1,0)" value="$lt{'reco'}" /> |
<input type="button" name="recovermap" onclick="javascript:groupopen('$readfile',1,0)" value="$lt{'reco'}" /> |
</form> |
</form> |
ENDFORM |
ENDFORM |
unless ($env{'form.pagepath'}) { |
unless ($env{'form.pagepath'}) { |
Line 2943 ENDFORM
|
Line 3012 ENDFORM
|
$uploadtag |
$uploadtag |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newext" type="button" onClick="javascript:makenewext('newext');" |
<input name="newext" type="button" onclick="javascript:makenewext('newext');" |
value="$lt{'extr'}" /> $help{'Adding_External_Resource'} |
value="$lt{'extr'}" /> $help{'Adding_External_Resource'} |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/imsimportdocs" method="post" name="ims"> |
<br /><form action="/adm/imsimportdocs" method="post" name="ims"> |
<input type="hidden" name="folder" value="$folder" /> |
<input type="hidden" name="folder" value="$folder" /> |
<input name="imsimport" type="button" value="$lt{'imsf'}" onClick="javascript:makeims();" /> |
<input name="imsimport" type="button" value="$lt{'imsf'}" title="$lt{imsl}" onclick="javascript:makeims();" /> |
</form> |
</form> |
ENDFORM |
ENDFORM |
} |
} |
Line 2962 ENDFORM
|
Line 3031 ENDFORM
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newfolder" type="button" |
<input name="newfolder" type="button" |
onClick="javascript:makenewfolder(this.form,'$folderseq');" |
onclick="javascript:makenewfolder(this.form,'$folderseq');" |
value="$lt{'newf'}" />$help{'Adding_Folders'} |
value="$lt{'newf'}" />$help{'Adding_Folders'} |
</span> |
</span> |
</form> |
</form> |
Line 2971 value="$lt{'newf'}" />$help{'Adding_Fold
|
Line 3040 value="$lt{'newf'}" />$help{'Adding_Fold
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newpage" type="button" |
<input name="newpage" type="button" |
onClick="javascript:makenewpage(this.form,'$pageseq');" |
onclick="javascript:makenewpage(this.form,'$pageseq');" |
value="$lt{'newp'}" />$help{'Adding_Pages'} |
value="$lt{'newp'}" />$help{'Adding_Pages'} |
</span> |
</span> |
</form> |
</form> |
Line 2998 $uploadtag
|
Line 3067 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newsmppg" type="button" value="$lt{'sipa'}" |
<input name="newsmppg" type="button" value="$lt{'sipa'}" |
onClick="javascript:makesmppage();" /> $help{'Simple Page'} |
onclick="javascript:makesmppage();" /> $help{'Simple Page'} |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/coursedocs" method="post" name="newsmpproblem"> |
<br /><form action="/adm/coursedocs" method="post" name="newsmpproblem"> |
Line 3006 $uploadtag
|
Line 3075 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newsmpproblem" type="button" value="$lt{'sipr'}" |
<input name="newsmpproblem" type="button" value="$lt{'sipr'}" |
onClick="javascript:makesmpproblem();" />$help{'Simple Problem'} |
onclick="javascript:makesmpproblem();" />$help{'Simple Problem'} |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/coursedocs" method="post" name="newdropbox"> |
<br /><form action="/adm/coursedocs" method="post" name="newdropbox"> |
Line 3014 $uploadtag
|
Line 3083 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newdropbox" type="button" value="$lt{'drbx'}" |
<input name="newdropbox" type="button" value="$lt{'drbx'}" |
onClick="javascript:makedropbox();" /> |
onclick="javascript:makedropbox();" /> |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/coursedocs" method="post" name="newexamupload"> |
<br /><form action="/adm/coursedocs" method="post" name="newexamupload"> |
Line 3022 $uploadtag
|
Line 3091 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newexamupload" type="button" value="$lt{'scuf'}" |
<input name="newexamupload" type="button" value="$lt{'scuf'}" |
onClick="javascript:makeexamupload();" /> |
onclick="javascript:makeexamupload();" /> |
$help{'Score_Upload_Form'} |
$help{'Score_Upload_Form'} |
</span> |
</span> |
</form> |
</form> |
Line 3031 $uploadtag
|
Line 3100 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newbulletin" type="button" value="$lt{'bull'}" |
<input name="newbulletin" type="button" value="$lt{'bull'}" |
onClick="javascript:makebulboard();" /> |
onclick="javascript:makebulboard();" /> |
$help{'Bulletin Board'} |
$help{'Bulletin Board'} |
</span> |
</span> |
</form> |
</form> |
Line 3049 $uploadtag
|
Line 3118 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newaboutsomeone" type="button" value="$lt{'abou'}" |
<input name="newaboutsomeone" type="button" value="$lt{'abou'}" |
onClick="javascript:makeabout();" /> |
onclick="javascript:makeabout();" /> |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
<br /><form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
Line 3079 $uploadtag
|
Line 3148 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newsmpproblem" type="button" value="$lt{'sipr'}" |
<input name="newsmpproblem" type="button" value="$lt{'sipr'}" |
onClick="javascript:makesmpproblem();" />$help{'Simple Problem'} |
onclick="javascript:makesmpproblem();" />$help{'Simple Problem'} |
</span> |
</span> |
</form> |
</form> |
<br /><form action="/adm/coursedocs" method="post" name="newexamupload"> |
<br /><form action="/adm/coursedocs" method="post" name="newexamupload"> |
Line 3087 $uploadtag
|
Line 3156 $uploadtag
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newexamupload" type="button" value="$lt{'scuf'}" |
<input name="newexamupload" type="button" value="$lt{'scuf'}" |
onClick="javascript:makeexamupload();" /> |
onclick="javascript:makeexamupload();" /> |
$help{'Score_Upload_Form'} |
$help{'Score_Upload_Form'} |
</span> |
</span> |
</form> |
</form> |
Line 3109 ENDBLOCK
|
Line 3178 ENDBLOCK
|
if ($folder =~ /^supplemental$/ && |
if ($folder =~ /^supplemental$/ && |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
$env{'form.folderpath'} = 'supplemental&'. |
$env{'form.folderpath'} = 'supplemental&'. |
&escape(&mt('Supplemental '.$type.' Documents')); |
&escape($tabtitles{'supplemental'}{$type}); |
} |
} |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
Line 3138 ENDBLOCK
|
Line 3207 ENDBLOCK
|
</span> |
</span> |
<br /><br /> |
<br /><br /> |
$lt{'comment'}:<br /> |
$lt{'comment'}:<br /> |
<textarea cols=50 rows=4 name='comment'> |
<textarea cols="50" rows="4" name="comment"> |
</textarea> |
</textarea> |
<br /> |
<br /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
Line 3155 $lt{'comment'}:<br />
|
Line 3224 $lt{'comment'}:<br />
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newfolder" type="button" |
<input name="newfolder" type="button" |
onClick="javascript:makenewfolder(this.form,'$folderseq');" |
onclick="javascript:makenewfolder(this.form,'$folderseq');" |
value="$lt{'newf'}" /> $help{'Adding_Folders'} |
value="$lt{'newf'}" /> $help{'Adding_Folders'} |
</span> |
</span> |
</form> |
</form> |
Line 3164 value="$lt{'newf'}" /> $help{'Adding_Fol
|
Line 3233 value="$lt{'newf'}" /> $help{'Adding_Fol
|
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newext" type="button" |
<input name="newext" type="button" |
onClick="javascript:makenewext('supnewext');" |
onclick="javascript:makenewext('supnewext');" |
value="$lt{'extr'}" /> $help{'Adding_External_Resource'} |
value="$lt{'extr'}" /> $help{'Adding_External_Resource'} |
</span> |
</span> |
</form> |
</form> |
Line 3225 sub editing_js {
|
Line 3294 sub editing_js {
|
p_mnp => 'Name of New Page', |
p_mnp => 'Name of New Page', |
t_mnp => 'New Page', |
t_mnp => 'New Page', |
p_mxu => 'Title for the Uploaded Score', |
p_mxu => 'Title for the Uploaded Score', |
p_msp => 'Title for the Page', |
p_msp => 'Name of the Simple Course Page', |
p_msb => 'Title for the Problem', |
p_msb => 'Title for the Problem', |
p_mdb => 'Title for the Drop Box', |
p_mdb => 'Title for the Drop Box', |
p_mbb => 'Title for the Bulletin Board', |
p_mbb => 'Title for the Discussion Board', |
p_mab => "Enter user:domain for User's 'About Me' Page", |
p_mab => "Enter user:domain for User's 'About Me' Page", |
p_mab2 => "About [_99]", |
p_mab2 => "About [_99]", |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt1 => 'Not a valid user:domain', |