From: Michal Vaner Date: Sat, 4 Oct 2008 22:06:28 +0000 (+0200) Subject: Move the jump bar below pages & add footer X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8b549c88560f0d2dd10f08b8a297b5d584e99af8;p=pciids.git Move the jump bar below pages & add footer --- diff --git a/PciIds/Html/Admin.pm b/PciIds/Html/Admin.pm index b142e05..8f344ec 100644 --- a/PciIds/Html/Admin.pm +++ b/PciIds/Html/Admin.pm @@ -194,7 +194,7 @@ function answer( id ) { print "

No pending items.\n"; } print "\n"; - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } diff --git a/PciIds/Html/Changes.pm b/PciIds/Html/Changes.pm index e839ab6..658db0f 100644 --- a/PciIds/Html/Changes.pm +++ b/PciIds/Html/Changes.pm @@ -52,7 +52,7 @@ sub genNewItemForm( $$$$$$ ) { If there is something you want to clarify about the item, you can use note (like the ID does not belong to people using it). Discussion is for things more relevant to history of the item than the real device (like information source). Both note and discussion is optional.'; - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } @@ -94,7 +94,7 @@ sub newItemSubmit( $$$$ ) { my $addr = PciIds::Address::new( $req->uri() ); genCustomHead( $req, $args, $addr, 'ID collision', [ [ 'Add other item', 'newitem' ], $addr->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), ], [ logItem( $auth ) ] ); print '

Sorry, this ID already exists.'; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } elsif( $result ) { return genNewItemForm( $req, $args, $auth, $tables, $result, $data ); @@ -137,7 +137,7 @@ sub genNewHistoryForm( $$$$$$ ) { You must provide at last name or discussion or deletion request.

If you provide note, you must provide name too.'; - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } diff --git a/PciIds/Html/Help.pm b/PciIds/Html/Help.pm index 42cc838..9096664 100644 --- a/PciIds/Html/Help.pm +++ b/PciIds/Html/Help.pm @@ -49,7 +49,7 @@ sub getHelp( $$ ) { print $line; } close HELP; - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } diff --git a/PciIds/Html/Jump.pm b/PciIds/Html/Jump.pm index 0e37bc5..4ebcc8f 100644 --- a/PciIds/Html/Jump.pm +++ b/PciIds/Html/Jump.pm @@ -83,7 +83,7 @@ sub jump( $$$$ ) { genHtmlHead( $req, 'Search results', undef ); print "

\n"; print "

Search results

\n"; - genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'jump' ], [ '', 'jump' ] ] ); + genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'jump' ] ] ); print "
\n"; print "
\n"; genPath( $req, $address, 1 ); @@ -97,7 +97,7 @@ sub jump( $$$$ ) { return "".encode( $address->fullPretty() ).""; } ], sub { 1; }, sub { ' class="item"'; } ); genTableTail(); - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } } diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index 1724445..b2f3df0 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -96,7 +96,7 @@ sub list( $$$$ ) { genTableTail(); print "

Add item\n"; } - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } diff --git a/PciIds/Html/Notifications.pm b/PciIds/Html/Notifications.pm index 1f673db..c8cc15c 100644 --- a/PciIds/Html/Notifications.pm +++ b/PciIds/Html/Notifications.pm @@ -64,7 +64,7 @@ sub genNotifForm( $$$$$$ ) { } print "\n"; } - genHtmlTail(); + genHtmlFooter( 1, $req, $args ); return OK; } diff --git a/PciIds/Html/Users.pm b/PciIds/Html/Users.pm index dab0700..99df698 100644 --- a/PciIds/Html/Users.pm +++ b/PciIds/Html/Users.pm @@ -44,7 +44,7 @@ sub genRegisterForm( $$$$ ) { genForm( [ [ 'Email:', 'text', 'email', 'maxlength="255"' ], [ '', 'submit', 'register', 'value="Register"' ] ], $values ); print ''; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -84,7 +84,7 @@ sub registerSubmit( $$$ ) {#A registration form has been submited print '

An email containing further information has been sent to you. Please follow these instruction to finish the registration process.'; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -102,7 +102,7 @@ sub genConfirmForm( $$$$ ) { [ 'Confirm password:', 'password', 'confirm_password' ], [ '', 'submit', 'register', 'value=Register' ] ], $values ); print ''; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -115,7 +115,7 @@ sub usedAddress( $$ ) { An account for this address is already registered. Please, reset or remember your password or start again with a different address. '; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return 0; } @@ -129,7 +129,7 @@ sub checkRegHash( $$$$$ ) { This registration request is invalid. Are you sure you got it from the registration email? '; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return 0; } elsif( $tables->hasEmail( $email ) ) { return usedAddress( $req, $args ); @@ -180,7 +180,7 @@ sub confirmSubmit( $$$ ) { genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Registered', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] ); print '

You have registered successfully.'; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -195,7 +195,7 @@ sub genLoginForm( $$$$ ) { [ 'Password:', 'password', 'password' ], [ '', 'submit', 'login', 'value="Login"' ] ], $values ); print ''; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -268,7 +268,7 @@ sub genResetPasswdForm( $$$$ ) { genForm( [ [ 'Email:', 'text', 'email', 'maxlength="255"' ], [ '', 'submit', 'respass', 'value="Send"' ] ], $values ); print ''; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -297,7 +297,7 @@ sub resetPasswdFormSubmit( $$$ ) { genHtmlHead( $req, 'Reset password', undef ); genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] ); print "

An email with information has been sent to your address.\n"; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } else { $error = '

This email address is not registered. Check it for typos or register it.'; @@ -319,7 +319,7 @@ sub genResetPasswdConfigForm( $$$$$$ ) { print ""; print "\n"; print "\n"; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } @@ -337,7 +337,7 @@ sub resetPasswdConfirmForm( $$$$ ) { print "

Reset password

\n"; print "

Provided link is not valid. Did you use it already?\n"; print "

You can get a new one.\n"; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } } @@ -362,7 +362,7 @@ sub resetPasswdConfirmFormSubmit( $$$ ) { genHtmlHead( $req, 'Reset password', undef ); genCustomHead( $req, $args, PciIds::Address::new( $req->uri() ), 'Reset password', [ [ 'Help', 'help', 'account' ] ], [ [ 'Log in', 'login' ] ] ); print "

Your password was successfuly changed.\n"; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } else { return genResetPasswdConfigForm( $req, $args, $error, $data, $email, $hash ); @@ -390,7 +390,7 @@ sub genProfileForm( $$$$$$ ) { [ 'Xmpp batch time (min):', 'text', 'xmpp_time', 'maxlength="10"' ], [ '', 'submit', 'profile', 'value="Submit"' ] ], $data ); print ''; - genHtmlTail(); + genHtmlFooter( 0, undef, undef ); return OK; } diff --git a/PciIds/Html/Util.pm b/PciIds/Html/Util.pm index 6668ac0..32173f2 100644 --- a/PciIds/Html/Util.pm +++ b/PciIds/Html/Util.pm @@ -25,7 +25,7 @@ use PciIds::Users; use Apache2::Const qw(:common :http); use APR::Table; -our @EXPORT = qw(&genHtmlHead &htmlDiv &genHtmlTail &genTableHead &genTableTail &parseArgs &buildExcept &buildArgs &genMenu &genCustomMenu &encode &setAddrPrefix &HTTPRedirect &genPath &logItem &genLocMenu &genCustomHead &genPathBare &protoName); +our @EXPORT = qw(&genHtmlHead &htmlDiv &genHtmlTail &genTableHead &genTableTail &parseArgs &buildExcept &buildArgs &genMenu &genCustomMenu &encode &setAddrPrefix &HTTPRedirect &genPath &logItem &genLocMenu &genCustomHead &genPathBare &protoName &genHtmlFooter); sub encode( $ ) { return encode_entities( shift, "\"'&<>" ); @@ -53,6 +53,30 @@ sub genHtmlTail() { print ''; } +sub genHtmlFooter( $$$ ) { + my( $jump, $req, $args ) = @_; + if( $jump ) { + require PciIds::Html::Jump; + PciIds::Html::Jump::jumpWindow( $req, $args ); + } + print '


+ + + + +
+Maintained by Martin Mares and Michal +Vaner with great help by volunteers from the pciids project +at SourceForge. + +Best viewed with any browser. + +SourceForge +
No counters, no frames, no syntax +errors.
+'; +} + sub htmlDiv( $$ ) { my( $class, $text ) = @_; return '
'.$text.'
';