Filters

padams edited this page Jan 28, 2015 · 1 revision

Filters allow module developers can create custom module functions that can be used to alter the value of different variables generated by OWA.

Table of Contents

Registering A Filter

Filters should be registered in the constructor of your module. To register a filter function use the registerFilter module method passing it the name of the value that is to be filtered, the object that contains the filter function, the function name, and an optional priority.

For example, let's say that you want to filter the value that OWA generates for a visitors operating system. Registering a custom function to filter this value would look like:

$this->registerFilter('operating_system', $this, 'myFunctionName');

This would register a filter function named myFunctionName. Because $this object was passed, it tells OWA that the function is a method in same module. You can house filter functions in other objects and pass a refernece to that object instead like so:

$mynewobject = new yourClass;
$this->registerFilter('operating_system', $mynewobject, 'myFunctionName');

Filter Hooks

The Following is the list of values that can be filtered.

Event Processing


Value Name Description Arguments Version Added
operating_system The os of the visitor. $os - the operating system, $ua - the user agent of the visitor. 1.2.3
user_agent The user agent of the visitor. 1.2.3
http_referrer The http referer of the visitor. 1.2.3
http_host The http host of the visitor 1.2.3
page_type The page type of the url being tracked 1.2.3
ip_address The ip address of the visitor 1.2.3
full_host The full host name of the visitor $fullhost - the full host name, $ip_address - the IP address of the visitor. 1.2.3
host The domain name of the full host of the user $host - the mid level host name, $ip_address - the IP address of the visitor. 1.2.3
browser_type The family of browser of the visitor (eg. Firefox, Safari, etc.) 1.2.3
browser The label of the browser of the visitor 1.2.3
user_name The user name of the visitor 1.2.3
user_email The email address of the visitor 1.2.3
page_url The url of the web page being tracked 1.2.3
target_url The url of the link or anchor tag that was clicked on. 1.2.3
post_processed_tracking_event The event after it has been processed but before it is sent to handlers. $event - an OWA tracking event object. 1.2.3

Framework

Value Name Description Arguments Version Added
auth_status The authentication status returned by OWA's auth module. Fired after OWA attempts to authenticate the user. Use this filter to add your own authentication logic. $auth_status (boolean) 1.3.0