return \@result;
}
+sub helpName( $ ) {
+ return undef;
+}
+
1;
return $result;
}
+sub helpName( $ ) {
+ return 'pci';
+}
+
1;
return ( PciIds::Address::new( $self->{'value'} . ( ( $self->{'value'} =~ /\/$/ ) ? '' : '/' ) . $suffix ), undef );
}
+sub helpName( $ ) {
+ return 'pci_class';
+}
+
1;
return undef;
}
+sub helpName( $ ) {
+ my( $self ) = @_;
+ if( $self->{'value'} =~ /^PC/ ) {
+ return 'pci';
+ } else {
+ return 'pci_class';
+ }
+}
+
1;
my $prettyAddr = encode( $address->pretty() );
genHtmlHead( $req, "$prettyAddr - add new item", undef );
print "<h1>$prettyAddr - add new item</h1>\n";
- genLocMenu( $req, $args, [ logItem( $auth ), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newitem' ] ] );
+ genLocMenu( $req, $args, [ logItem( $auth ), $address->canDiscuss() ? [ 'Discuss', 'newhistory' ] : (), [ 'Notifications', 'notifications' ], [ 'Help', 'help', 'newitem' ], [ 'ID syntax', 'help', $address->helpName() ] ] );
print "<div class='error'>$error</div>\n" if( defined $error );
print "<form name='newitem' id='newitem' method='POST' action=''>\n<table>";
genFormEx( [ [ 'input', 'Id:', 'text', 'id', 'maxlength="50"' ],
my $id = $address->pretty();
genHtmlHead( $req, $id, undef );
print '<h1>'.encode( $id ).'</h1>';
- genMenu( $req, $address, $args, $auth, 'list' );
+ genMenu( $req, $address, $args, $auth, [ [ 'Help', 'help', 'list' ], $address->helpName() ? [ 'ID syntax', 'help', $address->helpName() ] : () ] );
genPath( $req, $address, 0 );
print htmlDiv( 'name', '<p>'.encode( $name ) ) if( defined( $name ) );
print htmlDiv( 'note', '<p>'.encode( $note ) ) if( defined( $note ) );
}
sub genMenu( $$$$$ ) {
- my( $req, $address, $args, $auth, $help ) = @_;
+ my( $req, $address, $args, $auth, $append ) = @_;
my @list = ( logItem( $auth ) );
if( defined $address ) {
push @list, [ 'Add item', 'newitem' ] if( $address->canAddItem() );
push @list, [ 'Administrate', 'admin' ] if( hasRight( $auth->{'accrights'}, 'validate' ) );
push @list, [ 'Profile', 'profile' ] if defined $auth->{'authid'};
push @list, [ 'Notifications', 'notifications' ] if defined $auth->{'authid'};
- push @list, [ 'Help', 'help', $help ] if defined $help;
+ push @list, @{$append} if defined $append;
genCustomMenu( $req, $address, $args, \@list );
}