You are here

function ctools_class_add in Chaos Tool Suite (ctools) 7

Add an array of classes to the body.

Parameters

mixed $classes: A string or an array of class strings to add.

string $hook: The theme hook to add the class to. The default is 'html' which will affect the body tag.

3 calls to ctools_class_add()
CtoolsModuleTestCase::testClassesAdd in tests/ctools.test
Test that the ctools_classs_add works.
CtoolsModuleTestCase::testClassesAddRemove in tests/ctools.test
Test that the ctools_classs_add and ctools_classs_remove interact well.
CtoolsModuleTestCase::testClassesAddRemove2 in tests/ctools.test
Test that the ctools_classs_add and ctools_classs_remove interact well .. 2.

File

./ctools.module, line 535
CTools primary module file.

Code

function ctools_class_add($classes, $hook = 'html') {
  if (!is_array($classes)) {
    $classes = array(
      $classes,
    );
  }
  $static =& drupal_static('ctools_process_classes', array());
  if (!isset($static[$hook]['add'])) {
    $static[$hook]['add'] = array();
  }
  foreach ($classes as $class) {
    $static[$hook]['add'][] = $class;
  }
}