version 1.399, 2009/10/20 20:23:23
|
version 1.406, 2009/10/30 19:50:24
|
Line 2582 sub init_breadcrumbs {
|
Line 2582 sub init_breadcrumbs {
|
my ($form,$text)=@_; |
my ($form,$text)=@_; |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", |
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/coursedocs", |
text=>"Edit ".&Apache::loncommon::course_type(), |
text=>&Apache::loncommon::course_type().' Editor', |
faq=>273, |
faq=>273, |
bug=>'Instructor Interface', |
bug=>'Instructor Interface', |
help => 'Docs_Adding_Course_Doc'}); |
help => 'Docs_Adding_Course_Doc'}); |
Line 2698 sub handler {
|
Line 2698 sub handler {
|
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { |
if ($r->uri=~/^\/adm\/coursedocs\/showdoc\/(.*)$/) { |
$showdoc='/'.$1; |
$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)_/) || |
if (($env{'form.folder'}=~/^(?:group|default)_/) || |
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) { |
($env{'form.folder'} =~ m:^\d+/(pages|sequences)/:)) { |
$forcestandard = 1; |
$forcestandard = 1; |
Line 2709 sub handler {
|
Line 2711 sub handler {
|
&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 |
|
$allowed=0; |
|
} |
} |
|
|
# subroutine to list form elements |
# subroutine to list form elements |
Line 2769 sub create_form_ul {
|
Line 2769 sub create_form_ul {
|
'Editing the Table of Contents for your '.$type, |
'Editing the Table of Contents for your '.$type, |
'Docs_Adding_Course_Doc') |
'Docs_Adding_Course_Doc') |
); |
); |
|
} elsif ($showdoc) { |
|
$r->print(&Apache::loncommon::start_page("$type documents",undef, |
|
{'force_register' => $showdoc,})); |
} else { |
} else { |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
if ($folder eq '' || $folder eq 'supplemental') { |
if ($folder eq '' || $folder eq 'supplemental') { |
Line 2900 sub create_form_ul {
|
Line 2903 sub create_form_ul {
|
'file' => 'File', |
'file' => 'File', |
'title' => 'Title', |
'title' => 'Title', |
'comment' => 'Comment', |
'comment' => 'Comment', |
'parse' => 'Upload embedded images/multimedia files if HTML file!', |
'parse' => 'Upload embedded images/multimedia files if HTML file', |
'nd' => 'Upload Document', |
'nd' => 'Upload Document', |
'pm' => 'Published Map', |
'pm' => 'Published Map', |
'sd' => 'Special Document', |
'sd' => 'Special Document', |
Line 3272 my %orderhash = (
|
Line 3275 my %orderhash = (
|
'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)], |
'dd' => ['Tools', create_form_ul(create_list_elements(@tools)).&generate_admin_options($containertag,$uploadtag,\%help,\%env)], |
); |
); |
my $tid='1'; |
my $tid='1'; |
my $varcd = 'Main Course Documents'; |
|
$hadchanges=0; |
$hadchanges=0; |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
Line 3283 my $varcd = 'Main Course Documents';
|
Line 3285 my $varcd = 'Main Course Documents';
|
} |
} |
|
|
&changewarning($r,''); |
&changewarning($r,''); |
$r->print(&generate_edit_table($tid,$varcd,\%orderhash)); |
$r->print(&generate_edit_table($tid,\%orderhash)); |
|
|
$r->print('</div>'); |
$r->print('</div>'); |
} |
} |
Line 3314 $r->print('</div>');
|
Line 3316 $r->print('</div>');
|
|
|
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
my $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
|
|
my @supupdocform = ( |
my $supupdocformbtn = "<input type='submit' value='".$lt{'upld'}."' />$help{'Uploading_From_Harddrive'}"; |
{'<img class="LC_noBorder LC_middle" align="left" src="/res/adm/pages/docspacer.gif" alt="pic27" />'=>"<input type='submit' value='".$lt{'upld'}."' />$help{'Uploading_From_Harddrive'}"}, |
|
); |
|
my $supupdocform=(<<SUPDOCFORM); |
my $supupdocform=(<<SUPDOCFORM); |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="ee" /> |
Line 3333 $r->print('</div>');
|
Line 3333 $r->print('</div>');
|
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="folderpath" value="$path" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
<input type="hidden" name="cmd" value="upload_supplemental" /> |
SUPDOCFORM |
SUPDOCFORM |
$supupdocform .= create_form_ul(create_list_elements(@supupdocform))."</form>"; |
$supupdocform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."</form>"; |
|
|
my $supnewfolderform=(<<SNFFORM); |
my $supnewfolderform=(<<SNFFORM); |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
<form action="/adm/coursedocs" method="post" name="supnewfolder"> |
Line 3394 my %suporderhash = (
|
Line 3394 my %suporderhash = (
|
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
} |
} |
my $tid='2'; |
my $tid='2'; |
my $varscd = 'Supplemental Course Documents'; |
$r->print(&generate_edit_table($tid,\%suporderhash)); |
$r->print(&generate_edit_table($tid,$varscd,\%suporderhash)); |
|
} else { |
} else { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$type); |
if ($error) { |
if ($error) { |
Line 3460 sub generate_admin_options {
|
Line 3459 sub generate_admin_options {
|
|
|
|
|
sub generate_edit_table { |
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 %orderhash = %{$orderhash_ref}; |
my $form; |
my $form; |
my $activetab; |
my $activetab; |