Committer: wisest-owl
LJSUP-13388: LJ Shop - StylesU trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm U trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm U trunk/htdocs/shop/index.bml.text.local
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm =================================================================== --- trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-11-19 13:07:48 UTC (rev 12915) +++ trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-11-19 13:49:28 UTC (rev 12916) @@ -54,6 +54,7 @@ 'domainru' => 'LJ::Pay::Payment::PayItem::DomainRU', 'notificationpromo' => 'LJ::Pay::Payment::PayItem::NotificationPromo', 'repost' => 'LJ::Pay::Payment::PayItem::PaidRepost', + 'theme' => 'LJ::Pay::Payment::PayItem::Theme', ); my @FREEZABLE_CLASSES = qw/ Modified: trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm =================================================================== --- trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm 2012-11-19 13:07:48 UTC (rev 12915) +++ trunk/cgi-bin/LJ/Widget/Shop/LeftMenu.pm 2012-11-19 13:49:28 UTC (rev 12916) @@ -85,8 +85,9 @@ my %top_map = ( paidaccount => 0, paidservice => 1, - vgifts => 2, - merchandise => 3, + themes => 2, + vgifts => 3, + merchandise => 4, ); my $top_level = [ @@ -112,6 +113,34 @@ is_expanded => 1, }, ]; + + unless ($LJ::DISABLED{'lj_shop_styles'}) { + ## Adding themes cats into Shop's LeftMenu + push @$top_level, { + name => BML::ml('.storefront.themes'), + level1 => [], + is_expanded => 1, + }; + my $all_themes = LJ::Pay::Theme->get_all_themes (); + my %cat_themes = (); + foreach my $theme (@$all_themes) { + my $theme_o = LJ::Pay::Theme->new ($theme->{'style_id'}); + $cat_themes{$_} = 1 foreach @{$theme_o->get_cats}; + } + my %cats = LJ::Customize->get_cats ($remote); + push @{$top_level->[@$top_level-1]{level1}}, { + url => "/shop/theme/?cat=all", + name => $cats{'all'}{'text'}, + is_selected => $subpage eq 'all' ? 1 : 0, + }; + push @{$top_level->[@$top_level-1]{level1}}, { + url => "/shop/theme/?cat=$_", + name => $cats{$_}{'text'}, + is_selected => $subpage eq $_ ? 1 : 0, + } foreach keys %cat_themes; + } + + if ($promos) { push @$top_level, { Modified: trunk/htdocs/shop/index.bml.text.local =================================================================== --- trunk/htdocs/shop/index.bml.text.local 2012-11-19 13:07:48 UTC (rev 12915) +++ trunk/htdocs/shop/index.bml.text.local 2012-11-19 13:49:28 UTC (rev 12916) @@ -179,5 +179,7 @@ .storefront.selfpromo=SelfPromo +.storefront.themes=Themes + .title=Shop