holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r20669: LJSUP-10506: Modify menu items for NewPh...

Committer: akanashin
LJSUP-10506: Modify menu items for NewPhotohosting users
U   trunk/cgi-bin/LJ/SiteMessages.pm
U   trunk/cgi-bin/LJ/Widget/SiteMessages.pm
Modified: trunk/cgi-bin/LJ/SiteMessages.pm
===================================================================
--- trunk/cgi-bin/LJ/SiteMessages.pm	2011-12-01 06:44:20 UTC (rev 20668)
+++ trunk/cgi-bin/LJ/SiteMessages.pm	2011-12-01 07:32:19 UTC (rev 20669)
@@ -1,6 +1,7 @@
 package LJ::SiteMessages;
 use strict;
 use Carp qw(croak);
+use LJ::Fotki::Migration;
 
 use constant AccountMask => {
     Permanent   => {    
@@ -130,6 +131,14 @@
                                             return $u->prop('email_faulty');
                                        }
                     },
+   NewPhotohosting => {
+                        value       => 4096,
+                        group       => 5,
+                        validate    => sub {
+                                            my ($u) = @_;
+                                            return !(LJ::Fotki::Migration->user_enabled_new_photohosting($u));
+                                       }
+                    },
 };
 
 #

Modified: trunk/cgi-bin/LJ/Widget/SiteMessages.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/SiteMessages.pm	2011-12-01 06:44:20 UTC (rev 20668)
+++ trunk/cgi-bin/LJ/Widget/SiteMessages.pm	2011-12-01 07:32:19 UTC (rev 20669)
@@ -15,6 +15,7 @@
 
     my $lang;
     my $remote = LJ::get_remote();
+    return unless $remote;
     $lang = $remote->prop("browselang") if $remote; # exlude s2 context language from opportunities,
         # because S2 journal code executes BML::set_language($lang, \&LJ::Lang::get_text) with its own language
 
@@ -26,6 +27,10 @@
     LJ::CleanHTML::clean_event(\$text, { 'lj_sys_message_id' => $mid });
 
     my $is_office = LJ::SiteMessages->has_mask('OfficeOnly', $message->{accounts}) ? '<b>[Only for office]</b> ' : '';
+    if (LJ::SiteMessages->has_mask('NewPhotohosting', $message->{accounts}))  {
+        my $url = $remote->journal_base . "/pics/new_photo_service";
+        $text = "<a href=$url>$text</a>"
+    }
 
     return 
         "<p class='b-message b-message-suggestion b-message-system'>" .

Tags: akanashin, holyandrew, livejournal, pm
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