You are here

protected function crumbs_RuleWeightKeeper::_findWildcardWeight in Crumbs, the Breadcrumbs suite 6.2

Same name and namespace in other branches
  1. 7 lib/RuleWeightKeeper.php \crumbs_RuleWeightKeeper::_findWildcardWeight()
2 calls to crumbs_RuleWeightKeeper::_findWildcardWeight()
crumbs_RuleWeightKeeper::findWeight in ./crumbs.plugin_engine.inc
Determine the weight for the rule specified by the key.
crumbs_RuleWeightKeeper::_buildPrefixedWeightKeeper in ./crumbs.plugin_engine.inc

File

./crumbs.plugin_engine.inc, line 293

Class

crumbs_RuleWeightKeeper

Code

protected function _findWildcardWeight($key) {
  $fragments = explode('.', $key);
  $partial_key = array_shift($fragments);
  $weight = $this->_rule_weights['*'];
  while (!empty($fragments)) {
    if (isset($this->_rule_weights[$partial_key . '.*'])) {
      $weight = $this->_rule_weights[$partial_key . '.*'];
    }
    $partial_key .= '.' . array_shift($fragments);
  }
  return $weight;
}