Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[ljcom] r11700: LJSUP-11761: Editjournal.bml redesign (a...

Committer: anazarov
LJSUP-11761: Editjournal.bml redesign (artlebedev)
U   trunk/cgi-bin/LJ/Controller.pm
Modified: trunk/cgi-bin/LJ/Controller.pm
===================================================================
--- trunk/cgi-bin/LJ/Controller.pm	2012-04-12 11:21:23 UTC (rev 11699)
+++ trunk/cgi-bin/LJ/Controller.pm	2012-04-12 13:06:53 UTC (rev 11700)
@@ -19,4 +19,39 @@
 
 sub premature_checks {}
 
+sub error {
+    my ($self, $params) = @_;
+    my $remote = LJ::get_remote();
+
+    warn __LINE__;
+
+    if ( $params->{'code'} ) {
+        my $response = LJ::Response::Error->new(
+            error_type => $params->{'error'},
+            status     => $params->{'code'},
+            remote     => $remote,
+        );
+
+        # Probably this two lines are not really needed 
+        LJ::Request->pnotes(remote => $remote);
+        LJ::Request->pnotes(error  => $params->{'error'});
+
+        return $response;
+    } else {
+        my $response = LJ::Response::Template->new(
+            title              => $params->{'title'} || LJ::Lang::ml('Error'),
+            file               => 'Error.tmpl',
+            path               => join('/', $ENV{'LJHOME'}, 'templates', 'Comments', ''),
+            site_scheme_params => {},
+            use_site_scheme    => 1,
+            params             => {
+                title          => $params->{'title'} || LJ::Lang::ml('Error'),
+                text           => $params->{'text'},
+            },
+        );
+
+        return $response;
+    }
+} # error
+
 1;

Tags: anazarov, ljcom, nfokz, 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