You are here

function advanced_forum_style_info in Advanced Forum 6.2

Same name and namespace in other branches
  1. 7.2 includes/style.inc \advanced_forum_style_info()

Get the info for a style, using an additive notation to include all items from the parent lineage.

1 call to advanced_forum_style_info()
advanced_forum_get_forums in includes/core-overrides.inc
Returns a list of all forums for a given taxonomy id

File

includes/style.inc, line 115
Functions relating to the style system, not including core hooks and preprocess / theme functions.

Code

function advanced_forum_style_info($style = NULL) {
  static $info = array();
  if (empty($style)) {

    // If no style is passed in, assume the current style is wanted.
    $style = advanced_forum_get_current_style();
  }
  if (!array_key_exists($style, $info)) {
    $info[$style] = array();
    $lineage = advanced_forum_style_lineage();
    foreach ($lineage as $key => $dir) {

      // using the + operator is additive but will not overwrite.
      // $lineage comes out as the actual style with each
      // successive style after it, so simply adding the arrays
      // together means that all info will be combined and keys
      // in the parent info will be defaults passed down to children
      // only if they do not override them.
      $info[$style] += advanced_forum_get_style($key);
    }
  }
  return $info[$style];
}