X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=PciIds%2FHtml%2FAdmin.pm;h=c1ef0517a6ff110923607cfdcc294b4fd66437d2;hb=c283ded753a71438790694d443171c33f95a04c2;hp=a8aa592884e337b6c326c25a90b0a177e46b09ac;hpb=b6ba9607f9f08eddea8c6cd6ef3120984eae831a;p=pciids.git diff --git a/PciIds/Html/Admin.pm b/PciIds/Html/Admin.pm index a8aa592..c1ef051 100644 --- a/PciIds/Html/Admin.pm +++ b/PciIds/Html/Admin.pm @@ -10,14 +10,27 @@ use PciIds::Address; use PciIds::Log; use Apache2::Const qw(:common :http); -sub genNewAdminForm( $$$$ ) { - my( $req, $args, $tables, $error ) = @_; +sub safeEncode( $ ) { + my( $text ) = @_; + return encode( $text ) if defined $text; + return ''; +} + +sub mailEncode( $ ) { + my( $email ) = @_; + return '' unless defined $email; + return "".encode( $email ).""; +} + +sub genNewAdminForm( $$$$$ ) { + my( $req, $args, $tables, $error, $auth ) = @_; my $address = PciIds::Address::new( $req->uri() ); my $prefix = $address->get(); $prefix = '' if( $args->{'global'} ); - my $caption = 'Administration â pending events '.( $args->{'global'} ? '(Global)' : '('.encode( $address->pretty() ).')' ); + my $caption = 'Administration '.( $args->{'global'} ? '(Global)' : '('.encode( $address->pretty() ).')' ); genHtmlHead( $req, $caption, undef ); - genCustomHead( $req, $args, $address, $caption, [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Help', 'help', 'admin' ], [ '', 'jump' ] ], [ [ 'Log out', 'logout' ] ] ); + my $glob = delete $args->{'global'}; + genCustomHead( $req, $args, $address, $caption, [ $address->canAddItem() ? [ 'Add item', 'newitem' ] : (), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), $glob ? [ 'Local', 'admin' ] : [ 'Global', 'admin?global=1' ], [ 'Help', 'help', 'admin' ], [ '', 'jump' ] ], [ [ 'Log out', 'logout' ] ] ); print "