]> mj.ucw.cz Git - pciids.git/blobdiff - PciIds/Html/Users.pm
Split menu to left and right part
[pciids.git] / PciIds / Html / Users.pm
index 7783f0c04ab2e988a4893356c9a8c844975b22a1..377cb8b601e47b5be005b8ba59f5a5d5131d549d 100644 (file)
@@ -19,10 +19,7 @@ our @EXPORT = qw(&checkLogin &notLoggedComplaint);
 sub genRegisterForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Register a new user', undef );
 sub genRegisterForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Register a new user', undef );
-       print "<div class='top'>\n";
-       print '<h1>Register a new user</h1>';
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Register a new user', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<form name="register" id="register" method="POST" action="">
                <table>';
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<form name="register" id="register" method="POST" action="">
                <table>';
@@ -64,9 +61,7 @@ sub registerSubmit( $$$ ) {#A registration form has been submited
                "\nThank you\n".
                "\n(This is an autogenerated email, do not respond to it)" );
        genHtmlHead( $req, 'Registration email sent', undef );
                "\nThank you\n".
                "\n(This is an autogenerated email, do not respond to it)" );
        genHtmlHead( $req, 'Registration email sent', undef );
-       print "<div class='top'>\n";
-       print "<h1>Registration email sent</h1>\n";
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Registration email sent', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
        print "<div class='clear'></div></div>\n";
        print '<p>
                        An email containing further information has been sent to you.
        print "<div class='clear'></div></div>\n";
        print '<p>
                        An email containing further information has been sent to you.
@@ -78,10 +73,7 @@ sub registerSubmit( $$$ ) {#A registration form has been submited
 sub genConfirmForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Confirm registration', undef );
 sub genConfirmForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Confirm registration', undef );
-       print "<div class='top'>\n";
-       print '<h1>Confirm registration</h1>';
-       genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Confirm registration', [ [ 'Help', 'help', 'account' ] ], [ [ 'Register', 'register' ] ] );
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<p>Email address: '.encode( $values->{'email'} );
        print '<form name="register-confirm" id="register-confirm" method="POST" action="">';
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print '<p>Email address: '.encode( $values->{'email'} );
        print '<form name="register-confirm" id="register-confirm" method="POST" action="">';
@@ -99,10 +91,7 @@ sub genConfirmForm( $$$$ ) {
 sub usedAddress( $$ ) {
        my( $req, $args ) = @_;
        genHtmlHead( $req, 'Used address', undef );
 sub usedAddress( $$ ) {
        my( $req, $args ) = @_;
        genHtmlHead( $req, 'Used address', undef );
-       print "<div class='top'>\n";
-       print "<h1>Used address</h1>\n";
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Reset password', 'respass' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Used address', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ], [ 'Reset password', 'respass' ], [ 'Register', 'register' ] ] );
        print '<div class="error">
                <p>
                        An account for this address is already registered.
        print '<div class="error">
                <p>
                        An account for this address is already registered.
@@ -170,10 +159,7 @@ sub confirmSubmit( $$$ ) {
                return OK;
        }
        genHtmlHead( $req, 'Registered', undef );
                return OK;
        }
        genHtmlHead( $req, 'Registered', undef );
-       print "<div class='top'>\n";
-       print "<h1>Registered</h1>\n";
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Registered', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
        print '<p>
                        You have registered successfully.';
        genHtmlTail();
        print '<p>
                        You have registered successfully.';
        genHtmlTail();
@@ -183,11 +169,8 @@ sub confirmSubmit( $$$ ) {
 sub genLoginForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        $req->headers_out->add( 'Set-Cookie' => new CGI::Cookie( -name => 'cookie-test', -value => 1 ) );
 sub genLoginForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        $req->headers_out->add( 'Set-Cookie' => new CGI::Cookie( -name => 'cookie-test', -value => 1 ) );
-       genHtmlHead( $req, 'Login', undef );
-       print "<div class='top'>\n";
-       print '<h1>Login</h1>';
-       genLocMenu( $req, $args, [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genHtmlHead( $req, 'Log in', undef );
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Log in', [ [ 'Help', 'help', 'account' ] ], [ [ 'Register', 'register' ], [ 'Reset password', 'respass' ] ] );
        print '<div class="error"><p>'.$error.'</div>' if( defined $error );
        print '<form name="login" id="login" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=login"><table>';
        genForm( [ [ 'Login name or email:', 'text', 'login', 'maxlength="255"' ],
        print '<div class="error"><p>'.$error.'</div>' if( defined $error );
        print '<form name="login" id="login" method="POST" action="'.setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=login"><table>';
        genForm( [ [ 'Login name or email:', 'text', 'login', 'maxlength="255"' ],
@@ -258,10 +241,7 @@ sub notLoggedComplaint( $$$ ) {
 sub genResetPasswdForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Reset password', undef );
 sub genResetPasswdForm( $$$$ ) {
        my( $req, $args, $error, $values ) = @_;
        genHtmlHead( $req, 'Reset password', undef );
-       print "<div class='top'>\n";
-       print "<h1>Reset password</h1>\n";
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Register', 'register' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ], [ 'Register', 'register' ] ] );
        print "<p>If you forgot your password (or didn't create one yet), you can reset it to a new value here.\n";
        print "Provide your email address here and further instructions will be sent to you.\n";
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print "<p>If you forgot your password (or didn't create one yet), you can reset it to a new value here.\n";
        print "Provide your email address here and further instructions will be sent to you.\n";
        print '<div class="error">'.$error.'</div>' if( defined $error );
@@ -297,10 +277,7 @@ sub resetPasswdFormSubmit( $$$ ) {
                        "\n\nThank you\n".
                        "\n(This is an autogenerated email, do not respond to it)" );
                genHtmlHead( $req, 'Reset password', undef );
                        "\n\nThank you\n".
                        "\n(This is an autogenerated email, do not respond to it)" );
                genHtmlHead( $req, 'Reset password', undef );
-               print "<div class='top'>\n";
-               print "<h1>Reset password</h1>\n";
-               genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
-               print "<div class='clear'></div></div>\n";
+               genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
                print "<p>An email with information has been sent to your address.\n";
                genHtmlTail();
                return OK;
                print "<p>An email with information has been sent to your address.\n";
                genHtmlTail();
                return OK;
@@ -313,10 +290,7 @@ sub resetPasswdFormSubmit( $$$ ) {
 sub genResetPasswdConfigForm( $$$$$$ ) {
        my( $req, $args, $error, $values, $email, $hash ) = @_;
        genHtmlHead( $req, 'Reset password', undef );
 sub genResetPasswdConfigForm( $$$$$$ ) {
        my( $req, $args, $error, $values, $email, $hash ) = @_;
        genHtmlHead( $req, 'Reset password', undef );
-       print "<div class='top'>\n";
-       print "<h1>Reset password</h1>\n";
-       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print "<p>You can enter new password here:\n";
        print '<form name="respass-confirm" id="respass-confirm" method="POST" action="">
        print '<div class="error">'.$error.'</div>' if( defined $error );
        print "<p>You can enter new password here:\n";
        print '<form name="respass-confirm" id="respass-confirm" method="POST" action="">
@@ -368,10 +342,7 @@ sub resetPasswdConfirmFormSubmit( $$$ ) {
                if( defined( $myHash ) && ( $myHash eq $hash ) ) {
                        changePasswd( $tables, $id, $data->{'password'}, $email );
                        genHtmlHead( $req, 'Reset password', undef );
                if( defined( $myHash ) && ( $myHash eq $hash ) ) {
                        changePasswd( $tables, $id, $data->{'password'}, $email );
                        genHtmlHead( $req, 'Reset password', undef );
-                       print "<div class='top'>\n";
-                       print "<h1>Reset password</h1>\n";
-                       genLocMenu( $req, $args, [ [ 'Log in', 'login' ], [ 'Help', 'help', 'account' ] ] );
-                       print "<div class='clear'></div></div>\n";
+                       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] );
                        print "<p>Your password was successfuly changed.\n";
                        genHtmlTail();
                        return OK;
                        print "<p>Your password was successfuly changed.\n";
                        genHtmlTail();
                        return OK;
@@ -387,10 +358,7 @@ sub genProfileForm( $$$$$$ ) {
        delete $data->{'current_password'};
        delete $data->{'confirm_password'};
        delete $data->{'password'};
        delete $data->{'current_password'};
        delete $data->{'confirm_password'};
        delete $data->{'password'};
-       print "<div class='top'>\n";
-       print "<h1>User profile</h1>\n";
-       genLocMenu( $req, $args, [ logItem( $auth ), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'profile' ] ] );
-       print "<div class='clear'></div></div>\n";
+       genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'User profile', [ [ 'Help', 'help', 'profile' ] ], [ logItem( $auth ), [ 'Notifications', 'notifications' ] ] );
        print '<div class="error"><p>'.$error.'</div>' if defined $error;
        print "<div class='info'><p>$info</div>\n" if defined $info;
        print '<form name="profile" id="profile" method="POST" action=""><table>';
        print '<div class="error"><p>'.$error.'</div>' if defined $error;
        print "<div class='info'><p>$info</div>\n" if defined $info;
        print '<form name="profile" id="profile" method="POST" action=""><table>';