BoltWire is a FREE content management system written in PHP.

Its innovative architecture combined with best-in-class forms processing makes it ideal for creating complex, interactive, web applications fast...




Tutorials > Webhooks

BoltWire provides a number of webhooks to developers who wish to modify how the engine works. Using these webhooks rather than hacking the core code directly keeps your changes from being overwritten when you upgrade.

Suppose you wanted to change how the report engine works. You simply create a custom function called myBOLTdisplay and put it in your config.php file (or a plugin), and BoltWire will call your function rather than the system function BOLTdisplay.

Available Webhooks

Listed below are the available webhooks:

Changes how skin selection is made. Found in engine.php and replaces about four lines of code. Must return a skin name, and set $BOLTskin as a global variable.

Changes how the skin is constructed. Also found in engine.php and replaces about 15 lines of code. Returns a pretty much finished html output.

myBOLTdisplay($outarray, $args, $zone);
This is the main function in BoltWire's report engine for list and search functions.

myBOLTmarkupRules($page, $zone, $out, $rules);
This allows you to dynamically change what rules are used in certain situations.

myBOLTexists($page, $dir);
Change how BoltWire checks to see if a page exists. Could be helpful if you store and retrieve pages in alternative ways, such as a database.

myBOLTfolders($page, $htaccess);
Change how BoltWire assigns pages to subfolders

myBOLTgetlink($type, $start, $page);
Change how BoltWire decides what page goes in each zone. Basically this hierarchical nature of page names.

Control how individual zones get constructed. Can override it for specific zones if you want--perhaps using html caching for performance boost or something similar.

Change how BoltWire indexes pages.

myBOLTloadpage($page, $dir, $data, $auth);
Changes how BoltWire retrieves page information. Use to hook BoltWire up to a database or something similar.

myBOLTfuncOutput($value, $args);
Change how BoltWire can modify the output of functions/commands using parameters like output=html.

myBOLTpageshortcuts($link, $basepage);
Change the page name shortcut system in BoltWire.

myBOLTsavepage($page, $newcontent, $newdata, $conflict);
Changes how BoltWire stores page information. Use to hook BoltWire up to a database or something similar.

myBOLTsearchResults($outarray, $args);
This function is used to refine raw pagelists generated by the search function, using parameters like count and sort, etc.

myBOLTsecureForm($field, $value, $args);
You can modify how BoltWire processes user values submitted in form input fields.

myBOLTtranslate($text, $language, $reverse);
Come up with your own translation engine.

myBOLTMlinks($link, $defaultAttr, $attr, $label, $missingPage);
This function uses the normal links markup to parse the basic link, but then allows you to customize the final result just before returning it to the page.

More Options

To create new commands, functions, or conditions simply create a new function called BOLTXnewcommand, BOLTFnewfunction, BOLTCnewcondition. Model it on existing code or create something entirely new from scratch--and store it in config.php or a plugin. Just make sure you have the correct inputs and return the correct value. Call it using the name assigned to the function.

See the ToolMapping tutorial for information about how to overwrite any of the system commands, functions and conditions.

See the tutorial on the markup table for information about how to rewrite BoltWire's default markup table.