changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[ljcom] r13085: LJSUP-14473: Admin pages' style and code...

Committer: tnurutdinov
LJSUP-14473: Admin pages' style and code refactoring.
U   trunk/htdocs/admin/vgift/edit.bml
Modified: trunk/htdocs/admin/vgift/edit.bml
===================================================================
--- trunk/htdocs/admin/vgift/edit.bml	2012-12-28 09:34:41 UTC (rev 13084)
+++ trunk/htdocs/admin/vgift/edit.bml	2012-12-28 13:22:24 UTC (rev 13085)
@@ -5,15 +5,25 @@
 
 use LJ::Pay::ShopVGift;
 use LJ::FileStore;
+use LJ::SiteScheme;
 
 my $ret;
 my $mode = $FORM{'mode'} || $GET{'mode'};
 
 my $remote = LJ::get_remote();
-return "<b>Error:</b> not logged in" unless $remote;
-return "<b>Error:</b> no access"
-    unless $LJ::IS_DEV_SERVER || LJ::check_priv($remote, "admin", "vgift");
 
+unless ($remote) {
+    return LJ::SiteScheme->render_page({
+        body => "<b>Error:</b> not logged in"
+    });
+}
+
+unless ($LJ::IS_DEV_SERVER || LJ::check_priv($remote, "admin", "vgift")) {
+    return LJ::SiteScheme->render_page({
+        body => "<b>Error:</b> no access"
+    });
+} 
+
 $mode ||= "intro";
 
 %LJ::SHOP_VGIFTS = ();
@@ -73,7 +83,11 @@
             $vgift = LJ::Pay::ShopVGift->new(id => $POST{'vgift_id'});
         }
 
-        return 'VGift not found' unless $vgift;
+        unless ($vgift) {
+            return LJ::SiteScheme->render_page({
+                body => 'VGift not found'
+            });
+        }
 
         if ($POST{'vgift_id'}) {
             ## Update vgift 
@@ -116,7 +130,9 @@
         return BML::redirect("$LJ::SITEROOT/admin/vgift/edit.bml?mode=vgiftlist&cat=" . $cat_name );
       
     }
-    return $ret;
+    return LJ::SiteScheme->render_page({
+         body => $ret
+    });
 }
 
 if ($mode eq "catadd") {
@@ -220,7 +236,9 @@
     $ret .= "</table>";
     $ret .= "</form>";
     LJ::Pay::ShopVGift->clear_cache();
-    return $ret;
+    return LJ::SiteScheme->render_page({
+        body => $ret
+    });
 }
 
 if ($mode eq "intro") {
@@ -244,7 +262,9 @@
     $ret .= "<input type='hidden' name='mode' value='vgiftlist'>";
     $ret .= "</form>";
 
-    return $ret;
+    return LJ::SiteScheme->render_page({
+        body => $ret
+    });
 }
 
 if ($mode eq 'vgiftlist') {
@@ -275,8 +295,11 @@
         $ret .= "<input type='hidden' name='cat_id' value='" . $cat_id . "'>";
         $ret .= "</form>";
     }
-    return $ret;
 
+    return LJ::SiteScheme->render_page({
+        body => $ret
+    });
+
 }
 
 sub format_magic {
@@ -293,7 +316,9 @@
     return $mime;
 }
 
-return "Unknown mode.";
+return LJ::SiteScheme->render_page({
+    body => "Unknown mode."
+});
 
 _code?><?_c <LJDEP>
 lib: cgi-bin/ljlib.pl

Tags: bml, ljcom, tnurutdinov
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