version 1.3, 2009/04/26 00:09:53
|
version 1.6, 2009/08/23 17:21:22
|
Line 49 sub print_header {
|
Line 49 sub print_header {
|
my $alert = &mt('You must select at least one functionality type to display.'); |
my $alert = &mt('You must select at least one functionality type to display.'); |
my $js = ' |
my $js = ' |
<script type="text/javascript"> |
<script type="text/javascript"> |
|
// <![CDATA[ |
|
|
function changePage(formname,newphase) { |
function changePage(formname,newphase) { |
formname.phase.value = newphase; |
formname.phase.value = newphase; |
numchecked = 0; |
numchecked = 0; |
Line 81 function changePage(formname,newphase) {
|
Line 83 function changePage(formname,newphase) {
|
$js .= &color_pick_js()."\n"; |
$js .= &color_pick_js()."\n"; |
} |
} |
$js .= &Apache::loncommon::viewport_size_js().' |
$js .= &Apache::loncommon::viewport_size_js().' |
|
|
|
// ]]> |
</script> |
</script> |
'; |
'; |
if ($jscript) { |
if ($jscript) { |
Line 124 sub print_footer {
|
Line 128 sub print_footer {
|
$env{'form.width'}.'" />'. |
$env{'form.width'}.'" />'. |
'<input type="hidden" name="height" value="'. |
'<input type="hidden" name="height" value="'. |
$env{'form.height'}.'" />'); |
$env{'form.height'}.'" />'); |
|
if (defined($env{'form.origin'})) { |
|
$r->print('<input type="hidden" name="origin" value="'.$env{'form.origin'}.'" />'."\n"); |
|
} |
if (($phase eq 'display') || ($phase eq 'process')) { |
if (($phase eq 'display') || ($phase eq 'process')) { |
if (ref($actions) eq 'ARRAY') { |
if (ref($actions) eq 'ARRAY') { |
foreach my $item (@{$actions}) { |
foreach my $item (@{$actions}) { |
Line 152 sub print_footer {
|
Line 159 sub print_footer {
|
} |
} |
|
|
sub make_changes { |
sub make_changes { |
my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles) = @_; |
my ($r,$dom,$phase,$context,$prefs_order,$prefs,$values,$confname,$roles,$allitems) = @_; |
my %brcrumtext = &get_crumb_text(); |
my %brcrumtext = &get_crumb_text(); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
|
my ($numchanged,%changes,%disallowed); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'display')", |
({href=>"javascript:changePage(document.$phase,'display')", |
text=>$brcrumtext{$context}}, |
text=>$brcrumtext{$context}}, |
Line 165 sub make_changes {
|
Line 173 sub make_changes {
|
(ref($prefs) eq 'HASH')) { |
(ref($prefs) eq 'HASH')) { |
foreach my $item (@{$prefs_order}) { |
foreach my $item (@{$prefs_order}) { |
if (grep(/^\Q$item\E$/,@actions)) { |
if (grep(/^\Q$item\E$/,@actions)) { |
$r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'); |
|
if ($context eq 'domain') { |
if ($context eq 'domain') { |
$r->print(&Apache::domainprefs::process_changes($r,$dom,$confname,$item,$roles,$values)); |
$r->print('<h3>'.&mt($prefs->{$item}{'text'}).'</h3>'. |
|
&Apache::domainprefs::process_changes($r,$dom, |
|
$confname,$item,$roles,$values,)); |
} else { |
} else { |
$r->print(&Apache::courseprefs::process_changes($r,$dom,$item,$values)); |
$changes{$item} = {}; |
|
&Apache::courseprefs::process_changes($dom,$item,$values, |
|
$prefs->{$item},$changes{$item}, |
|
$allitems,\%disallowed); |
|
if (keys(%{$changes{$item}}) > 0) { |
|
$numchanged ++; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($context eq 'course') { |
|
if ($numchanged) { |
|
$r->print(&Apache::courseprefs::store_changes($dom,$confname,$prefs_order,\@actions, |
|
$prefs,$values,\%changes)); |
|
} else { |
|
$r->print(&mt('No changes made to course configuration.')); |
|
} |
|
if (keys(%disallowed) > 0) { |
|
$r->print('<p>'); |
|
foreach my $item ('cloners','rolenames','feedback','discussion','localization') { |
|
if (ref($disallowed{$item}) eq 'HASH') { |
|
if (keys(%{$disallowed{$item}}) > 0) { |
|
$r->print(&Apache::courseprefs::display_disallowed($item,$disallowed{$item}, |
|
$prefs)); |
|
} |
} |
} |
} |
} |
|
$r->print('</p>'); |
} |
} |
} |
} |
$r->print('<p>'); |
$r->print('<p>'); |
&print_footer($r,$phase,'display','Back to configuration display',\@actions); |
my $footer_text = 'Back to configuration display'; |
|
if ($context eq 'course') { |
|
$footer_text = 'Back to display/edit settings'; |
|
} |
|
&print_footer($r,$phase,'display',$footer_text,\@actions); |
$r->print('</p>'); |
$r->print('</p>'); |
} |
} |
|
|
Line 186 sub display_settings {
|
Line 225 sub display_settings {
|
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
my @actions = &Apache::loncommon::get_env_multiple('form.actions'); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:changePage(document.$phase,'display')", |
({href=>"javascript:changePage(document.$phase,'display')", |
text=>"Course Settings"}); |
text=>"Display/Edit Settings"}); |
&print_header($r,$phase,$context,$jscript); |
&print_header($r,$phase,$context,$jscript); |
if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { |
if ((ref($prefs_order) eq 'ARRAY') && (ref($prefs) eq 'HASH') && (ref($values) eq 'HASH')) { |
if (@actions > 0) { |
if (@actions > 0) { |
Line 268 sub display_choices {
|
Line 307 sub display_choices {
|
} |
} |
my %helphash; |
my %helphash; |
&print_header($r,$phase,$context); |
&print_header($r,$phase,$context); |
$r->print('<h3>'.&mt('Functionality to display/modify').'</h3>'); |
$r->print('<h3>'.&mt('Settings to display/modify').'</h3>'); |
$r->print('<script type="text/javascript">'."\n". |
$r->print('<script type="text/javascript">'."\n". |
|
'// <![CDATA['."\n". |
&Apache::loncommon::check_uncheck_jscript()."\n". |
&Apache::loncommon::check_uncheck_jscript()."\n". |
|
'// ]]>'."\n". |
'</script>'."\n".'<p><input type="button" value="'.&mt('check all').'" '. |
'</script>'."\n".'<p><input type="button" value="'.&mt('check all').'" '. |
'onclick="javascript:checkAll(document.pickactions.actions)"'. |
'onclick="javascript:checkAll(document.pickactions.actions)"'. |
' />'.(' 'x2). |
' />'.(' 'x2). |
Line 373 ENDCOL
|
Line 414 ENDCOL
|
sub get_crumb_text { |
sub get_crumb_text { |
my %brcrumbtext = ( |
my %brcrumbtext = ( |
domain => 'Domain Settings', |
domain => 'Domain Settings', |
course => 'Course Settings', |
course => 'Display/Edit Settings', |
); |
); |
return %brcrumbtext; |
return %brcrumbtext; |
} |
} |