You are here

public function _menu_editor_NotifyEngine::notifyItem in Menu Editor 6.3

File

./menu_editor.admin.inc, line 363

Class

_menu_editor_NotifyEngine

Code

public function notifyItem(&$item) {
  while (TRUE) {
    $last_item = end($this->_trail);
    if (!$last_item || $last_item['mlid'] === $item['plid']) {
      $this->_trail[$item['mlid']] = $item;
      break;
    }
    array_pop($this->_trail);
  }
  $module_run = array();
  foreach (array(
    'notifyItem__' . preg_replace('/[^a-z0-9]/', '_', strtolower($item['router_path'])),
    'notifyItem',
  ) as $method) {
    if (isset($this->_listeners[$method])) {
      foreach ($this->_listeners[$method] as $module => $listener) {
        if (!isset($module_run[$module])) {
          $listener
            ->{$method}($item, $this->_trail);
          $module_run[$module] = TRUE;
        }
      }
    }
  }
}