You are here

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

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

File

lib/RuleWeightKeeper.php, line 63

Class

crumbs_RuleWeightKeeper

Code

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