protected function addCatOption(rex_category $cat, $group = null) { if (!$this->check_perms || $this->check_perms && rex::getUser()->getComplexPerm('structure')->hasCategoryPerm($cat->getId(), false)) { $cid = $cat->getId(); $cname = $cat->getName() . ' [' . $cid . ']'; if ($group === null) { $group = $cat->getParentId(); } $this->addOption($cname, $cid, $cid, $group); $childs = $cat->getChildren($this->ignore_offlines, $this->clang); if (is_array($childs)) { foreach ($childs as $child) { $this->addCatOption($child); } } } }
/** * Returns TRUE if this category is the direct * parent of the other category. * * @param self $otherCat * * @return bool */ public function isParent(self $otherCat) { return $this->getId() == $otherCat->getParentId() && $this->getClang() == $otherCat->getClang(); }