Committer: wisest-owl
LJSUP-13388: LJ Shop - StylesU trunk/cgi-bin/LJ/Hooks/Customize.pm
Modified: trunk/cgi-bin/LJ/Hooks/Customize.pm =================================================================== --- trunk/cgi-bin/LJ/Hooks/Customize.pm 2012-12-06 06:45:38 UTC (rev 13000) +++ trunk/cgi-bin/LJ/Hooks/Customize.pm 2012-12-06 08:28:23 UTC (rev 13001) @@ -222,6 +222,17 @@ return $LJ::SPONSORED_LAYERS{$uniq} ? 1 : 0; }); +LJ::register_hook("layer_is_buyable", sub { + my $layer = shift; + + return 0 unless $layer->{'type'} eq 'theme'; + + my $theme = LJ::S2Theme->load_by_themeid($layer->{'s2lid'}); + return 0 unless $theme; + + return $theme->is_buyable; +}); + LJ::register_hook("layer_is_active", sub { my $uniq = shift;