function styles_get_styles_class_by_class_name in Styles 6
Same name and namespace in other branches
- 6.2 styles.module \styles_get_styles_class_by_class_name()
- 7.2 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.
1 call to styles_get_styles_class_by_class_name()
- styles_autoload in ./
styles.module - Autoload the Styles object classes when needed.
File
- ./
styles.module, line 313 - Bundles similar display formatters together.
Code
function styles_get_styles_class_by_class_name($class_name = NULL, $reset = FALSE) {
$classes =& _styles_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)) {
return $classes[$class_name];
}
return $classes;
}