version 1.363, 2009/04/07 20:48:40
|
version 1.364, 2009/04/15 12:44:24
|
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 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 859 sub extract_media {
|
Line 859 sub extract_media {
|
$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 924 sub group_import {
|
Line 924 sub group_import {
|
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 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 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 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); |
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 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 1811 sub entryline {
|
Line 1811 sub entryline {
|
} |
} |
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//}; |
$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/}); |
Line 1932 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 2045 sub tiehash {
|
Line 2045 sub tiehash {
|
$hashtied=1; |
$hashtied=1; |
} |
} |
} |
} |
} |
} |
} |
} |
|
|
sub untiehash { |
sub untiehash { |
Line 2394 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 2619 sub handler {
|
Line 2619 sub handler {
|
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) { |
Line 2653 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); |
Line 2722 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})) { |
Line 3100 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 3260 my $error = &editor($r,$coursenum,$cours
|
Line 3260 my $error = &editor($r,$coursenum,$cours
|
$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>'); |
$r->print('</div>'); |
if ($allowed) { |
if ($allowed) { |
$r->print(' |
$r->print(' |
Line 3283 $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 3334 sub generate_edit_table {
|
Line 3334 sub generate_edit_table {
|
} |
} |
} |
} |
$form .= '</div></div>'; |
$form .= '</div></div>'; |
|
|
return $form; |
return $form; |
} |
} |
|
|