protected function crumbs_RuleWeightKeeper::_buildPrefixedWeightKeeper in Crumbs, the Breadcrumbs suite 6.2
Same name and namespace in other branches
- 7 lib/RuleWeightKeeper.php \crumbs_RuleWeightKeeper::_buildPrefixedWeightKeeper()
1 call to crumbs_RuleWeightKeeper::_buildPrefixedWeightKeeper()
File
- ./
crumbs.plugin_engine.inc, line 253
Class
Code
protected function _buildPrefixedWeightKeeper($prefix) {
$weights = array();
$k = strlen($prefix);
$weights[''] = $weights['*'] = $this
->_findWildcardWeight($prefix);
if (isset($this->_rule_weights[$prefix])) {
$weights[''] = $this->_rule_weights[$prefix];
}
if (isset($this->_rule_weights[$prefix . '.*'])) {
$weights['*'] = $this->_rule_weights[$prefix . '.*'];
}
foreach ($this->_rule_weights as $key => $weight) {
if (strlen($key) > $k && substr($key, 0, $k + 1) === $prefix . '.') {
$weights[substr($key, $k + 1)] = $weight;
}
}
return new crumbs_RuleWeightKeeper($weights);
}