sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r12197: LJSUP-12301: Additional refactoring of c...

Committer: vtroitsky
LJSUP-12301: Additional refactoring of common parts with Selfpromo. Old stuff had been marked to remove was removed.
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-06-28 15:07:29 UTC (rev 12196)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/SelfPromo.pm	2012-06-28 18:28:52 UTC (rev 12197)
@@ -8,78 +8,22 @@
 
 sub item {'selfpromo'}
 
-#sub get_entry {
-#    my ($self) = @_;
-#
-#    my $sp_class = $self->get_prop('selfpromo');
-#    my $journalid = $self->get_prop('selfpromo_journalid');
-#    my $ditemid   = $self->get_prop('selfpromo_ditemid');
-#
-#    return unless $journalid && $ditemid;
-#
-#    return LJ::Entry->new( $journalid, 'ditemid' => $ditemid );
-#}
-
 sub get_object {
     my ($self) = @_;
     $self->{promoted_object} ||= LJ::Pay::PromotedObject->new_from_cart_item($self);
     return $self->{promoted_object};
-
-    # TOREMOVE: obsolete
-
-    my $sp_type = $self->get_prop('selfpromo');
-    my $journalid = $self->get_prop('selfpromo_journalid');
-
-  #  print "journalid: $journalid\n";
-    if ($sp_type eq 'entry') {
-        my $ditemid  = $self->get_prop('selfpromo_ditemid');
-   #     print "ditemid: $ditemid\n";
-        return unless $journalid && $ditemid;
-        return LJ::Entry->new( $journalid, 'ditemid' => $ditemid );
-    } else {
-        return LJ::load_userid($journalid);
-    } 
-    return;
 }
 
 sub get_object_url {
     my ($self) = @_;
     $self->{promoted_object} ||= LJ::Pay::PromotedObject->new_from_cart_item($self);
-#use Data::Dumper;
-#warn "ITEM:".Dumper($self);
-
     return $self->{promoted_object} ? $self->{promoted_object}->url : '';
-
-
-    # TOREMOVE: obsolete
-
-    my $object = $self->get_object;
-    return unless $object;
-    my $sp_type = $self->get_prop('selfpromo');
-    return  ($sp_type eq 'entry' ? $object->url : $object->journal_base); 
 }
 
 sub get_object_owner {
     my ($self) = @_;
     $self->{promoted_object} ||= LJ::Pay::PromotedObject->new_from_cart_item($self);   #cache object creation
     return $self->{promoted_object} ? $self->{promoted_object}->owner : undef;
-
-    # TOREMOVE: obsolete
-
-    my $object = $self->get_object;
-    return unless $object;
-    my $sp_type = $self->get_prop('selfpromo');
-
-    return $object->poster if $sp_type eq 'entry';
-    return $object if $sp_type eq 'journal';
-
-    if ($sp_type eq 'community') {
-        my $super_maintainers = LJ::load_rel_user_cache($object->{userid}, 'S') || LJ::load_rel_user_cache($object->{userid}, 'A') || [];
-
-        return $object unless scalar(@$super_maintainers);
-        return LJ::load_userid(shift @$super_maintainers);   # approxation in case of absense supermaintainer
-    }
-    return;
 }
 
 sub get_product_name {

Tags: ljcom, pm, sunnyman, vtroitsky
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