You are here

protected function crumbs_PluginOperation_describe::_addRule in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 7.2 lib/PluginOperation/describe.php \crumbs_PluginOperation_describe::_addRule()
2 calls to crumbs_PluginOperation_describe::_addRule()
crumbs_PluginOperation_describe::addRule in lib/PluginOperation/describe.php
To be called from crumbs_InjectedAPI_describeMultiPlugin::addRule()
crumbs_PluginOperation_describe::setTitle in lib/PluginOperation/describe.php
To be called from crumbs_InjectedAPI_describeMonoPlugin::setTitle()

File

lib/PluginOperation/describe.php, line 58

Class

crumbs_PluginOperation_describe
This class uses the PluginOperation pattern, but it does not implement any of the PluginOperation interfaces. This is because it is not supposed to be used with the PluginEngine, but rather from a custom function (see above).

Code

protected function _addRule($key, $title) {
  $fragments = explode('.', $key);
  $partial_key = array_shift($fragments);
  while (TRUE) {
    if (empty($fragments)) {
      break;
    }
    $wildcard_key = $partial_key . '.*';
    $this->keys[$wildcard_key] = TRUE;
    $this->keysByPlugin[$this->pluginKey][$wildcard_key] = TRUE;
    $partial_key .= '.' . array_shift($fragments);
  }
  $this->keys[$key] = $title;
  $this->keysByPlugin[$this->pluginKey][$key] = $title;
}