[livejournal] r14845: LJSUP-3714: Syndicate my content (second...

Feb 04, 2009 09:28


Committer: ssafronovaLJSUP-3714: Syndicate my content (second version), part 1

U trunk/cgi-bin/LJ/Widget/SettingProdDisplay.pm
U trunk/cgi-bin/ljprotocol.pl
U trunk/cgi-bin/weblib.pl

Modified: trunk/cgi-bin/LJ/Widget/SettingProdDisplay.pm
===================================================================
--- trunk/cgi-bin/LJ/Widget/SettingProdDisplay.pm 2009-02-04 07:15:02 UTC (rev 14844)
+++ trunk/cgi-bin/LJ/Widget/SettingProdDisplay.pm 2009-02-04 09:28:03 UTC (rev 14845)
@@ -17,7 +17,7 @@
foreach my $prod (@LJ::SETTING_PROD) {
if (Apache->request->notes('codepath') =~ $prod->{codepaths} && $prod->{should_show}->($remote)) {
$body .= "\n\n";
+ $prod->{setting} . "', '" . $prod->{field} . "', '" . $title . "', " . $prod->{window_opts} . " )\", 400)\n";
last;
}
}

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl 2009-02-04 07:15:02 UTC (rev 14844)
+++ trunk/cgi-bin/ljprotocol.pl 2009-02-04 09:28:03 UTC (rev 14845)
@@ -1466,6 +1466,8 @@
if (LJ::is_enabled('default_copyright', $u)) {
$req->{'props'}->{'copyright'} = $u->prop('default_copyright')
unless defined $req->{'props'}->{'copyright'};
+ $req->{'props'}->{'copyright'} = 'P' # second try
+ unless defined $req->{'props'}->{'copyright'};
} else {
delete $req->{'props'}->{'copyright'};
}
@@ -1864,11 +1866,18 @@
});
}

- unless (defined $req->{'props'}->{'copyright'}) {
- $req->{'props'}->{'copyright'} = $curprops{$itemid}->{'copyright'}; # save previous choice
- } else { # defined
- $req->{'props'}->{'copyright'} = '' if $req->{'props'}->{'copyright'} eq 'C';
- # we do not store 'C', but need distinguish it from unmade user choice
+ if (LJ::is_enabled('default_copyright', $uowner)) {
+ unless (defined $req->{'props'}->{'copyright'}) { # try 1: previous value
+ $req->{'props'}->{'copyright'} = $curprops{$itemid}->{'copyright'};
+ }
+ unless (defined $req->{'props'}->{'copyright'}) { # try 2: global setting
+ $req->{'props'}->{'copyright'} = $uowner->prop('default_copyright');
+ }
+ unless (defined $req->{'props'}->{'copyright'}) { # try 3: allow
+ $req->{'props'}->{'copyright'} = 'P';
+ }
+ } else { # disabled feature
+ delete $req->{'props'}->{'copyright'};
}

# handle the props

Modified: trunk/cgi-bin/weblib.pl
===================================================================
--- trunk/cgi-bin/weblib.pl 2009-02-04 07:15:02 UTC (rev 14844)
+++ trunk/cgi-bin/weblib.pl 2009-02-04 09:28:03 UTC (rev 14845)
@@ -1880,9 +1880,7 @@
$req->{"prop_opt_nocomments"} ||= $POST->{'comment_settings'} eq "nocomments" ? 1 : 0;
$req->{"prop_opt_noemail"} ||= $POST->{'comment_settings'} eq "noemail" ? 1 : 0;
$req->{'prop_opt_backdated'} = $POST->{'prop_opt_backdated'} ? 1 : 0;
- if ($req->{'defined_copyright'}) {
- $req->{'prop_copyright'} = $POST->{'prop_copyright'} ? 'P' : 'C';
- }
+ $req->{'prop_copyright'} = $POST->{'prop_copyright'} ? 'P' : 'C' if LJ::is_enabled('default_copyright', LJ::get_remote());

if (LJ::is_enabled("content_flag")) {
$req->{prop_adult_content} = $POST->{prop_adult_content};

Previous post Next post
Up