/** * */ public function add($namespace, $data) { $style = new refnotes_namespace_style_info($namespace, $data); $parent = $style->getInheritedNamespace(); if ($parent == '' && $namespace->getScopesCount() == 1) { /* Default inheritance for the first scope */ $parent = refnotes_namespace::getParentName($namespace->getName()); } $index = $namespace->getStyleIndex($this->page->findParentNamespace($parent)); $this->index[$index][] = $style; }
/** * */ protected function createNamespace($name) { if ($name != ':') { $parentName = refnotes_namespace::getParentName($name); $parent = $this->getNamespace($parentName); $this->namespace[$name] = new refnotes_namespace($name, $parent); } else { $this->namespace[$name] = new refnotes_namespace($name); } if (array_key_exists($name, $this->presetStyle)) { $this->namespace[$name]->setStyle($this->presetStyle[$name]); } return $this->namespace[$name]; }