Committer: gprochaev
LJSUP-6515. Custom Userheads. Add JS prices.U trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm
Modified: trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm 2010-08-23 07:18:05 UTC (rev 9378) +++ trunk/cgi-bin/LJ/Widget/Shop/View/UserHeads.pm 2010-08-24 03:25:27 UTC (rev 9379) @@ -38,9 +38,7 @@ my $gift = ((!$remote || LJ::Request->get_param('gift'))) || 0; my $recipient = $gift ? LJ::load_user(LJ::Request->get_param('giftto')) : undef; - # [10,6,2] == foreach period, for 1 packet - my $js_prices = [];#[ map { $options{$_}{amount} } sort { $b <=> $a } keys %options ]; - my $js_prices_rcpt = [];#[ map { $options_rcpt{$_}{amount} } sort { $b <=> $a } keys %options_rcpt ]; + my %js_prices = map { $_->{uh_id} => $_->{price} } @{LJ::UserHead->get_all_userheads (1)}; my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time); @@ -69,8 +67,7 @@ giveafter_dd => LJ::Request->post_param('giveafter_dd') || $mday, giveafter_mm => LJ::Request->post_param('giveafter_mm') || ($mon + 1), giveafter_yyyy => LJ::Request->post_param('giveafter_yyyy') || ($year + 1900), - js_prices => LJ::JSON->to_json($js_prices), - js_prices_rcpt => LJ::JSON->to_json($js_prices_rcpt), + js_prices => LJ::JSON->to_json(\%js_prices), js_complete => $js_complete,