function add_cat_options(&$select, &$cat, &$cat_ids, $groupName = '') { if (empty($cat)) { return; } $cat_ids[] = $cat->getId(); $select->add_option($cat->getName(), $cat->getId(), $cat->getId(), $cat->getParentId()); $childs = $cat->getChildren(); if (is_array($childs)) { foreach ($childs as $child) { add_cat_options($select, $child, $cat_ids, $cat->getName()); } } }
function add_cat_options(&$select, &$cat, &$cat_ids, $groupName = '', $nbsp = '') { global $REX_USER; if (empty($cat)) { return; } $cat_ids[] = $cat->getId(); if ($REX_USER->isValueOf("rights", "admin[]") || $REX_USER->isValueOf("rights", "csw[0]") || $REX_USER->isValueOf("rights", "csr[" . $cat->getId() . "]") || $REX_USER->isValueOf("rights", "csw[" . $cat->getId() . "]")) { $select->add_option($nbsp . $cat->getName(), $cat->getId()); $childs = $cat->getChildren(); if (is_array($childs)) { $nbsp = $nbsp . ' '; foreach ($childs as $child) { add_cat_options($select, $child, $cat_ids, $cat->getName(), $nbsp); } } } }
function add_cat_options(&$select, &$cat, &$cat_ids) { global $REX_USER; if (empty($cat)) { return; } $cat_ids[] = $cat->getId(); if ($REX_USER->hasPerm('admin[]') || $REX_USER->hasPerm('csw[0]') || $REX_USER->hasPerm('csr[' . $cat->getId() . ']') || $REX_USER->hasPerm('csw[' . $cat->getId() . ']')) { $select->addOption($cat->getName(), $cat->getId(), $cat->getId(), $cat->getParentId()); $childs = $cat->getChildren(); if (is_array($childs)) { foreach ($childs as $child) { add_cat_options($select, $child, $cat_ids); } } } }