Hook functions, also called just 'hooks' for short, are Perl subroutines that are intended as places for you to 'hook in' your own code - to customize the system.
Your use of them is entirely optional: all hooks have standard implementations that do the 'default thing' - so there is no requirement for you to change/implement any of the hooks if you dont want to.
Hooks are placed in separate Perl scripts with filenames starting '
pedserve-hook-'. E.g. '
pedserve-hook-page.pl' contains hooks for customizing the overall page layout of Pedserve-generated web pages. You can customize the hooks safe in the knowledge that we will not change the calling interface to them in future revisions of Pedserve.
Hooks allow you to control all sorts of things, e.g.:
- The style of user interface command items (push buttons).
- The contents of the site menu (which, in all the sample screenshots, is the left side menu).
- The appearance of the page menu (which, in the sample screenshots, is the 'ribbon bar' menu along the top).
- The HTML 'preamble' and 'postamble' - custom HTML that does after the opening <body> tag, and before the closing </body> tag.
- The contents of the 'front page' - the page that is displayed after the user logs in.
- The 'options bar' - this is the row containing (typically) pull-down menus that appears above search results listings and pedigrees etc.
- The date formatting and decoding - to allow dates to be both entered in, and displayed using, a localized format e.g. mm-dd-yy, mm-dd-yyyy etc.
- The code that connects to the MySQL database.
- The code that 'formats' field values as both HTML and text. This gives you total control over the appearance of all database data, should you want it!
- The highlighting methods - to add your own highlights. E.g. you might want to apply specific highlighting when an animal's record contains a particular value in a field. This can be used for lots of things e.g. color coding animals based on their coat colour, or emphasizing animals from given breeding lines, etc etc. Various highlighting methods are available - background color shading, hyper-linked icons, etc.
- You can add new 'cell' output layouts (called 'plates') for use when laying out pedigree ancestors, or grid mode search results.
- You can customize the harvester warning message that is displayed beneath most data pages.
- You can add custom 'shortcut' query buttons to the search screens.
If you have Pedserve Developer Edition, you also receive the fully commented code to all the Perl scripts that make up the system, so you can make other changes if you want. In contrast, the other editions provide the Perl scripts in a compacted, machine readable form unsuitable for user modification other than through the published hook mechanisms.
User Defined Fields
User Defined Records
Display Fields Definitions
Ordering Fields Definitions
Shortcut Query Buttons
Connecting to the Database
Warning Footer Message