You are here

function styles_get_styles_class_by_class_name in Styles 7.2

Same name and namespace in other branches
  1. 6.2 styles.module \styles_get_styles_class_by_class_name()
  2. 6 styles.module \styles_get_styles_class_by_class_name()

Return the registered Styles class definition specified by name.

Parameters

string $class_name: (Optional) The name of the class definition to return. If NULL, then return all class definitions.

boolean $reset: (Optional) If TRUE, then reset the static array of class definitions.

Return value

mixed Either the specified Styles class definition, or all defined definitions if $class_name is NULL.

File

./styles.module, line 448
Bundles similar display formatters together.

Code

function styles_get_styles_class_by_class_name($class_name = NULL, $reset = FALSE) {
  $classes =& drupal_static(__FUNCTION__);
  if (!isset($classes) || $reset) {
    $classes = array();
    $registered_classes = styles_get_registered_classes();
    foreach ($registered_classes as $scheme => $class) {
      $classes[$class['class_name']] = $class;
    }
  }
  if (isset($class_name) && isset($classes[$class_name])) {
    return $classes[$class_name];
  }
  else {
    if (!isset($class_name)) {
      return $classes;
    }
  }
}