--- loncom/interface/londocs.pm 2010/12/25 04:40:15 1.434.2.3 +++ loncom/interface/londocs.pm 2011/01/17 20:18:02 1.449 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.434.2.3 2010/12/25 04:40:15 raeburn Exp $ +# $Id: londocs.pm,v 1.449 2011/01/17 20:18:02 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1521,12 +1521,11 @@ sub editor { $LONCAPA::map::resources[$idx]=''; } - my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order); - if ($allowed) { - ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = + my ($breadcrumbtrail,$randompick,$ishidden,$isencrypted,$plain,$is_random_order) = &breadcrumbs($allowed,$crstype); $r->print($breadcrumbtrail); - } else { + + unless ($allowed) { $randompick = -1; } @@ -1653,7 +1652,8 @@ sub editor { &Apache::loncommon::end_data_table_count(); if ($shown) { - $r->print(&Apache::loncommon::start_data_table()); + $r->print(&Apache::loncommon::start_scrollbox('900px','880px','400px') + .&Apache::loncommon::start_data_table()); if ($allowed) { $r->print(&Apache::loncommon::start_data_table_header_row() .'
' @@ -1721,7 +1722,7 @@ sub process_file_upload { $destination .= $newidx; my $url=&Apache::lonnet::userfileupload('uploaddoc','coursedoc',$destination, $parseaction,$allfiles, - $codebase,undef,undef,undef,undef, + $codebase,undef,undef,undef,undef, undef,undef,\$mimetype); if ($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E.*/([^/]+)$}) { my $stored = $1; @@ -1729,7 +1730,7 @@ sub process_file_upload { $stored.'').'
'; } else { my ($filename) = ($env{'form.uploaddoc.filename'} =~ m{([^/]+)$}); - + $$upload_output = ''.&mt('Unable to save file [_1].',''.$filename.'').'
'; return; } @@ -1758,14 +1759,14 @@ sub process_file_upload { if ($total_embedded > 0) { my $uploadphase = 'upload_embedded'; my $primaryurl = &HTML::Entities::encode($url,'<>&"'); - my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); - my ($embedded,$num) = + my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); + my ($embedded,$num) = &Apache::loncommon::ask_for_embedded_content( '/adm/coursedocs',$state,$allfiles,$codebase,{'docs_url' => $url}); if ($embedded) { if ($num) { $$upload_output .= - ''.&mt('This file contains embedded multimedia objects, which need to be uploaded.').'
'.$embedded; + ''.&mt('This file contains embedded multimedia objects, which need to be uploaded.').'
'.$embedded; $nextphase = $uploadphase; } else { $$upload_output .= $embedded; @@ -2238,6 +2239,7 @@ sub list_symbs { my $crstype = &Apache::loncommon::course_type(); $r->print(&Apache::loncommon::start_page('Symb List')); $r->print(&Apache::lonhtmlcommon::breadcrumbs('Symb List')); + &startContentScreen($r,'tools'); my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { $r->print(''.&mt('Done').'
' - .'' - .&mt('Back to Course Editor') - .'
' - ); + $r->print(''.&mt('Done').'
'); } @@ -2300,6 +2296,8 @@ sub checkversions { my $crstype = &Apache::loncommon::course_type(); $r->print(&Apache::loncommon::start_page("Check $crstype Document Versions")); $r->print(&Apache::lonhtmlcommon::breadcrumbs("Check $crstype Document Versions")); + &startContentScreen($r,'tools'); + my $header=''; my $startsel=''; my $monthsel=''; @@ -2610,8 +2608,66 @@ sub init_breadcrumbs { bug=>'Instructor Interface'}); } +# subroutine to list form elements +sub create_list_elements { + my @formarr = @_; + my $list = ''; + for my $button (@formarr){ + for my $picture(keys %$button) { + $list .= &Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); + } + } + return $list; +} +# subroutine to create ul from list elements +sub create_form_ul { + my $list = shift; + my $ul = &Apache::lonhtmlcommon::htmltag('ul',$list, {class => 'LC_ListStyleNormal'}); + return $ul; +} + +# +# Start tabs +# + +sub startContentScreen { + my ($r,$mode)=@_; + $r->print(' '); + $r->print('
@@ -2962,14 +3016,15 @@ SEDFFORM
SEDFFORM
- my $extresourcesform=(< '.$error.' '.$error.' '.$error.' '.$error.' '.$error.'
');
- }
- $r->print('
' . $fileuploadform;
+ $fileuploadform = &create_form_ul(&create_list_elements(@importdoc)) . '
' . $fileuploadform;
push @specialdocumentsforma, ({''=>$newnavform},
{''=>$newsmppageform},
@@ -3246,7 +3265,7 @@ NGFFORM
{''=>$newaboutsomeoneform},
{''=>$newrosterform},);
- $specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma));
+ $specialdocumentsform = &create_form_ul(&create_list_elements(@specialdocumentsforma));
}
if($env{'form.pagepath'}) {
@@ -3255,54 +3274,50 @@ if($env{'form.pagepath'}) {
{''=>$newsmpproblemform},
{''=>$newexuploadform}
);
- $specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma));
+ $specialdocumentsform= &create_form_ul(&create_list_elements(@specialdocumentsforma));
}
my @tools = (
# {''=>$extresourcesform},
# {''=>$imspform},
- {''=>$recoverform},
+ {''=>$recoverform},
);
my %orderhash = (
'aa' => ['Import Documents',$fileuploadform],
'bb' => ['Published Resources',$simpleeditdefaultform],
'cc' => ['Special Documents',$specialdocumentsform],
- 'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options(\%help,\%env)],
+ 'dd' => ['Tools', &create_form_ul(&create_list_elements(@tools)).&generate_admin_options(\%help,\%env)],
);
unless($env{'form.pagepath'}) {
$orderhash{'00'} = ['Newfolder',$newfolderform];
}
-my $tid='1';
$hadchanges=0;
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
- if ($error) {
- $r->print('
' . $supupdocform;
+$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)) . '
' . $supupdocform;
my %suporderhash = (
'00' => ['Supnewfolder', $supnewfolderform],
'ee' => ['Import Documents',$supupdocform],
- 'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))]
+ 'ff' => ['Special Documents',&create_form_ul(&create_list_elements(@specialdocs))]
);
-
- my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype);
- if ($error) {
- $r->print('