You are here

function hook_browserclass_classes in Browser Class 6

Same name and namespace in other branches
  1. 7 browserclass.api.php \hook_browserclass_classes()

Add new classes to the body.

The returnd array will merged with browserclass module's detected classes. Create the conditions by user agent.

Parameters

string $agent Lowercase version of user agent:

Return value

array of defined classes

1 invocation of hook_browserclass_classes()
browserclass_get_classes in ./browserclass.module
Get classes.

File

./browserclass.api.php, line 18
Sample hooks demonstrating usage in Browser class module.

Code

function hook_browserclass_classes($agent) {
  $classes = array();
  if (stristr($agent, 'something') !== FALSE) {
    $classes[] = 'myclass';
  }
  if (stristr($agent, 'something2') !== FALSE) {
    $classes[] = 'myclass2';
  }
  return $classes;
}