madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r22319: LJSUP-11844: Classic comments option sho...

Committer: sbelyaev
LJSUP-11844: Classic comments option should be grayed out for Basic users
U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/S2.pm
U   trunk/cgi-bin/LJ/Widget/S2PropGroup.pm
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2012-06-25 07:31:36 UTC (rev 22318)
+++ trunk/bin/upgrading/en.dat	2012-06-25 09:33:19 UTC (rev 22319)
@@ -87,6 +87,8 @@
 
 comment.mark.spam2.title=Mark as a spam
 
+comment.classic.not.available=This option not available for Basic accounts
+
 community.election.owner.election.link|staleness=1
 community.election.owner.election.link=The owner of the [[community]] community is not selected yet. You can <a [[href]]>vote for owner here</a>.
 

Modified: trunk/cgi-bin/LJ/S2.pm
===================================================================
--- trunk/cgi-bin/LJ/S2.pm	2012-06-25 07:31:36 UTC (rev 22318)
+++ trunk/cgi-bin/LJ/S2.pm	2012-06-25 09:33:19 UTC (rev 22319)
@@ -1761,9 +1761,14 @@
 
 sub can_use_prop
 {
-    my ($u, $uniq, $prop) = @_;  # $uniq = redist_uniq value
+    my ($u, $uniq, $prop, $prop_desc) = @_;  # $uniq = redist_uniq value
     my $user_basic =  LJ::run_hook("user_is_basic", $u);
-    return 0 if $prop eq 'old_s1' && $user_basic;
+    if ( $prop eq 'old_s1' && $user_basic) 
+    {
+        $$prop_desc = LJ::Lang::ml("comment.classic.not.available");
+        return 0;
+    }
+
     return 1 if LJ::get_cap($u, "s2styles");
     return 1 if LJ::get_cap($u, "s2props");
     my $pol = get_policy();

Modified: trunk/cgi-bin/LJ/Widget/S2PropGroup.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/S2PropGroup.pm	2012-06-25 07:31:36 UTC (rev 22318)
+++ trunk/cgi-bin/LJ/Widget/S2PropGroup.pm	2012-06-25 09:33:19 UTC (rev 22319)
@@ -216,7 +216,7 @@
     my $name = $prop->{name};
     my $type = $prop->{type};
 
-    my $can_use = LJ::S2::can_use_prop($u, $theme->layout_uniq, $name);
+    my $can_use = LJ::S2::can_use_prop($u, $theme->layout_uniq, $name, \$prop->{note});
 
     my %prop_values = LJ::Customize->get_s2_prop_values($name, $u, $style);
     my $existing = $prop_values{existing};

Tags: dat, livejournal, madeon, pm, sbelyaev
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments