version 1.442, 2010/12/07 01:15:39
|
version 1.443, 2010/12/07 17:33:36
|
Line 2643 sub startContentScreen {
|
Line 2643 sub startContentScreen {
|
my $href; |
my $href; |
|
|
if ($allowed) { |
if ($allowed) { |
if (($mode eq 'navmaps') || ($mode eq 'tools')) { |
# if (($mode eq 'navmaps') || ($mode eq 'tools')) { |
$href="/adm/coursedocs"; |
$href="/adm/coursedocs?forcestandard=1"; |
$onclick=''; |
$onclick=''; |
} else { |
# } else { |
$href='#'; |
# $href='#'; |
$onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"'; |
# $onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"'; |
} |
# } |
$r->print('<li '.(($mode eq 'docs')?' class="active"':'').$onclick. |
$r->print('<li '.(($mode eq 'docs')?' class="active"':'').$onclick. |
'><a href="'.$href.'"><b> '.&mt('Content Editor').' </b></a></li>'); |
'><a href="'.$href.'"><b> '.&mt('Content Editor').' </b></a></li>'); |
} |
} |
if (($mode eq 'navmaps') || ($mode eq 'tools')) { |
# if (($mode eq 'navmaps') || ($mode eq 'tools')) { |
$href="/adm/coursedocs"; |
$href="/adm/coursedocs?forcesupplement=1"; |
$onclick=''; |
$onclick=''; |
} else { |
# } else { |
$href='#'; |
# $href='#'; |
$onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"'; |
# $onclick=' onclick="javascript:showPage(this,\'mainCourseDocuments\',\'mainnav\',\'maincoursedoc\');"'; |
} |
# } |
|
|
$r->print('<li '.(($mode eq 'supdocs')?' class="active"':'').$onclick. |
$r->print('<li '.(($mode eq 'supdocs')?' class="active"':'').$onclick. |
'><a href="'.$href.'"><b>'.&mt('Supplemental Documents').'</b></a></li>'); |
'><a href="'.$href.'"><b>'.&mt('Supplemental Documents').'</b></a></li>'); |
Line 2685 sub handler {
|
Line 2685 sub handler {
|
return OK if $r->header_only; |
return OK if $r->header_only; |
my $crstype = &Apache::loncommon::course_type(); |
my $crstype = &Apache::loncommon::course_type(); |
|
|
|
# |
# --------------------------------------------- Initialize help topics for this |
# --------------------------------------------- Initialize help topics for this |
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', |
foreach my $topic ('Adding_Course_Doc','Main_Course_Documents', |
'Adding_External_Resource','Navigate_Content', |
'Adding_External_Resource','Navigate_Content', |
Line 2743 sub handler {
|
Line 2743 sub handler {
|
|
|
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['folderpath','pagepath', |
['folderpath','pagepath', |
'pagesymb']); |
'pagesymb','forcesupplement','forcestandard']); |
# No folderpath, no pagepath, see if we have something stored |
# No folderpath, no pagepath, see if we have something stored |
if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'})) { |
if ((!$env{'form.folderpath'}) && (!$env{'form.pagepath'})) { |
&Apache::loncommon::restore_course_settings('docs_folderpath', |
&Apache::loncommon::restore_course_settings('docs_folderpath', |
Line 2979 CHBO
|
Line 2979 CHBO
|
FUFORM |
FUFORM |
#$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); |
#$list .= Apache::lonhtmlcommon::htmltag('li', $picture.' '.$button->{$picture}, {class => 'LC_menubuttons_inline_text'}); |
#$fileuploadform .= create_form_ul(create_list_elements(@fileuploada)); |
#$fileuploadform .= create_form_ul(create_list_elements(@fileuploada)); |
$fileuploadform .= create_form_ul(Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'})); |
$fileuploadform .= &create_form_ul(&Apache::lonhtmlcommon::htmltag('li',$fileuploada,{class => 'LC_menubuttons_inline_text'})).'</form>'; |
$fileuploadform .= (<<FUFORM); |
|
</form> |
|
FUFORM |
|
|
|
my $simpleeditdefaultform=(<<SEDFFORM); |
my $simpleeditdefaultform=(<<SEDFFORM); |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
<form action="/adm/coursedocs" method="post" name="simpleeditdefault"> |
Line 2993 SEDFFORM
|
Line 2990 SEDFFORM
|
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/res.png" alt="'.$lt{impo}.'" onclick="javascript:groupimport();"/>' => "<a class='LC_menubuttons_link' href='javascript:groupimport();'>$lt{'impo'}</a>$help{'Importing_LON-CAPA_Resource'}" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{wish}.'" onclick="javascript:open_Wishlist_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_Wishlist_Import();'>$lt{'wish'}</a>" }, |
{ '<img class="LC_noBorder LC_middle" src="/res/adm/pages/wishlist.png" alt="'.$lt{wish}.'" onclick="javascript:open_Wishlist_Import();" />' => "<a class='LC_menubuttons_link' href='javascript:open_Wishlist_Import();'>$lt{'wish'}</a>" }, |
); |
); |
$simpleeditdefaultform .= create_form_ul(create_list_elements(@simpleeditdefaultforma)); |
$simpleeditdefaultform .= &create_form_ul(&create_list_elements(@simpleeditdefaultforma)); |
$simpleeditdefaultform .=(<<SEDFFORM); |
$simpleeditdefaultform .=(<<SEDFFORM); |
<hr /> |
<hr /> |
<p> |
<p> |
Line 3040 ERFORM
|
Line 3037 ERFORM
|
HIDDENFORM |
HIDDENFORM |
} |
} |
|
|
|
# |
|
# Decide whether this should display supplemental or main content |
|
# supplementalflag=1: show supplemental documents |
|
# supplementalflag=0: show standard documents |
|
|
|
my $supplementalflag=($env{'form.folderpath'}=~/^supplemental/); |
|
if (($standard) && ($allowed) && (($env{'form.folderpath'}=~/^default/) || $env{'form.folderpath'} eq "" || ($env{'form.pagepath'}))) { |
|
$supplementalflag=0; |
|
} |
|
if ($env{'form.forcesupplement'}) { $supplementalflag=1; } |
|
if ($env{'form.forcestandard'}) { $supplementalflag=0; } |
|
|
# Generate the tabs |
# Generate the tabs |
&startContentScreen($r,'docs'); |
&startContentScreen($r,($supplementalflag?'supdocs':'docs')); |
|
|
|
|
# |
# |
|
|
my $savefolderpath; |
my $savefolderpath; |
|
|
if ($allowed) { |
if ($allowed) { |
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
if ($folder eq '' || $folder=~/^supplemental/) { |
if ($folder eq '' || $supplementalflag) { |
$folder='default'; |
$folder='default'; |
$savefolderpath = $env{'form.folderpath'}; |
$savefolderpath = $env{'form.folderpath'}; |
$env{'form.folderpath'}='default&'.&escape(&mt('Content')); |
$env{'form.folderpath'}='default&'.&escape(&mt('Content')); |
Line 3242 NGFFORM
|
Line 3253 NGFFORM
|
my @importdoc = ( |
my @importdoc = ( |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'newext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'newext\');" />'=>$extresourcesform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:makeims();" />'=>$imspform},); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/ims.png" alt="'.$lt{imsf}.'" onclick="javascript:makeims();" />'=>$imspform},); |
$fileuploadform = create_form_ul(create_list_elements(@importdoc)) . '<hr/>' . $fileuploadform; |
$fileuploadform = &create_form_ul(&create_list_elements(@importdoc)) . '<hr/>' . $fileuploadform; |
|
|
push @specialdocumentsforma, ({'<img class="LC_noBorder LC_middle" src="/res/adm/pages/navigation.png" alt="'.$lt{navc}.'" onclick="document.newnav.submit()" />'=>$newnavform}, |
push @specialdocumentsforma, ({'<img class="LC_noBorder LC_middle" src="/res/adm/pages/navigation.png" alt="'.$lt{navc}.'" onclick="document.newnav.submit()" />'=>$newnavform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simple.png" alt="'.$lt{sipa}.'" onclick="javascript:makesmppage();" />'=>$newsmppageform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simple.png" alt="'.$lt{sipa}.'" onclick="javascript:makesmppage();" />'=>$newsmppageform}, |
Line 3254 NGFFORM
|
Line 3265 NGFFORM
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/aboutme.png" alt="'.$lt{abou}.'" onclick="javascript:makeabout();" />'=>$newaboutsomeoneform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/aboutme.png" alt="'.$lt{abou}.'" onclick="javascript:makeabout();" />'=>$newaboutsomeoneform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/clst.png" alt="'.$lt{rost}.'" onclick="document.newroster.submit()" />'=>$newrosterform},); |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/clst.png" alt="'.$lt{rost}.'" onclick="document.newroster.submit()" />'=>$newrosterform},); |
|
|
$specialdocumentsform = create_form_ul(create_list_elements(@specialdocumentsforma)); |
$specialdocumentsform = &create_form_ul(&create_list_elements(@specialdocumentsforma)); |
} |
} |
|
|
if($env{'form.pagepath'}) { |
if($env{'form.pagepath'}) { |
Line 3263 if($env{'form.pagepath'}) {
|
Line 3274 if($env{'form.pagepath'}) {
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.&mt('Simple Problem').'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/simpprob.png" alt="'.&mt('Simple Problem').'" onclick="javascript:makesmpproblem();" />'=>$newsmpproblemform}, |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/scoreupfrm.png" alt="'.&mt('Score Upload Form').'" onclick="javascript:makeexamupload();" />'=>$newexuploadform} |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/scoreupfrm.png" alt="'.&mt('Score Upload Form').'" onclick="javascript:makeexamupload();" />'=>$newexuploadform} |
); |
); |
$specialdocumentsform= create_form_ul(create_list_elements(@specialdocumentsforma)); |
$specialdocumentsform= &create_form_ul(&create_list_elements(@specialdocumentsforma)); |
} |
} |
|
|
my @tools = ( |
my @tools = ( |
Line 3276 my %orderhash = (
|
Line 3287 my %orderhash = (
|
'aa' => ['Import Documents',$fileuploadform], |
'aa' => ['Import Documents',$fileuploadform], |
'bb' => ['Published Resources',$simpleeditdefaultform], |
'bb' => ['Published Resources',$simpleeditdefaultform], |
'cc' => ['Special Documents',$specialdocumentsform], |
'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'}) { |
unless($env{'form.pagepath'}) { |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
$orderhash{'00'} = ['Newfolder',$newfolderform]; |
} |
} |
|
|
my $tid='1'; |
|
$hadchanges=0; |
$hadchanges=0; |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
unless ($supplementalflag) { |
if ($error) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
if ($error) { |
} |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
if ($hadchanges) { |
} |
&mark_hash_old(); |
if ($hadchanges) { |
} |
&mark_hash_old(); |
|
} |
|
|
&changewarning($r,''); |
&changewarning($r,''); |
$r->print(&generate_edit_table($tid,\%orderhash)); |
$r->print(&generate_edit_table('1',\%orderhash)); |
|
} |
|
|
$r->print('</div>'); |
|
} |
} |
|
|
|
# Supplemental documents start here |
|
|
my $folder=$env{'form.folder'}; |
my $folder=$env{'form.folder'}; |
unless ($folder=~/^supplemental/) { |
unless ($supplementalflag) { |
$folder='supplemental'; |
$folder='supplemental'; |
} |
} |
if ($folder =~ /^supplemental$/ && |
if ($folder =~ /^supplemental$/ && |
Line 3334 $r->print('</div>');
|
Line 3347 $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(Apache::lonhtmlcommon::htmltag('li',$supupdocformbtn,{class => 'LC_menubuttons_inline_text'}))."</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 3389 my @supimportdoc = (
|
Line 3402 my @supimportdoc = (
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'supnewext\');" />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/extres.png" alt="'.$lt{extr}.'" onclick="javascript:makenewext(\'supnewext\');" />' |
=>$supnewextform}, |
=>$supnewextform}, |
); |
); |
$supupdocform = create_form_ul(create_list_elements(@supimportdoc)) . '<hr/>' . $supupdocform; |
$supupdocform = &create_form_ul(&create_list_elements(@supimportdoc)) . '<hr/>' . $supupdocform; |
my %suporderhash = ( |
my %suporderhash = ( |
'00' => ['Supnewfolder', $supnewfolderform], |
'00' => ['Supnewfolder', $supnewfolderform], |
'ee' => ['Import Documents',$supupdocform], |
'ee' => ['Import Documents',$supupdocform], |
'ff' => ['Special Documents',create_form_ul(create_list_elements(@specialdocs))] |
'ff' => ['Special Documents',&create_form_ul(&create_list_elements(@specialdocs))] |
); |
); |
|
if ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
|
} |
|
$r->print(&generate_edit_table('2',\%suporderhash)); |
} |
} |
my $tid='2'; |
} elsif ($supplementalflag) { |
$r->print(&generate_edit_table($tid,\%suporderhash)); |
|
} else { |
|
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype); |
if ($error) { |
if ($error) { |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
$r->print('<p><span class="LC_error">'.$error.'</span></p>'); |
Line 3500 sub generate_admin_options {
|
Line 3513 sub generate_admin_options {
|
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/document-properties.png" alt="'.$lt{sl}.'" onclick=\'javascript:injectData(document.courseverify, "dummy", "docslog", "'.$lt{'sl'}.'")\' />' |
{'<img class="LC_noBorder LC_middle" src="/res/adm/pages/document-properties.png" alt="'.$lt{sl}.'" onclick=\'javascript:injectData(document.courseverify, "dummy", "docslog", "'.$lt{'sl'}.'")\' />' |
=>"<a class='LC_menubuttons_link' href='javascript:injectData(document.courseverify, \"dummy\", \"docslog\", \"$lt{'sl'}\")'>$lt{'sl'}</a>"}, |
=>"<a class='LC_menubuttons_link' href='javascript:injectData(document.courseverify, \"dummy\", \"docslog\", \"$lt{'sl'}\")'>$lt{'sl'}</a>"}, |
); |
); |
return '<form action="/adm/coursedocs" method="post" name="courseverify"><input type="hidden" id="dummy" />'.create_form_ul(create_list_elements(@list)).'</form>'; |
return '<form action="/adm/coursedocs" method="post" name="courseverify"><input type="hidden" id="dummy" />'.&create_form_ul(&create_list_elements(@list)).'</form>'; |
|
|
} |
} |
|
|