fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-08-13 01:30 am

[dw-free] Remove references to AdLayout.pm

[commit: http://hg.dwscoalition.org/dw-free/rev/383fb83fd04d]

http://bugs.dwscoalition.org/show_bug.cgi?id=2855

We don't have ads. Therefore, we don't need this. (Leftover code)

Patch by [personal profile] ninetydegrees.

Files modified:
  • cgi-bin/LJ/Widget/LayoutChooser.pm
  • cgi-bin/LJ/Widget/ThemeChooser.pm
  • htdocs/customize/index.bml
--------------------------------------------------------------------------------
diff -r 7a3697baf64c -r 383fb83fd04d cgi-bin/LJ/Widget/LayoutChooser.pm
--- a/cgi-bin/LJ/Widget/LayoutChooser.pm	Fri Aug 13 09:19:29 2010 +0800
+++ b/cgi-bin/LJ/Widget/LayoutChooser.pm	Fri Aug 13 09:27:39 2010 +0800
@@ -31,7 +31,6 @@ sub render_body {
 
     my $no_theme_chooser = defined $opts{no_theme_chooser} ? $opts{no_theme_chooser} : 0;
 
-    my $ad_layout_id = defined $opts{ad_layout_id} ? $opts{ad_layout_id} : 0;
     my $headextra = $opts{headextra};
 
     my $ret;
@@ -39,14 +38,6 @@ sub render_body {
     $ret .= $no_theme_chooser ? $class->ml('widget.layoutchooser.title_nonum') : $class->ml('widget.layoutchooser.title');
     $ret .= "</h2>";
     $ret .= "<div class='layout-content'>";
-
-    if (eval "use LJ::Widget::AdLayout; 1;" && LJ::Widget::AdLayout->should_render_for_u($u)) {
-        my $ad_layout = LJ::Widget::AdLayout->new( id => $ad_layout_id );
-        $ad_layout_id = $ad_layout->{id} unless $ad_layout_id;
-        $$headextra .= $ad_layout->wrapped_js( page_js_obj => "Customize" ) if $headextra;
-
-        $ret .= $ad_layout->render;
-    }
 
     # Column option
     my $current_theme = LJ::Customize->get_current_theme($u);
@@ -98,7 +89,6 @@ sub render_body {
         }
     }
 
-    $ret .= $class->html_hidden({ name => "ad_layout_id", value => $ad_layout_id, id => "ad_layout_id" });
     $ret .= "</div>";
 
     return $ret;
@@ -156,8 +146,7 @@ sub js {
             this.doPostAndUpdateContent({
                 layout_choice: given_layout_choice,
                 layout_prop: form["Widget[LayoutChooser]_layout_prop"].value + "",
-                show_sidebar_prop: form["Widget[LayoutChooser]_show_sidebar_prop"].value + "",
-                ad_layout_id: $('ad_layout_id').value
+                show_sidebar_prop: form["Widget[LayoutChooser]_show_sidebar_prop"].value
             });
 
             Event.stop(evt);
diff -r 7a3697baf64c -r 383fb83fd04d cgi-bin/LJ/Widget/ThemeChooser.pm
--- a/cgi-bin/LJ/Widget/ThemeChooser.pm	Fri Aug 13 09:19:29 2010 +0800
+++ b/cgi-bin/LJ/Widget/ThemeChooser.pm	Fri Aug 13 09:27:39 2010 +0800
@@ -426,9 +426,6 @@ sub js {
                 show: Customize.show,
                 theme_chooser_id: $('theme_chooser_id').value
             });
-            Customize.LayoutChooser.updateContent({
-                ad_layout_id: $('ad_layout_id').value
-            });
             alert(Customize.ThemeChooser.confirmation);
         },
         previewTheme: function (evt, href) {
diff -r 7a3697baf64c -r 383fb83fd04d htdocs/customize/index.bml
--- a/htdocs/customize/index.bml	Fri Aug 13 09:19:29 2010 +0800
+++ b/htdocs/customize/index.bml	Fri Aug 13 09:27:39 2010 +0800
@@ -60,7 +60,7 @@ body<=
 
             return BML::redirect("$LJ::SITEROOT/customize/options$getextra");
         }
-        my @errors = LJ::Widget->handle_post(\%POST, qw(JournalTitles ThemeChooser ThemeNav LayoutChooser AdLayout));
+        my @errors = LJ::Widget->handle_post(\%POST, qw(JournalTitles ThemeChooser ThemeNav LayoutChooser));
         $ret .= LJ::bad_input(@errors) if @errors;
     }
 
--------------------------------------------------------------------------------