version 1.68, 2011/02/20 21:56:25
|
version 1.69, 2011/02/20 22:48:26
|
Line 455 sub process_category_edits {
|
Line 455 sub process_category_edits {
|
unless ($cangrade) { return %categories; } |
unless ($cangrade) { return %categories; } |
my $cmd=$env{'form.cmd'}; |
my $cmd=$env{'form.cmd'}; |
if ($cmd eq 'createnewcat') { |
if ($cmd eq 'createnewcat') { |
%categories=&make_new_category($r,$cangrade,undef,%categories); |
%categories=&make_new_category($r,$cangrade,undef,%categories); |
|
} elsif ($cmd=~/^delcat\_(.+)$/) { |
|
%categories=&del_category($1,$cangrade,%categories); |
|
} else { |
|
# Simply store the rest of the stuff |
|
foreach my $id (split(/\,/,$categories{'order'})) { |
|
%categories=&set_category_name($cangrade,$id,$env{'form.name_'.$id},%categories); |
|
# More changes here |
|
} |
} |
} |
if ($cmd=~/^delcat\_(.+)$/) { |
|
my $id=$1; |
|
%categories=&del_category($id,$cangrade,%categories); |
|
} |
|
# |
|
# Business logic here |
|
# |
|
return %categories; |
return %categories; |
} |
} |
|
|
Line 548 ENDMOVE
|
Line 549 ENDMOVE
|
} |
} |
$r->print("\n</select>\n</td>\n"); |
$r->print("\n</select>\n</td>\n"); |
$r->print('<td><a href="/adm/quickgrades?cmd=delcat_'.$id.'&storechanges=1">'.&mt('Delete').'</a></td>'); |
$r->print('<td><a href="/adm/quickgrades?cmd=delcat_'.$id.'&storechanges=1">'.&mt('Delete').'</a></td>'); |
|
$r->print('<td><input type="text" name="name_'.$id. |
|
'" value="'.&Apache::lonhtmlcommon::entity_encode($categories{$id.'_name'}).'" /></td>'); |
|
} else { |
|
$r->print('<td>'.$categories{$id.'_name'}.'</td>'); |
} |
} |
$r->print(&Apache::loncommon::end_data_table_row()."\n"); |
$r->print(&Apache::loncommon::end_data_table_row()."\n"); |
return ($value,$weight); |
return ($value,$weight); |
Line 657 sub current_pos_category {
|
Line 661 sub current_pos_category {
|
# Set name of a category |
# Set name of a category |
# |
# |
sub set_category_name { |
sub set_category_name { |
my ($canedit,$id,$name,%categories)=@_; |
my ($cangrade,$id,$name,%categories)=@_; |
unless ($canedit) { return %categories; } |
unless ($cangrade) { return %categories; } |
$categories{$id.'_name'}=$name; |
$categories{$id.'_name'}=$name; |
return %categories; |
return %categories; |
} |
} |