--- loncom/interface/londocs.pm 2009/10/20 20:23:23 1.399
+++ loncom/interface/londocs.pm 2009/10/30 19:50:24 1.406
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.399 2009/10/20 20:23:23 droeschl Exp $
+# $Id: londocs.pm,v 1.406 2009/10/30 19:50:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2582,7 +2582,7 @@ sub init_breadcrumbs {
my ($form,$text)=@_;
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs",
- text=>"Edit ".&Apache::loncommon::course_type(),
+ text=>&Apache::loncommon::course_type().' Editor',
faq=>273,
bug=>'Instructor Interface',
help => 'Docs_Adding_Course_Doc'});
@@ -2698,7 +2698,9 @@ sub handler {
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) {
$showdoc='/'.$1;
}
- unless ($showdoc) { # got called from remote
+ if ($showdoc) { # got called in sequence from course
+ $allowed=0;
+ } else {
if (($env{'form.folder'}=~/^(?:group|default)_/) ||
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) {
$forcestandard = 1;
@@ -2709,8 +2711,6 @@ sub handler {
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['cmd']);
$script=&Apache::lonratedt::editscript('simple');
}
- } else { # got called in sequence from course
- $allowed=0;
}
# subroutine to list form elements
@@ -2769,6 +2769,9 @@ sub create_form_ul {
'Editing the Table of Contents for your '.$type,
'Docs_Adding_Course_Doc')
);
+ } elsif ($showdoc) {
+ $r->print(&Apache::loncommon::start_page("$type documents",undef,
+ {'force_register' => $showdoc,}));
} else {
my $folder=$env{'form.folder'};
if ($folder eq '' || $folder eq 'supplemental') {
@@ -2900,7 +2903,7 @@ sub create_form_ul {
'file' => 'File',
'title' => 'Title',
'comment' => 'Comment',
- 'parse' => 'Upload embedded images/multimedia files if HTML file!',
+ 'parse' => 'Upload embedded images/multimedia files if HTML file',
'nd' => 'Upload Document',
'pm' => 'Published Map',
'sd' => 'Special Document',
@@ -3272,7 +3275,6 @@ my %orderhash = (
'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)],
);
my $tid='1';
-my $varcd = 'Main Course Documents';
$hadchanges=0;
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
if ($error) {
@@ -3283,7 +3285,7 @@ my $varcd = 'Main Course Documents';
}
&changewarning($r,'');
-$r->print(&generate_edit_table($tid,$varcd,\%orderhash));
+$r->print(&generate_edit_table($tid,\%orderhash));
$r->print('');
}
@@ -3314,9 +3316,7 @@ $r->print('');
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"');
- my @supupdocform = (
- {'
'=>"$help{'Uploading_From_Harddrive'}"},
- );
+ my $supupdocformbtn = "$help{'Uploading_From_Harddrive'}";
my $supupdocform=(<
@@ -3333,7 +3333,7 @@ $r->print('');
SUPDOCFORM
- $supupdocform .= create_form_ul(create_list_elements(@supupdocform))."";
+ $supupdocform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."";
my $supnewfolderform=(<
@@ -3394,8 +3394,7 @@ my %suporderhash = (
$r->print(''.$error.'
');
}
my $tid='2';
- my $varscd = 'Supplemental Course Documents';
- $r->print(&generate_edit_table($tid,$varscd,\%suporderhash));
+ $r->print(&generate_edit_table($tid,\%suporderhash));
} else {
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type);
if ($error) {
@@ -3460,7 +3459,8 @@ sub generate_admin_options {
sub generate_edit_table {
- my ($tid,$varcd,$orderhash_ref) = @_;
+ my ($tid,$orderhash_ref) = @_;
+ return unless(ref($orderhash_ref) eq 'HASH');
my %orderhash = %{$orderhash_ref};
my $form;
my $activetab;