version 1.337, 2009/02/04 14:45:51
|
version 1.365, 2009/05/04 16:45:57
|
Line 72 sub storemap {
|
Line 72 sub storemap {
|
&LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. |
&LONCAPA::map::storemap('/uploaded/'.$coursedom.'/'.$coursenum.'/'. |
$map,1); |
$map,1); |
if ($errtext) { return ($errtext,2); } |
if ($errtext) { return ($errtext,2); } |
|
|
$hadchanges=1; |
$hadchanges=1; |
return ($errtext,0); |
return ($errtext,0); |
} |
} |
Line 121 sub dumpbutton {
|
Line 121 sub dumpbutton {
|
if ($home) { |
if ($home) { |
return '<input type="submit" name="dumpcourse" value="'. |
return '<input type="submit" name="dumpcourse" value="'. |
&mt('Dump '.$type.' DOCS to Construction Space').'" />'. |
&mt('Dump '.$type.' DOCS to Construction Space').'" />'. |
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs'); |
&Apache::loncommon::help_open_topic('Docs_Dump_Course_Docs').'<br />'; |
} else { |
} else { |
return '<div>'. |
return '<div>'. |
&mt('Dump '.$type. |
&mt('Dump '.$type. |
Line 133 sub dumpbutton {
|
Line 133 sub dumpbutton {
|
sub clean { |
sub clean { |
my ($title)=@_; |
my ($title)=@_; |
$title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; |
$title=~s/[^\w\/\!\$\%\^\*\-\_\=\+\;\:\,\\\|\`\~]+/\_/gs; |
return $title; |
return $title; |
} |
} |
|
|
|
|
Line 175 sub dumpcourse {
|
Line 175 sub dumpcourse {
|
my $fail=0; |
my $fail=0; |
for (my $i=0;$i<$#dirs;$i++) { |
for (my $i=0;$i<$#dirs;$i++) { |
$makepath.='/'.$dirs[$i]; |
$makepath.='/'.$dirs[$i]; |
unless (-e $makepath) { |
unless (-e $makepath) { |
unless(mkdir($makepath,0777)) { $fail=1; } |
unless(mkdir($makepath,0777)) { $fail=1; } |
} |
} |
} |
} |
$r->print('<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '); |
$r->print('<br /><tt>'.$item.'</tt> => <tt>'.$newfilename.'</tt>: '); |
Line 264 sub exportbutton {
|
Line 264 sub exportbutton {
|
my $type = &Apache::loncommon::course_type(); |
my $type = &Apache::loncommon::course_type(); |
return '<input type="submit" name="exportcourse" value="'. |
return '<input type="submit" name="exportcourse" value="'. |
&mt('Export '.$type.' to IMS').'" />'. |
&mt('Export '.$type.' to IMS').'" />'. |
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs'); |
&Apache::loncommon::help_open_topic('Docs_Export_Course_Docs').'<br />'; |
} |
} |
|
|
|
|
Line 397 sub exportcourse {
|
Line 397 sub exportcourse {
|
$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" /><img src="/adm/lonIcons/whitespace1.gif" class="LC_docs_spacer" />'."\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; |
$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; |
$lastcontainer = $count + $startcount + $boards; |
} |
} |
my $currelem = $count+$boards+$startcount; |
my $currelem = $count+$boards+$startcount; |
Line 427 function checkAll(field) {
|
Line 427 function checkAll(field) {
|
field.checked = true |
field.checked = true |
} |
} |
} |
} |
|
|
function uncheckAll(field) { |
function uncheckAll(field) { |
if (field.length > 0) { |
if (field.length > 0) { |
for (i = 0; i < field.length; i++) { |
for (i = 0; i < field.length; i++) { |
Line 442 function propagateCheck(item) {
|
Line 442 function propagateCheck(item) {
|
if (document.exportdoc.elements[item].checked == true) { |
if (document.exportdoc.elements[item].checked == true) { |
containerCheck(item) |
containerCheck(item) |
} |
} |
} |
} |
|
|
function containerCheck(item) { |
function containerCheck(item) { |
document.exportdoc.elements[item].checked = true |
document.exportdoc.elements[item].checked = true |
Line 465 function containerCheck(item) {
|
Line 465 function containerCheck(item) {
|
for (var j=0; j<parents[item].length; j++) { |
for (var j=0; j<parents[item].length; j++) { |
containerCheck(parents[item][j]) |
containerCheck(parents[item][j]) |
} |
} |
} |
} |
} |
} |
|
|
</script> |
</script> |
Line 474 function containerCheck(item) {
|
Line 474 function containerCheck(item) {
|
$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.'</table>'. |
'<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 '.$type.' DOCS').'" /></p></form>'); |
} |
} |
Line 759 sub replicate_content {
|
Line 759 sub replicate_content {
|
if ($caller eq 'templateupload') { |
if ($caller eq 'templateupload') { |
$url = $symb; |
$url = $symb; |
$url =~ s#//#/#g; |
$url =~ s#//#/#g; |
} else { |
} else { |
($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); |
($map,$ind,$url)=&Apache::lonnet::decode_symb($symb); |
} |
} |
my $content; |
my $content; |
Line 799 sub replicate_content {
|
Line 799 sub replicate_content {
|
$$message = 'Could not render '.$url.' server message - '.$rtncode."<br />\n"; |
$$message = 'Could not render '.$url.' server message - '.$rtncode."<br />\n"; |
} |
} |
} elsif ($caller eq 'noedit') { |
} elsif ($caller eq 'noedit') { |
# Need to render the resource without the LON-CAPA Internal header and the Post discussion footer, and then set $content equal to this. |
# Need to render the resource without the LON-CAPA Internal header and the Post discussion footer, and then set $content equal to this. |
$repstatus = 'ok'; |
$repstatus = 'ok'; |
$content = 'Not the owner of this resource'; |
$content = 'Not the owner of this resource'; |
} |
} |
if ($repstatus eq 'ok') { |
if ($repstatus eq 'ok') { |
print $copiedfile $content; |
print $copiedfile $content; |
Line 852 sub extract_media {
|
Line 852 sub extract_media {
|
} |
} |
} |
} |
if ($caller eq 'resource') { |
if ($caller eq 'resource') { |
my $respath = $Apache::lonnet::perlvar{'lonDocRoot'}.'/res'; |
my $respath = $Apache::lonnet::perlvar{'lonDocRoot'}.'/res'; |
my $embed_path = &Apache::lonnet::filelocation($respath,$embed_url); |
my $embed_path = &Apache::lonnet::filelocation($respath,$embed_url); |
$embed_content = &Apache::lonnet::getfile($embed_path); |
$embed_content = &Apache::lonnet::getfile($embed_path); |
unless ($embed_content eq -1) { |
unless ($embed_content eq -1) { |
$repstatus = 'ok'; |
$repstatus = 'ok'; |
} |
} |
} elsif ($caller eq 'uploaded') { |
} elsif ($caller eq 'uploaded') { |
|
|
$repstatus = &Apache::lonnet::getuploaded('GET',$embed_url,$cdom,$cnum,\$embed_content,$rtncode); |
$repstatus = &Apache::lonnet::getuploaded('GET',$embed_url,$cdom,$cnum,\$embed_content,$rtncode); |
} |
} |
if ($repstatus eq 'ok') { |
if ($repstatus eq 'ok') { |
Line 921 sub group_import {
|
Line 921 sub group_import {
|
|
|
while (@files) { |
while (@files) { |
my ($name, $url, $residx) = @{ shift(@files) }; |
my ($name, $url, $residx) = @{ shift(@files) }; |
if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) |
if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) |
&& ($caller eq 'londocs') |
&& ($caller eq 'londocs') |
&& (!&Apache::lonnet::stat_file($url))) { |
&& (!&Apache::lonnet::stat_file($url))) { |
|
|
my $errtext = ''; |
my $errtext = ''; |
my $fatal = 0; |
my $fatal = 0; |
my $newmapstr = '<map>'."\n". |
my $newmapstr = '<map>'."\n". |
Line 944 sub group_import {
|
Line 944 sub group_import {
|
} |
} |
} |
} |
if ($url) { |
if ($url) { |
if (!$residx |
if (!$residx |
|| defined($LONCAPA::map::zombies[$residx])) { |
|| defined($LONCAPA::map::zombies[$residx])) { |
$residx = &LONCAPA::map::getresidx($url,$residx); |
$residx = &LONCAPA::map::getresidx($url,$residx); |
push(@LONCAPA::map::order, $residx); |
push(@LONCAPA::map::order, $residx); |
Line 953 sub group_import {
|
Line 953 sub group_import {
|
if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; } |
if ($url=~m{^http://} || $url=~m{^https://}) { $ext = 'true'; } |
$url = &LONCAPA::map::qtunescape($url); |
$url = &LONCAPA::map::qtunescape($url); |
$name = &LONCAPA::map::qtunescape($name); |
$name = &LONCAPA::map::qtunescape($name); |
$LONCAPA::map::resources[$residx] = |
$LONCAPA::map::resources[$residx] = |
join(':', ($name, $url, $ext, 'normal', 'res')); |
join(':', ($name, $url, $ext, 'normal', 'res')); |
} |
} |
} |
} |
Line 984 sub breadcrumbs {
|
Line 984 sub breadcrumbs {
|
my $url='/adm/coursedocs?folderpath='. |
my $url='/adm/coursedocs?folderpath='. |
&escape($folderpath); |
&escape($folderpath); |
my $name=&unescape($foldername); |
my $name=&unescape($foldername); |
# randompick number, hidden, encrypted, random order, is appended with ":"s to the foldername |
# randompick number, hidden, encrypted, random order, is appended with ":"s to the foldername |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//; |
$name=~s/\:(\d*)\:(\w*)\:(\w*):(\d*)$//; |
if ($1 ne '') { |
if ($1 ne '') { |
$randompick=$1; |
$randompick=$1; |
} else { |
} else { |
$randompick=-1; |
$randompick=-1; |
Line 1012 sub breadcrumbs {
|
Line 1012 sub breadcrumbs {
|
} |
} |
$plain=~s/\>\;\s*$//; |
$plain=~s/\>\;\s*$//; |
return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', |
return (&Apache::lonhtmlcommon::breadcrumbs(undef,undef,0,'nohelp', |
'LC_docs_path'),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); |
'LC_docs_path', undef, 1 ),$randompick,$ishidden,$isencrypted,$plain,$is_random_order); |
} |
} |
|
|
sub log_docs { |
sub log_docs { |
Line 1125 sub docs_change_log {
|
Line 1125 sub docs_change_log {
|
foreach my $key (@changes) { |
foreach my $key (@changes) { |
$wholeentry.=':'.$docslog{$id}{'logentry'}{$key}; |
$wholeentry.=':'.$docslog{$id}{'logentry'}{$key}; |
} |
} |
if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } |
if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } |
} |
} |
my $count = 0; |
my $count = 0; |
my $time = |
my $time = |
Line 1176 sub docs_change_log {
|
Line 1176 sub docs_change_log {
|
if ($oldname ne '' && $oldname ne $newname) { |
if ($oldname ne '' && $oldname ne $newname) { |
$r->print(&LONCAPA::map::qtescape($newname)); |
$r->print(&LONCAPA::map::qtescape($newname)); |
} |
} |
} |
} |
$r->print('<ul>'); |
$r->print('<ul>'); |
for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) { |
for (my $idx=0;$idx<=$docslog{$id}{'logentry'}{'maxidx'};$idx++) { |
if ($docslog{$id}{'logentry'}{'after_order_res_'.$idx}) { |
if ($docslog{$id}{'logentry'}{'after_order_res_'.$idx}) { |
Line 1214 sub update_paste_buffer {
|
Line 1214 sub update_paste_buffer {
|
|
|
my ($errtext,$fatal) = &mapread($coursenum,$coursedom, |
my ($errtext,$fatal) = &mapread($coursenum,$coursedom, |
$env{'form.copyfolder'}); |
$env{'form.copyfolder'}); |
|
|
return if ($fatal); |
return if ($fatal); |
|
|
# Mark for copying |
# Mark for copying |
Line 1223 sub update_paste_buffer {
|
Line 1223 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 1327 sub do_paste_from_buffer {
|
Line 1327 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 1338 sub do_paste_from_buffer {
|
Line 1338 sub do_paste_from_buffer {
|
$db_name =~ s{_\d*$ }{_$now}x; |
$db_name =~ s{_\d*$ }{_$now}x; |
my $result=&Apache::lonnet::put($db_name,\%contents, |
my $result=&Apache::lonnet::put($db_name,\%contents, |
$coursedom,$coursenum); |
$coursedom,$coursenum); |
$url =~ s{/(\d*)/smppg$ }{/$now/smppg}x; |
$url =~ s{/(\d*)/smppg$ }{/$now/smppg}x; |
$title=&mt('Copy of').' '.$title; |
$title=&mt('Copy of').' '.$title; |
} |
} |
} |
} |
Line 1352 sub do_paste_from_buffer {
|
Line 1352 sub do_paste_from_buffer {
|
if ($folder =~ /^supplemental/) { |
if ($folder =~ /^supplemental/) { |
$title = $env{'docs.markedcopy_supplemental'}; |
$title = $env{'docs.markedcopy_supplemental'}; |
} else { |
} else { |
(undef,undef,$title) = |
(undef,undef,$title) = |
&parse_supplemental_title($env{'docs.markedcopy_supplemental'}); |
&parse_supplemental_title($env{'docs.markedcopy_supplemental'}); |
} |
} |
} else { |
} else { |
Line 1376 sub uniqueness_check {
|
Line 1376 sub uniqueness_check {
|
$url=&LONCAPA::map::qtescape($url); |
$url=&LONCAPA::map::qtescape($url); |
if ($newurl eq $url) { |
if ($newurl eq $url) { |
$unique = 0; |
$unique = 0; |
last; |
last; |
} |
} |
} |
} |
return $unique; |
return $unique; |
Line 1402 sub update_parameter {
|
Line 1402 sub update_parameter {
|
&remember_parms($idx,$which,'set',$value); |
&remember_parms($idx,$which,'set',$value); |
} else { |
} else { |
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
&LONCAPA::map::delparameter($idx,'parameter_'.$which); |
|
|
&remember_parms($idx,$which,'del'); |
&remember_parms($idx,$which,'del'); |
} |
} |
return 1; |
return 1; |
Line 1430 sub handle_edit_cmd {
|
Line 1430 sub handle_edit_cmd {
|
&LONCAPA::map::makezombie($LONCAPA::map::order[$idx]); |
&LONCAPA::map::makezombie($LONCAPA::map::order[$idx]); |
splice(@LONCAPA::map::order, $idx, 1); |
splice(@LONCAPA::map::order, $idx, 1); |
|
|
} elsif ($cmd eq 'up' |
} elsif ($cmd eq 'up' |
&& ($idx) && (defined($LONCAPA::map::order[$idx-1]))) { |
&& ($idx) && (defined($LONCAPA::map::order[$idx-1]))) { |
@LONCAPA::map::order[$idx-1,$idx] = @LONCAPA::map::order[$idx,$idx-1]; |
@LONCAPA::map::order[$idx-1,$idx] = @LONCAPA::map::order[$idx,$idx-1]; |
|
|
Line 1470 sub editor {
|
Line 1470 sub editor {
|
$LONCAPA::map::order[0]=$idx; |
$LONCAPA::map::order[0]=$idx; |
$LONCAPA::map::resources[$idx]=''; |
$LONCAPA::map::resources[$idx]=''; |
} |
} |
|
|
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= |
my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order)= |
&breadcrumbs($folder,$allowed,$type); |
&breadcrumbs($folder,$allowed,$type); |
$r->print($breadcrumbtrail); |
$r->print($breadcrumbtrail); |
|
|
# ------------------------------------------------------------ Process commands |
# ------------------------------------------------------------ Process commands |
|
|
# ---------------- if they are for this folder and user allowed to make changes |
# ---------------- if they are for this folder and user allowed to make changes |
Line 1495 sub editor {
|
Line 1495 sub editor {
|
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); |
($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); |
return $errtext if ($fatal); |
return $errtext if ($fatal); |
} |
} |
|
|
if ($env{'form.pastemarked'}) { |
if ($env{'form.pastemarked'}) { |
my $paste_res = |
my $paste_res = |
&do_paste_from_buffer($coursenum,$coursedom,$folder); |
&do_paste_from_buffer($coursenum,$coursedom,$folder); |
if ($paste_res eq 'ok') { |
if ($paste_res eq 'ok') { |
($errtext,$fatal) = &storemap($coursenum,$coursedom,$folder.'.'.$container); |
($errtext,$fatal) = &storemap($coursenum,$coursedom,$folder.'.'.$container); |
Line 1541 sub editor {
|
Line 1541 sub editor {
|
return $errtext if ($fatal); |
return $errtext if ($fatal); |
} else { |
} else { |
$r->print('<p><span class="LC_error">'.&mt('No map selected.').'</span></p>'); |
$r->print('<p><span class="LC_error">'.&mt('No map selected.').'</span></p>'); |
|
|
} |
} |
} |
} |
&log_differences($plain); |
&log_differences($plain); |
Line 1556 sub editor {
|
Line 1556 sub editor {
|
($ishidden?'<li>'.&mt('contents hidden').'</li>':''). |
($ishidden?'<li>'.&mt('contents hidden').'</li>':''). |
($isencrypted?'<li>'.&mt('URLs hidden').'</li>':''). |
($isencrypted?'<li>'.&mt('URLs hidden').'</li>':''). |
'</ul></p>'); |
'</ul></p>'); |
} |
} |
if ($randompick>=0) { |
if ($randompick>=0) { |
$r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>'); |
$r->print('<p>'.&mt('Caution: this folder is set to randomly pick a subset of resources. Adding or removing resources from this folder will change the set of resources that the students see, resulting in spurious or missing credit for completed problems, not limited to ones you modify. Do not modify the contents of this folder if it is in active student use.').'</p>'); |
} |
} |
Line 1660 sub process_file_upload {
|
Line 1660 sub process_file_upload {
|
<input type="hidden" name="phasetwo" value="'.$total_embedded.'" />'; |
<input type="hidden" name="phasetwo" value="'.$total_embedded.'" />'; |
$phase_status = 'phasetwo'; |
$phase_status = 'phasetwo'; |
|
|
$$upload_output .= |
$$upload_output .= |
'This file contains embedded multimedia objects, which need to be uploaded to LON-CAPA.<br />'. |
'This file contains embedded multimedia objects, which need to be uploaded to LON-CAPA.<br />'. |
&Apache::loncommon::ask_for_embedded_content( |
&Apache::loncommon::ask_for_embedded_content( |
'/adm/coursedocs',$state,$allfiles,$codebase); |
'/adm/coursedocs',$state,$allfiles,$codebase); |
Line 1715 sub parse_supplemental_title {
|
Line 1715 sub parse_supplemental_title {
|
} |
} |
if (wantarray) { |
if (wantarray) { |
return ($title,$foldertitle,$renametitle); |
return ($title,$foldertitle,$renametitle); |
} |
} |
return $title; |
return $title; |
} |
} |
|
|
Line 1736 sub entryline {
|
Line 1736 sub entryline {
|
} |
} |
|
|
my $orderidx=$LONCAPA::map::order[$index]; |
my $orderidx=$LONCAPA::map::order[$index]; |
|
|
|
|
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\\/\\\\/g; |
$renametitle=~s/\"\;/\\\"/g; |
$renametitle=~s/\"\;/\\\"/g; |
Line 1763 sub entryline {
|
Line 1763 sub entryline {
|
my $incindex=$index+1; |
my $incindex=$index+1; |
my $selectbox=''; |
my $selectbox=''; |
if (($folder!~/^supplemental/) && |
if (($folder!~/^supplemental/) && |
($#LONCAPA::map::order>0) && |
($#LONCAPA::map::order>0) && |
((split(/\:/, |
((split(/\:/, |
$LONCAPA::map::resources[$LONCAPA::map::order[0]]))[1] |
$LONCAPA::map::resources[$LONCAPA::map::order[0]]))[1] |
ne '') && |
ne '') && |
((split(/\:/, |
((split(/\:/, |
$LONCAPA::map::resources[$LONCAPA::map::order[1]]))[1] |
$LONCAPA::map::resources[$LONCAPA::map::order[1]]))[1] |
ne '')) { |
ne '')) { |
$selectbox= |
$selectbox= |
'<input type="hidden" name="currentpos" value="'.$incindex.'" />'. |
'<input type="hidden" name="currentpos" value="'.$incindex.'" />'. |
'<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 1805 sub entryline {
|
Line 1805 sub entryline {
|
} |
} |
} |
} |
} |
} |
if ($url=~/^\/res\/lib\/templates\//) { |
if ($url=~/^\/res\/lib\/templates\//) { |
$nocopy=1; |
$nocopy=1; |
$nocut=1; |
$nocut=1; |
} |
} |
my $copylink=' '; |
my $copylink=' '; |
my $cutlink=' '; |
my $cutlink=' '; |
|
|
my $skip_confirm = 0; |
my $skip_confirm = 0; |
if ( $folder =~ /^supplemental/ |
if ( $folder =~ /^supplemental/ |
|| ($url =~ m{( /smppg$ |
|| ($url =~ m{( /smppg$ |
Line 1897 END
|
Line 1897 END
|
&Apache::lonnet::allowuploaded('/adm/coursedoc',$url); |
&Apache::lonnet::allowuploaded('/adm/coursedoc',$url); |
} |
} |
} |
} |
|
|
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 1920 END
|
Line 1921 END
|
} elsif ($url!~/\.(sequence|page)$/) { |
} elsif ($url!~/\.(sequence|page)$/) { |
$url='/adm/coursedocs/showdoc'.$url; |
$url='/adm/coursedocs/showdoc'.$url; |
} |
} |
} elsif ($url=~m|^/ext/|) { |
} elsif ($url=~m|^/ext/|) { |
$url='/adm/wrapper'.$url; |
$url='/adm/wrapper'.$url; |
$external = 1; |
$external = 1; |
} |
} |
Line 1931 END
|
Line 1932 END
|
} |
} |
if ($container eq 'page') { |
if ($container eq 'page') { |
my $symb=$env{'form.pagesymb'}; |
my $symb=$env{'form.pagesymb'}; |
|
|
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
$url=&Apache::lonnet::clutter((&Apache::lonnet::decode_symb($symb))[2]); |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
$url.=(($url=~/\?/)?'&':'?').'symb='.&escape($symb); |
} |
} |
Line 1941 END
|
Line 1942 END
|
my $foldername=&escape($foldertitle); |
my $foldername=&escape($foldertitle); |
my $folderpath=$env{'form.folderpath'}; |
my $folderpath=$env{'form.folderpath'}; |
if ($folderpath) { $folderpath.='&' }; |
if ($folderpath) { $folderpath.='&' }; |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# so it gets transferred between levels |
# so it gets transferred between levels |
$folderpath.=$folderarg.'&'.$foldername.':'.(&LONCAPA::map::getparameter($orderidx, |
$folderpath.=$folderarg.'&'.$foldername.':'.(&LONCAPA::map::getparameter($orderidx, |
'parameter_randompick'))[0] |
'parameter_randompick'))[0] |
Line 1961 END
|
Line 1962 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 1999 END
|
Line 2000 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 |
Line 2044 sub tiehash {
|
Line 2045 sub tiehash {
|
$hashtied=1; |
$hashtied=1; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
sub untiehash { |
sub untiehash { |
Line 2093 sub checkonthis {
|
Line 2094 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="" /><span class="LC_error">'. |
&mt('[quant,_1,error]',$errorcount).'</span>'); |
&mt('[quant,_1,error]',$errorcount).'</span>'); |
} |
} |
if ($warningcount) { |
if ($warningcount) { |
Line 2252 sub checkversions {
|
Line 2253 sub checkversions {
|
if ($haschanged) { |
if ($haschanged) { |
if (&Apache::lonnet::put('resourceversions',\%newsetversions, |
if (&Apache::lonnet::put('resourceversions',\%newsetversions, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') { |
$env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') { |
$r->print('<h1>'.&mt('Your Version Settings have been Saved').'</h1>'); |
$r->print('<h1>'.&mt('Your Version Settings have been Saved').'</h1>'); |
} else { |
} else { |
$r->print('<h1><span class="LC_error">'.&mt('An Error Occured while Attempting to Save your Version Settings').'</span></h1>'); |
$r->print('<h1><span class="LC_error">'.&mt('An Error Occured while Attempting to Save your Version Settings').'</span></h1>'); |
Line 2393 ENDHEADERS
|
Line 2394 ENDHEADERS
|
$lastold=$prevvers; |
$lastold=$prevvers; |
} |
} |
} |
} |
# |
# |
# Code to figure out how many version entries should go in |
# Code to figure out how many version entries should go in |
# each of the four columns |
# each of the four columns |
my $entries_per_col = 0; |
my $entries_per_col = 0; |
Line 2404 ENDHEADERS
|
Line 2405 ENDHEADERS
|
$entries_per_col = $num_entries/4 + 1; |
$entries_per_col = $num_entries/4 + 1; |
} |
} |
my $entries_count = 0; |
my $entries_count = 0; |
$r->print('<td valign="top"><font size="-2">'); |
$r->print('<td valign="top"><font size="-2">'); |
my $cols_output = 1; |
my $cols_output = 1; |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
for (my $prevvers=$lastold;$prevvers<$currentversion;$prevvers++) { |
my $url=$root.'.'.$prevvers.'.'.$extension; |
my $url=$root.'.'.$prevvers.'.'.$extension; |
Line 2483 sub changewarning {
|
Line 2484 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">function reinit(tf) { tf.submit();'.$postexec.' }</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" /><h3><span class="LC_warning">'. |
Line 2537 sub handler {
|
Line 2538 sub handler {
|
'Option_Response_Simple'); |
'Option_Response_Simple'); |
$help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( |
$help{'Bulletin Board'} = &Apache::loncommon::help_open_topic( |
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); |
'Docs_About_Bulletin_Board,Docs_Editing_Templated_Pages'); |
$help{'My Personal Info'} = &Apache::loncommon::help_open_topic( |
$help{'My Personal Information Page'} = &Apache::loncommon::help_open_topic( |
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages'); |
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages'); |
$help{'Group Files'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files'); |
$help{'Group Portfolio'} = &Apache::loncommon::help_open_topic('Docs_About_Group_Files'); |
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
$help{'Caching'} = &Apache::loncommon::help_open_topic('Caching'); |
|
|
# does this user have privileges to modify docs |
# does this user have privileges to modify docs |
Line 2615 sub handler {
|
Line 2616 sub handler {
|
$showdoc='/'.$1; |
$showdoc='/'.$1; |
} |
} |
unless ($showdoc) { # got called from remote |
unless ($showdoc) { # got called from remote |
if (($env{'form.folder'}=~/^(?:group|default)_/) || |
if (($env{'form.folder'}=~/^(?:group|default)_/) || |
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) { |
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) { |
$forcestandard = 1; |
$forcestandard = 1; |
} |
} |
$forcesupplement=($env{'form.folder'}=~/^supplemental_/); |
$forcesupplement=($env{'form.folder'}=~/^supplemental_/); |
|
|
if ($allowed) { |
if ($allowed) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']); |
$script=&Apache::lonratedt::editscript('simple'); |
$script=&Apache::lonratedt::editscript('simple'); |
} |
} |
} else { # got called in sequence from course |
} else { # got called in sequence from course |
$allowed=0; |
$allowed=0; |
Line 2633 sub handler {
|
Line 2634 sub handler {
|
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $coursenum=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $coursedom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
|
# get personal data |
# get personal data |
my $uname=$env{'user.name'}; |
my $uname=$env{'user.name'}; |
my $udom=$env{'user.domain'}; |
my $udom=$env{'user.domain'}; |
my $plainname=&escape(&Apache::loncommon::plainname($uname,$udom)); |
my $plainname=&escape(&Apache::loncommon::plainname($uname,$udom)); |
Line 2652 sub handler {
|
Line 2653 sub handler {
|
{'force_register' => $showdoc, |
{'force_register' => $showdoc, |
'bread_crumbs' => $brcrum}). |
'bread_crumbs' => $brcrum}). |
&Apache::loncommon::help_open_menu('','',273,'RAT')); |
&Apache::loncommon::help_open_menu('','',273,'RAT')); |
|
|
my %allfiles = (); |
my %allfiles = (); |
my %codebase = (); |
my %codebase = (); |
my ($upload_result,$upload_output); |
my ($upload_result,$upload_output); |
if ($allowed) { |
if ($allowed) { |
if (($env{'form.uploaddoc.filename'}) && |
if (($env{'form.uploaddoc.filename'}) && |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
($env{'form.cmd'}=~/^upload_(\w+)/)) { |
# Process file upload - phase one - upload and parse primary file. |
# Process file upload - phase one - upload and parse primary file. |
undef($hadchanges); |
undef($hadchanges); |
$upload_result = &process_file_upload(\$upload_output,$coursenum, |
$upload_result = &process_file_upload(\$upload_output,$coursenum, |
$coursedom,\%allfiles, |
$coursedom,\%allfiles, |
Line 2684 sub handler {
|
Line 2685 sub handler {
|
$newname{$i} = &process_secondary_uploads(\$upload_output,$coursedom,$coursenum,'embedded_item_',$i,$residx); |
$newname{$i} = &process_secondary_uploads(\$upload_output,$coursedom,$coursenum,'embedded_item_',$i,$residx); |
$origname{$i} = &unescape($env{'form.embedded_orig_'.$i}); |
$origname{$i} = &unescape($env{'form.embedded_orig_'.$i}); |
if (exists($env{'form.embedded_codebase_'.$i})) { |
if (exists($env{'form.embedded_codebase_'.$i})) { |
$javacodebase = &unescape($env{'form.embedded_codebase_'.$i}); |
$javacodebase = &unescape($env{'form.embedded_codebase_'.$i}); |
$origname{$i} =~ s#^\Q$javacodebase\E/##; |
$origname{$i} =~ s#^\Q$javacodebase\E/##; |
} |
} |
my @attributes = (); |
my @attributes = (); |
if ($env{'form.embedded_attrib_'.$i} =~ /:/) { |
if ($env{'form.embedded_attrib_'.$i} =~ /:/) { |
Line 2721 sub handler {
|
Line 2722 sub handler {
|
$attrib_regexp = $attribs{$item}[0]; |
$attrib_regexp = $attribs{$item}[0]; |
} |
} |
if ($content =~ m#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#) { |
if ($content =~ m#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#) { |
} |
} |
$content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi; |
$content =~ s#($attrib_regexp\s*=\s*['"]?)\Q$origname{$item}\E(['"]?)#$1$newname{$item}$2#gi; |
} |
} |
if (exists($codebase{$item})) { |
if (exists($codebase{$item})) { |
$content =~ s/(codebase\s*=\s*["']?)\Q$codebase{$item}\E(["']?)/$1.$2/i; #' stupid emacs |
$content =~ s/(codebase\s*=\s*["']?)\Q$codebase{$item}\E(["']?)/$1.$2/i; #' stupid emacs |
Line 2734 sub handler {
|
Line 2735 sub handler {
|
my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $url = &Apache::lonnet::store_edited_file($primary_url,$content,$docudom,$docuname,\$saveresult); |
my $url = &Apache::lonnet::store_edited_file($primary_url,$content,$docudom,$docuname,\$saveresult); |
} else { |
} else { |
&Apache::lonnet::logthis('retrieval of uploaded file - '.$primary_url.' - for editing, failed: '.$getstatus); |
&Apache::lonnet::logthis('retrieval of uploaded file - '.$primary_url.' - for editing, failed: '.$getstatus); |
} |
} |
} |
} |
} |
} |
Line 2760 sub handler {
|
Line 2761 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' => 'Discussion Board', |
'bull' => 'Discussion Board', |
'mypi' => 'My Personal Info', |
'mypi' => 'My Personal Information Page', |
'grpo' => 'Group Files', |
'grpo' => 'Group Portfolio', |
'rost' => 'Course Roster', |
'rost' => 'Course Roster', |
'abou' => 'About User', |
'abou' => 'Personal Information Page for a User', |
'imsf' => 'Import IMS package', |
'imsf' => 'Import IMS package', |
'file' => 'File', |
'file' => 'File', |
'title' => 'Title', |
'title' => 'Title', |
Line 2832 FUFORM
|
Line 2833 FUFORM
|
<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> |
Line 2888 HIDDENFORM
|
Line 2889 HIDDENFORM
|
} |
} |
# --------------------------------------------------------- Main tab structure |
# --------------------------------------------------------- Main tab structure |
my $activeClass = 1; |
my $activeClass = 1; |
$r->print('<div class="LC_ContentBoxSpecial"><ul class="LC_TabContent" id="mainnav">'); |
my $active = ''; |
if (($standard) && ($allowed) && (!$forcesupplement)) { |
$r->print('<ul class="LC_TabContentBigger" id="mainnav">'); |
my $active = ''; |
if (($standard) && ($allowed) && (!$forcesupplement) && (($env{'form.folderpath'}=~/^default/) || ($env{'form.pagepath'}))) { |
if($activeClass == 1){ |
if($activeClass == 1){ |
$active = 'class="active"'; |
$active = 'class="active"'; |
$activeClass = 0; |
$activeClass = 0; |
} |
} |
$r->print('<li '.$active.'onclick="javascript:showPage(this,\'Main Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>'); |
|
} |
} |
if (!$forcestandard) { |
$r->print('<li '.$active.'onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');">'.&mt('Main Course Documents').'</li>'); |
my $active = ''; |
$active = ''; |
|
if (!$forcestandard || ($env{'form.folderpath'}=~/^supplemental/)) { |
if($activeClass == 1){ |
if($activeClass == 1){ |
$active = 'class="active"'; |
$active = 'class="active"'; |
} |
} |
$r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>'); |
|
} |
} |
$r->print('<li onclick="javascript:showPage(this,\'Special Admin Options\',\'mainnav\',\'maincoursedoc\');">'.&mt('Special Admin Options').'</li>'); |
$r->print('<li '.$active.'onclick="javascript:showPage(this,\'Supplemental Course Documents\',\'mainnav\',\'maincoursedoc\');">'.&mt('Supplemental Course Documents').'</li>'); |
$r->print('</ul><div id="maincoursedoc" style="margin:0 0;padding:0 0;">'); |
$r->print('</ul><div class="LC_ContentBoxSpecial" style="margin:0 0;padding:0 0;"><div id="maincoursedoc" style="margin:0 0;padding:0 0;">'); |
# --------------------------------------------------------- Standard documents |
# --------------------------------------------------------- Standard documents |
if (($standard) && ($allowed) && (!$forcesupplement)) { |
my $savefolderpath; |
my $active = 'style="display: none;"'; |
my $active = 'style="display: none;"'; |
if($activeClass == 0){ |
if($activeClass == 0){ |
$active = 'style="display: block;"'; |
$active = 'style="display: block;"'; |
} |
} |
$r->print('<div class="LC_ContentBox" id="Main Course Documents" '.$active.'>'); |
$r->print('<div class="LC_ContentBox" id="mainCourseDocuments" '.$active.'>'); |
$r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', |
$r->print(&Apache::loncommon::help_open_topic('Docs_Adding_Course_Doc', |
&mt('Editing the Table of Contents for your '.$type))); |
&mt('Editing the Table of Contents for your '.$type))); |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
if ($folder eq '' || $folder eq 'supplemental') { |
if ($folder eq '' || $folder=~/^supplemental/) { |
$folder='default'; |
$folder='default'; |
|
$savefolderpath = $env{'form.folderpath'}; |
$env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents')); |
$env{'form.folderpath'}='default&'.&escape(&mt('Main '.$type.' Documents')); |
$uploadtag = '<input type="hidden" name="folderpath" value="'. |
$uploadtag = '<input type="hidden" name="folderpath" value="'. |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"').'" />'; |
Line 2928 HIDDENFORM
|
Line 2929 HIDDENFORM
|
} else { |
} else { |
#$postexec='self.close();'; |
#$postexec='self.close();'; |
} |
} |
$hadchanges=0; |
|
if ($hadchanges) { |
|
&mark_hash_old(); |
|
} |
|
&changewarning($r,$postexec); |
|
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
my $folderseq='/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
'.sequence'; |
'.sequence'; |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
my $pageseq = '/uploaded/'.$coursedom.'/'.$coursenum.'/default_'.time. |
Line 2994 NSPROBFORM
|
Line 2990 NSPROBFORM
|
|
|
my $newdropboxform=(<<NDBFORM); |
my $newdropboxform=(<<NDBFORM); |
<form action="/adm/coursedocs" method="post" name="newdropbox"> |
<form action="/adm/coursedocs" method="post" name="newdropbox"> |
$uploadtag |
$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> |
NDBFORM |
NDBFORM |
|
|
my $newexuploadform=(<<NEXUFORM); |
my $newexuploadform=(<<NEXUFORM); |
Line 3034 NBFORM
|
Line 3030 NBFORM
|
value="$plainname=/adm/$udom/$uname/aboutme" /> |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newaboutme" type="submit" value="$lt{'mypi'}" /> |
<input name="newaboutme" type="submit" value="$lt{'mypi'}" /> |
$help{'My Personal Info'} |
$help{'My Personal Information Page'} |
</span> |
</span> |
</form> |
</form> |
NAMFORM |
NAMFORM |
Line 3063 NASOFORM
|
Line 3059 NASOFORM
|
</form> |
</form> |
NROSTFORM |
NROSTFORM |
|
|
|
my $specialdocumentsform; |
|
my $newfolderform; |
|
|
unless ($env{'form.pagepath'}) { |
unless ($env{'form.pagepath'}) { |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
|
|
Line 3078 NROSTFORM
|
Line 3077 NROSTFORM
|
</form> |
</form> |
NPFORM |
NPFORM |
|
|
my $newfolderform=(<<NFFORM); |
$newfolderform=(<<NFFORM); |
<form action="/adm/coursedocs" method="post" name="newfolder"> |
<form action="/adm/coursedocs" method="post" name="newfolder"> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
Line 3101 NFFORM
|
Line 3100 NFFORM
|
</span> |
</span> |
</form> |
</form> |
NSYLFORM |
NSYLFORM |
|
|
my $newgroupfileform=(<<NGFFORM); |
my $newgroupfileform=(<<NGFFORM); |
<form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
<form action="/adm/coursedocs" method="post" name="newgroupfiles"> |
$uploadtag |
$uploadtag |
Line 3109 NSYLFORM
|
Line 3108 NSYLFORM
|
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
value="$lt{'grpo'}=/adm/$coursedom/$coursenum/aboutme" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newgroupfiles" type="submit" value="$lt{'grpo'}" /> |
<input name="newgroupfiles" type="submit" value="$lt{'grpo'}" /> |
$help{'Group Files'} |
$help{'Group Portfolio'} |
</span> |
</span> |
</form> |
</form> |
NGFFORM |
NGFFORM |
|
|
|
$specialdocumentsform="<br />$newpageform<br />$newsylform<br />$newgroupfileform"; |
my $specialdocumentsform=(<<SPDOFORM); |
} |
<br />$newfolderform |
$specialdocumentsform.="<br />$newnavform<br />$newsmppageform |
<br />$newpageform |
<br />$newsmpproblemform<br />$newdropboxform |
<br />$newsylform |
<br />$newexuploadform<br />$newbulform |
<br />$newnavform |
<br />$newaboutmeform<br />$newaboutsomeoneform |
<br />$newsmppageform |
<br />$newrosterform"; |
<br />$newsmpproblemform |
if($env{'form.pagepath'}) { |
<br />$newdropboxform |
$specialdocumentsform="<br />$newsmpproblemform<br />$newexuploadform"; |
<br />$newexuploadform |
} |
<br />$newbulform |
|
<br />$newaboutmeform |
|
<br />$newaboutsomeoneform |
|
<br />$newgroupfileform |
|
<br />$newrosterform |
|
SPDOFORM |
|
|
|
|
|
my %orderhash = ( |
my %orderhash = ( |
'aa' => 'New Document', |
'aa' => ['New Document',$fileuploadform.'<br />'.$newfolderform], |
'bb' => 'Published Documents', |
'bb' => ['Published Documents',$simpleeditdefaultform], |
'cc' => 'Special Documents', |
'cc' => ['Special Documents',$specialdocumentsform], |
'dd' => 'More Options', |
'dd' => ['Tools',$extresourcesform.'<br />'.$imspform.'<br />'.$recoverform.'<br />'.&generate_admin_options($containertag,$uploadtag,\%help,\%env)], |
'zz' => 'Hide all Options', |
'zz' => ['Hide all Options'], |
); |
|
my %namehash = ( |
|
'New Document' => $fileuploadform, |
|
'Published Documents' => $simpleeditdefaultform, |
|
'Special Documents' => $specialdocumentsform, |
|
'More Options' => $extresourcesform.'<br />'.$imspform.'<br />'.$recoverform, |
|
); |
); |
my $tid='1'; |
my $tid='1'; |
my $content='content'; |
|
my $navigation='navigation'; |
|
my $varcd = 'Main Course Documents'; |
my $varcd = 'Main Course Documents'; |
$r->print(&generate_edit_table($tid,$content,$navigation,$varcd,\%namehash,\%orderhash)); |
$r->print(&generate_edit_table($tid,$varcd,\%orderhash)); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
$hadchanges=0; |
|
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
|
if ($hadchanges) { |
|
&mark_hash_old(); |
|
} |
|
|
|
&changewarning($r,''); |
$r->print('</div>'); |
$r->print('</div>'); |
} |
|
if ($env{'form.pagepath'}) { |
if ($env{'form.pagepath'}) { |
} |
} |
} |
|
# ----------------------------------------------------- Supplemental documents |
# ----------------------------------------------------- Supplemental documents |
if (!$forcestandard) { |
|
my $active = 'style="display: none;"'; |
my $active = 'style="display: none;"'; |
if($activeClass == 1){ |
if($activeClass == 1){ |
$active = 'style="display: block;"'; |
$active = 'style="display: block;"'; |
Line 3174 $r->print('</div>');
|
Line 3161 $r->print('</div>');
|
(($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(&mt('Supplemental '.$type.' Documents')); |
|
}else{ |
|
$env{'form.folderpath'} = $savefolderpath; |
} |
} |
|
$env{'form.pagepath'} = ''; |
if ($allowed) { |
if ($allowed) { |
my $folderseq= |
my $folderseq= |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time. |
'/uploaded/'.$coursedom.'/'.$coursenum.'/supplemental_'.time. |
Line 3192 $r->print('</div>');
|
Line 3182 $r->print('</div>');
|
</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 3248 SNSFORM
|
Line 3238 SNSFORM
|
value="$plainname=/adm/$udom/$uname/aboutme" /> |
value="$plainname=/adm/$udom/$uname/aboutme" /> |
<span class="LC_nobreak"> |
<span class="LC_nobreak"> |
<input name="newaboutme" type="submit" value="$lt{'mypi'}" /> |
<input name="newaboutme" type="submit" value="$lt{'mypi'}" /> |
$help{'My Personal Info'} |
$help{'My Personal Information Page'} |
</span> |
</span> |
</form> |
</form> |
SNAMFORM |
SNAMFORM |
Line 3256 SNAMFORM
|
Line 3246 SNAMFORM
|
|
|
|
|
my %suporderhash = ( |
my %suporderhash = ( |
'ee' => 'New Document', |
'ee' => ['New Document',$supupdocform.'<br />'.$supnewfolderform], |
'ff' => 'Special Documents', |
'ff' => ['Special Documents',$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform], |
'zz' => 'Hide all Options', |
'zz' => ['Hide all Options'], |
); |
|
|
|
my %supnamehash = ( |
|
'New Document' => $supupdocform, |
|
'Special Documents' => $supnewfolderform.'<br />'.$supnewextform.'<br />'.$supnewsylform.'<br />'.$supnewaboutmeform, |
|
); |
); |
|
|
my $tid='2'; |
my $tid='2'; |
my $content='content'; |
|
my $navigation='navigation'; |
|
my $varscd = 'Supplemental Course Documents'; |
my $varscd = 'Supplemental Course Documents'; |
|
|
$r->print(&generate_edit_table($tid,$content,$navigation,$varscd,\%supnamehash,\%suporderhash)); |
$r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
$r->print('</div>'); |
$r->print('</div>'); |
} |
} |
} |
|
$r->print('<div class="LC_ContentBox" id="Special Admin Options" style="display: none;">'); |
|
$r->print(&generate_admin_options($containertag,$uploadtag,\%help,\%env)); |
|
$r->print('</div>'); |
|
$r->print('</div>'); |
$r->print('</div>'); |
if ($allowed) { |
if ($allowed) { |
$r->print(' |
$r->print(' |
Line 3304 $r->print('</div>');
|
Line 3283 $r->print('</div>');
|
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
return OK; |
return OK; |
} |
} |
|
|
sub generate_admin_options { |
sub generate_admin_options { |
my ($containertag,$uploadtag,$help_ref,$env_ref) = @_; |
my ($containertag,$uploadtag,$help_ref,$env_ref) = @_; |
Line 3320 sub generate_admin_options {
|
Line 3299 sub generate_admin_options {
|
my $exportbut=&exportbutton(); |
my $exportbut=&exportbutton(); |
return (<<ENDOPTIONFORM); |
return (<<ENDOPTIONFORM); |
<form action="/adm/coursedocs" method="post" name="courseverify"> |
<form action="/adm/coursedocs" method="post" name="courseverify"> |
<ul style="list-style-type:none"> |
<input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'}<br /> |
<li> |
<input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'}<br /> |
<input type="submit" name="verify" value="$lt{'vc'}" />$help{'Verify_Content'} |
|
</li> |
|
<li> |
|
<input type="submit" name="versions" value="$lt{'cv'}" />$help{'Check_Resource_Versions'} |
|
</li> |
|
<li> |
|
$dumpbut |
$dumpbut |
</li> |
|
<li> |
|
$exportbut |
$exportbut |
</li> |
|
<li> |
|
<input type="submit" name="listsymbs" value="$lt{'ls'}" /> |
<input type="submit" name="listsymbs" value="$lt{'ls'}" /> |
</li> |
<input type="hidden" name="folder" value="$env{'form.folder'}" /><br /> |
<li> |
|
<input type="hidden" name="folder" value="$env{'form.folder'}" /> |
|
<input type="submit" name="docslog" value="$lt{'sl'}" /> |
<input type="submit" name="docslog" value="$lt{'sl'}" /> |
</li> |
|
</ul> |
|
</form> |
</form> |
<!-- <div style="clear: both; height: 0px;"> </div>--> |
|
ENDOPTIONFORM |
ENDOPTIONFORM |
|
|
} |
} |
|
|
|
|
sub generate_edit_table { |
sub generate_edit_table { |
my ($tid,$content,$navigation,$varcd,$namehash_ref,$orderhash_ref) = @_; |
my ($tid,$varcd,$orderhash_ref) = @_; |
my %namehash = %{$namehash_ref}; #name verlinkt mit id |
my %orderhash = %{$orderhash_ref}; |
my %orderhash = %{$orderhash_ref}; #name mit kürzel verlinkt mit name |
|
my $form; |
my $form; |
|
|
|
|
|
|
$form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>'; |
$form = '<div class="LC_ContentBoxSpecial"><h4 class="LC_hcell">'.&mt($varcd).'</h4>'; |
$form .= '<ul id="'.$navigation.$tid.'" class="LC_TabContent">'; |
$form .= '<ul id="navigation'.$tid.'" class="LC_TabContent">'; |
foreach my $name (sort(keys(%orderhash))){ |
foreach my $name (sort(keys(%orderhash))){ |
if($name eq 'zz'){ |
if($name eq 'zz'){ |
$form .= '<li onclick="javascript:hideAll(this, \''.$navigation.$tid.'\' ,\''.$content.$tid.'\');" class="active">'.&mt($orderhash{$name}).'</li>'; |
$form .= '<span class="LC_Right"><li onclick="javascript:hideAll(this, \'navigation'.$tid.'\' ,\'content'.$tid.'\');" class="active">'.&mt(${$orderhash{$name}}[0]).'</li></span>'; |
}else{ |
}else{ |
$form .= '<li onclick="javascript:showPage(this, \''.$tid.$orderhash{$name}.'\', \''.$navigation.$tid.'\',\''.$content.$tid.'\');">'.&mt($orderhash{$name}).'</li>'; |
$form .= '<li onclick="javascript:showPage(this, \''.substr(${$orderhash{$name}}[0],0,3).$tid.'\', \'navigation'.$tid.'\',\'content'.$tid.'\');">'.&mt(${$orderhash{$name}}[0]).'</li>'; |
|
} |
|
} |
|
$form .= '</ul>'; |
|
$form .= '<div id="content'.$tid.'" style="padding: 0 0; margin: 0 0;">'; |
|
foreach my $field (keys(%orderhash)){ |
|
if($field ne 'zz'){ |
|
$form .= '<div id="'.substr(${$orderhash{$field}}[0],0,3).$tid.'" class="LC_ContentBox" style="display: none;">'.${$orderhash{$field}}[1].'</div>'; |
} |
} |
} |
} |
$form .= '<div id="'.$content.$tid.'" style="padding: 0 0; margin: 0 0;">'; |
|
foreach my $field (keys(%namehash)){ |
|
$form .= '<div id="'.$tid.$field.'" class="LC_ContentBox" style="display: none;">'.$namehash{$field}.'</div>'; |
|
} |
|
$form .= '</div></div>'; |
$form .= '</div></div>'; |
|
|
return $form; |
return $form; |
} |
} |
|
|
Line 3383 sub editing_js {
|
Line 3347 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 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 Discussion 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 Personal Information Page", |
p_mab2 => "About [_99]", |
p_mab2 => 'Personal Information Page of ', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt1 => 'Not a valid user:domain', |
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_mab_alrt2 => 'Please enter both user and domain in the format user:domain', |
p_chn => 'New Title', |
p_chn => 'New Title', |
Line 3436 function edittext(targetname,residx,titl
|
Line 3400 function edittext(targetname,residx,titl
|
|
|
function makeexamupload() { |
function makeexamupload() { |
var title=prompt('$lt{"p_mxu"}'); |
var title=prompt('$lt{"p_mxu"}'); |
if (title) { |
if (title) { |
this.document.forms.newexamupload.importdetail.value= |
this.document.forms.newexamupload.importdetail.value= |
escape(title)+'=/res/lib/templates/examupload.problem'; |
escape(title)+'=/res/lib/templates/examupload.problem'; |
this.document.forms.newexamupload.submit(); |
this.document.forms.newexamupload.submit(); |
Line 3445 function makeexamupload() {
|
Line 3409 function makeexamupload() {
|
|
|
function makesmppage() { |
function makesmppage() { |
var title=prompt('$lt{"p_msp"}'); |
var title=prompt('$lt{"p_msp"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmppg.importdetail.value= |
this.document.forms.newsmppg.importdetail.value= |
escape(title)+'=/adm/$udom/$uname/$now/smppg'; |
escape(title)+'=/adm/$udom/$uname/$now/smppg'; |
this.document.forms.newsmppg.submit(); |
this.document.forms.newsmppg.submit(); |
Line 3454 function makesmppage() {
|
Line 3418 function makesmppage() {
|
|
|
function makesmpproblem() { |
function makesmpproblem() { |
var title=prompt('$lt{"p_msb"}'); |
var title=prompt('$lt{"p_msb"}'); |
if (title) { |
if (title) { |
this.document.forms.newsmpproblem.importdetail.value= |
this.document.forms.newsmpproblem.importdetail.value= |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
escape(title)+'=/res/lib/templates/simpleproblem.problem'; |
this.document.forms.newsmpproblem.submit(); |
this.document.forms.newsmpproblem.submit(); |
Line 3463 function makesmpproblem() {
|
Line 3427 function makesmpproblem() {
|
|
|
function makedropbox() { |
function makedropbox() { |
var title=prompt('$lt{"p_mdb"}'); |
var title=prompt('$lt{"p_mdb"}'); |
if (title) { |
if (title) { |
this.document.forms.newdropbox.importdetail.value= |
this.document.forms.newdropbox.importdetail.value= |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
escape(title)+'=/res/lib/templates/DropBox.problem'; |
this.document.forms.newdropbox.submit(); |
this.document.forms.newdropbox.submit(); |
Line 3629 Available help topics
|
Line 3593 Available help topics
|
|
|
=item mapread() |
=item mapread() |
|
|
Mapread read maps into LONCAPA::map:: global arrays |
Mapread read maps into LONCAPA::map:: global arrays |
@order and @resources, determines status |
@order and @resources, determines status |
sets @order - pointer to resources in right order |
sets @order - pointer to resources in right order |
sets @resources - array with the resources with correct idx |
sets @resources - array with the resources with correct idx |