version 1.484.2.33, 2013/05/21 13:02:50
|
version 1.484.2.38, 2013/08/17 00:59:32
|
Line 56 my $hashtied;
|
Line 56 my $hashtied;
|
my %alreadyseen=(); |
my %alreadyseen=(); |
|
|
my $hadchanges; |
my $hadchanges; |
|
my $suppchanges; |
|
|
|
|
my %help=(); |
my %help=(); |
Line 79 sub storemap {
|
Line 80 sub storemap {
|
$map,1,$report); |
$map,1,$report); |
if ($errtext) { return ($errtext,2); } |
if ($errtext) { return ($errtext,2); } |
|
|
$hadchanges=1; |
if ($map =~ /^default/) { |
|
$hadchanges=1; |
|
} else { |
|
$suppchanges=1; |
|
} |
return ($errtext,0); |
return ($errtext,0); |
} |
} |
|
|
Line 402 END
|
Line 407 END
|
} |
} |
my ($errtext,$fatal) = |
my ($errtext,$fatal) = |
&storemap($coursenum, $coursedom, $folder.'.'.$container,1); |
&storemap($coursenum, $coursedom, $folder.'.'.$container,1); |
|
unless ($fatal) { |
|
if ($folder =~ /^supplemental/) { |
|
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
|
} |
|
} |
return ($errtext,$fatal,$fixuperrors); |
return ($errtext,$fatal,$fixuperrors); |
} |
} |
|
|
Line 1615 sub dbcopy {
|
Line 1625 sub dbcopy {
|
&mt('There was a problem removing a lockfile.'); |
&mt('There was a problem removing a lockfile.'); |
if ($prefix eq 'smppg') { |
if ($prefix eq 'smppg') { |
$lockerrorsref->{$prefix} .= |
$lockerrorsref->{$prefix} .= |
&mt('This will prevent creation of additional simple pages in this course.'); |
' '.&mt('This will prevent creation of additional simple pages in this course.'); |
} else { |
} else { |
$lockerrorsref->{$prefix} .= &mt('This will prevent creation of additional bulletin boards in this course.'); |
$lockerrorsref->{$prefix} .= ' '.&mt('This will prevent creation of additional bulletin boards in this course.'); |
} |
} |
$lockerrorsref->{$prefix} .= &mt('Please contact the domain coordinator for your LON-CAPA domain.').'</div>'; |
$lockerrorsref->{$prefix} .= ' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.', |
|
'<a href="/adm/helpdesk" target="_helpdesk">','</a>'). |
|
'</div>'; |
} |
} |
} |
} |
} elsif ($url =~ m{/syllabus$}) { |
} elsif ($url =~ m{/syllabus$}) { |
Line 2704 sub editor {
|
Line 2716 sub editor {
|
} |
} |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll') |
.'<div class="LC_info" id="contentlist">' |
.'<div class="LC_info" id="contentlist">' |
.&mt('Currently no documents.') |
.&mt('Currently empty') |
.'</div>' |
.'</div>' |
.&Apache::loncommon::end_scrollbox(); |
.&Apache::loncommon::end_scrollbox(); |
} |
} |
Line 2717 sub editor {
|
Line 2729 sub editor {
|
.'</div>'; |
.'</div>'; |
} else { |
} else { |
$to_show = '<div class="LC_info" id="contentlist">' |
$to_show = '<div class="LC_info" id="contentlist">' |
.&mt('Currently no documents.') |
.&mt('Currently empty') |
.'</div>' |
.'</div>' |
} |
} |
} |
} |
Line 2802 sub multiple_check_form {
|
Line 2814 sub multiple_check_form {
|
} |
} |
|
|
sub process_file_upload { |
sub process_file_upload { |
my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_; |
my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd,$crstype) = @_; |
# upload a file, if present |
# upload a file, if present |
|
my $filesize = length($env{'form.uploaddoc'}); |
|
if (!$filesize) { |
|
$$upload_output = '<div class="LC_error">'. |
|
&mt('Unable to upload [_1]. (size = [_2] bytes)', |
|
'<span class="LC_filename">'.$env{'form.uploaddoc.filename'}.'</span>', |
|
$filesize).'<br />'. |
|
&mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'<br />'. |
|
'</div>'; |
|
return; |
|
} |
|
my $quotatype = 'unofficial'; |
|
if ($crstype eq 'Community') { |
|
$quotatype = 'community'; |
|
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) { |
|
$quotatype = 'official'; |
|
} |
|
if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) { |
|
$filesize = int($filesize/1000); #expressed in kb |
|
$$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course', |
|
$env{'form.uploaddoc.filename'},$filesize,'upload'); |
|
return if ($$upload_output); |
|
} |
my ($parseaction,$showupload,$nextphase,$mimetype); |
my ($parseaction,$showupload,$nextphase,$mimetype); |
if ($env{'form.parserflag'}) { |
if ($env{'form.parserflag'}) { |
$parseaction = 'parse'; |
$parseaction = 'parse'; |
Line 3123 ENDREM
|
Line 3157 ENDREM
|
push(@{$filtersref->{'canremove'}},$orderidx); |
push(@{$filtersref->{'canremove'}},$orderidx); |
} |
} |
} |
} |
unless ($isexternal) { |
$renamelink=(<<ENDREN); |
$renamelink=(<<ENDREN); |
|
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
<a href='javascript:changename("$esc_path","$index","$renametitle");' class="LC_docs_rename">$lt{'rn'}</a> |
ENDREN |
ENDREN |
} |
|
$line.=(<<END); |
$line.=(<<END); |
<td> |
<td> |
<div class="LC_docs_entry_move"> |
<div class="LC_docs_entry_move"> |
Line 3486 sub new_timebased_suffix {
|
Line 3518 sub new_timebased_suffix {
|
} |
} |
unless ($type eq 'paste') { |
unless ($type eq 'paste') { |
$locknotfreed .= |
$locknotfreed .= |
' '.&mt('Please contact the domain coordinator for your LON-CAPA domain.'); |
' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.', |
|
'<a href="/adm/helpdesk" target="_helpdesk">','</a>'); |
} |
} |
$locknotfreed .= '</div>'; |
$locknotfreed .= '</div>'; |
} |
} |
Line 3651 sub list_symbs {
|
Line 3684 sub list_symbs {
|
sub verifycontent { |
sub verifycontent { |
my ($r) = @_; |
my ($r) = @_; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
$r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Documents')); |
$r->print(&Apache::loncommon::start_page('Verify '.$crstype.' Content')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Documents')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Verify '.$crstype.' Content')); |
$r->print(&startContentScreen('tools')); |
$r->print(&startContentScreen('tools')); |
$r->print('<h4 class="LC_info">'.&mt($crstype.' content verification').'</h4>'); |
$r->print('<h4 class="LC_info">'.&mt($crstype.' content verification').'</h4>'); |
$hashtied=0; |
$hashtied=0; |
Line 3754 sub checkversions {
|
Line 3787 sub checkversions {
|
&changewarning($r,''); |
&changewarning($r,''); |
if ($env{'form.timerange'} eq 'all') { |
if ($env{'form.timerange'} eq 'all') { |
# show all documents |
# show all documents |
$header=&mt('All Documents in '.$crstype); |
$header=&mt('All content in '.$crstype); |
$allsel=' selected="selected"'; |
$allsel=' selected="selected"'; |
foreach my $key (keys(%hash)) { |
foreach my $key (keys(%hash)) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
if ($key=~/^ids\_(\/res\/.+)$/) { |
Line 4031 sub startContentScreen {
|
Line 4064 sub startContentScreen {
|
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
$output .= '<li'.(($mode eq 'coursesearch')?' class="active"':'').'><a href="/adm/searchcourse"><b> '.&mt('Content Search').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/supplemental"><b>'.&mt('Supplemental Content').'</b></a></li>'; |
} else { |
} else { |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'docs')?' class="active"':'').' id="tabbededitor"><a href="/adm/coursedocs?forcestandard=1"><b> '.&mt('Main Content Editor').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Content Editor').'</b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'suppdocs')?' class="active"':'').'><a href="/adm/coursedocs?forcesupplement=1"><b>'.&mt('Supplemental Content Editor').'</b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'tools')?' class="active"':'').'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'."\n"; |
$output .= '<li '.(($mode eq 'tools')?' class="active"':'').'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'."\n"; |
'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'; |
'><a href="/adm/coursedocs?tools=1"><b> '.&mt('Content Utilities').' </b></a></li>'; |
Line 4077 sub handler {
|
Line 4110 sub handler {
|
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Supplemental','Score_Upload_Form','Adding_Pages', |
'Importing_LON-CAPA_Resource','Importing_IMS_Course', |
'Importing_LON-CAPA_Resource','Importing_IMS_Course', |
'Uploading_From_Harddrive', |
'Uploading_From_Harddrive', |
'Check_Resource_Versions','Verify_Content') { |
'Check_Resource_Versions','Verify_Content', |
|
'Course_Roster','Web_Page','Dropbox') { |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
$help{$topic}=&Apache::loncommon::help_open_topic('Docs_'.$topic); |
} |
} |
# Composite help files |
# Composite help files |
Line 4093 sub handler {
|
Line 4127 sub handler {
|
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages'); |
'Docs_About_My_Personal_Info,Docs_Editing_Templated_Pages'); |
$help{'Group Portfolio'} = &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'); |
$help{'Course Roster'} = &Apache::loncommon::help_open_topic('Docs_Course_Roster'); |
|
$help{'Web Page'} = &Apache::loncommon::help_open_topic('Docs_Web_Page'); |
|
|
|
my $allowed; |
my $allowed; |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
# URI is /adm/supplemental when viewing supplemental docs in non-edit mode. |
Line 4359 sub handler {
|
Line 4391 sub handler {
|
# Process file upload - phase one - upload and parse primary file. |
# Process file upload - phase one - upload and parse primary file. |
undef($hadchanges); |
undef($hadchanges); |
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom, |
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom, |
\%allfiles,\%codebase,$context); |
\%allfiles,\%codebase,$context,$crstype); |
if ($hadchanges) { |
if ($hadchanges) { |
&mark_hash_old(); |
&mark_hash_old(); |
} |
} |
Line 4411 sub handler {
|
Line 4443 sub handler {
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'copm' => 'All documents out of a published map into this folder', |
'copm' => 'All documents out of a published map into this folder', |
'upfi' => 'Upload File', |
'upfi' => 'Upload File', |
'upld' => 'Import Content', |
'upld' => 'Upload Content', |
'srch' => 'Search', |
'srch' => 'Search', |
'impo' => 'Import', |
'impo' => 'Import', |
'lnks' => 'Import from Stored Links', |
'lnks' => 'Import from Stored Links', |
Line 4432 sub handler {
|
Line 4464 sub handler {
|
'grpo' => 'Group Portfolio', |
'grpo' => 'Group Portfolio', |
'rost' => 'Course Roster', |
'rost' => 'Course Roster', |
'abou' => 'Personal Information Page for a User', |
'abou' => 'Personal Information Page for a User', |
'imsf' => 'IMS Import', |
'imsf' => 'IMS Upload', |
'imsl' => 'Import IMS package', |
'imsl' => 'Upload IMS package', |
'cms' => 'Origin of IMS package', |
'cms' => 'Origin of IMS package', |
'se' => 'Select', |
'se' => 'Select', |
'file' => 'File', |
'file' => 'File', |
Line 4637 NSPROBFORM
|
Line 4669 NSPROBFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="" /> |
<input type="hidden" name="importdetail" value="" /> |
<a class="LC_menubuttons_link" href="javascript:makedropbox();">$lt{'drbx'}</a> |
<a class="LC_menubuttons_link" href="javascript:makedropbox();">$lt{'drbx'}</a> |
|
$help{'Dropbox'} |
</form> |
</form> |
NDBFORM |
NDBFORM |
|
|
Line 4687 NASOFORM
|
Line 4720 NASOFORM
|
<input type="hidden" name="importdetail" |
<input type="hidden" name="importdetail" |
value="$lt{'rost'}=/adm/viewclasslist" /> |
value="$lt{'rost'}=/adm/viewclasslist" /> |
<a class="LC_menubuttons_link" href="javascript:document.newroster.submit()">$lt{'rost'}</a> |
<a class="LC_menubuttons_link" href="javascript:document.newroster.submit()">$lt{'rost'}</a> |
$help{'Course Roster'} |
$help{'Course_Roster'} |
</form> |
</form> |
NROSTFORM |
NROSTFORM |
|
|
Line 4707 NROSTFORM
|
Line 4740 NROSTFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="$newwebpage" /> |
<input type="hidden" name="importdetail" value="$newwebpage" /> |
<a class="LC_menubuttons_link" href="javascript:makewebpage();">$lt{'webp'}</a> |
<a class="LC_menubuttons_link" href="javascript:makewebpage();">$lt{'webp'}</a> |
$help{'Web Page'} |
$help{'Web_Page'} |
</form> |
</form> |
NWEBFORM |
NWEBFORM |
|
|
Line 4784 NGFFORM
|
Line 4817 NGFFORM
|
); |
); |
} |
} |
push(@importdoc, |
push(@importdoc, |
{'<img class="LC_noBorder_LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'doc\');" />'=>$fileuploadform} |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/pdfupload.png" alt="'.$lt{upl}.'" onclick="javascript:toggleUpload(\'doc\');" />'=>$fileuploadform} |
); |
); |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)); |
|
|
Line 4806 NGFFORM
|
Line 4839 NGFFORM
|
$communityform = &create_form_ul(&create_list_elements(@communityforma)); |
$communityform = &create_form_ul(&create_list_elements(@communityforma)); |
|
|
my %orderhash = ( |
my %orderhash = ( |
'aa' => ['Import Content',$fileuploadform], |
'aa' => ['Upload',$fileuploadform], |
'bb' => ['Published Content',$importpubform], |
'bb' => ['Import',$importpubform], |
'cc' => ['Grading Resources',$gradingform], |
'cc' => ['Grading',$gradingform], |
); |
); |
unless ($container eq 'page') { |
unless ($container eq 'page') { |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
$orderhash{'dd'} = ['Collaboration',$communityform]; |
$orderhash{'dd'} = ['Collaboration',$communityform]; |
$orderhash{'ee'} = ['Special Pages',$specialdocumentsform]; |
$orderhash{'ee'} = ['Other',$specialdocumentsform]; |
} |
} |
|
|
$hadchanges=0; |
$hadchanges=0; |
Line 4924 SNAMFORM
|
Line 4957 SNAMFORM
|
$pathitem |
$pathitem |
<input type="hidden" name="importdetail" value="$supwebpage" /> |
<input type="hidden" name="importdetail" value="$supwebpage" /> |
<a class="LC_menubuttons_link" href="javascript:makewebpage('supp');">$lt{'webp'}</a> |
<a class="LC_menubuttons_link" href="javascript:makewebpage('supp');">$lt{'webp'}</a> |
$help{'Web Page'} |
$help{'Web_Page'} |
</form> |
</form> |
SWEBFORM |
SWEBFORM |
|
|
Line 4947 my @supimportdoc = (
|
Line 4980 my @supimportdoc = (
|
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)); |
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)); |
my %suporderhash = ( |
my %suporderhash = ( |
'00' => ['Supnewfolder', $supnewfolderform], |
'00' => ['Supnewfolder', $supnewfolderform], |
'ee' => ['Import Content',$supupdocform], |
'ee' => ['Upload',$supupdocform], |
'ff' => ['Special Pages',&create_form_ul(&create_list_elements(@specialdocs))] |
'ff' => ['Other',&create_form_ul(&create_list_elements(@specialdocs))] |
); |
); |
if ($supplementalflag) { |
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
$supplementalflag,\%suporderhash,$iconpath,$pathitem); |
$supplementalflag,\%suporderhash,$iconpath,$pathitem); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
|
} else { |
|
if ($suppchanges) { |
|
my %servers = &Apache::lonnet::internet_dom_servers($coursedom); |
|
my @ids=&Apache::lonnet::current_machine_ids(); |
|
foreach my $server (keys(%servers)) { |
|
next if (grep(/^\Q$server\E$/,@ids)); |
|
my $hashid=$coursenum.':'.$coursedom; |
|
&Apache::lonnet::remote_devalidate_cache($server,'suppcount',$hashid); |
|
} |
|
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
|
undef($suppchanges); |
|
} |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |