protected function addCatOptions() { if ($this->rootId !== null) { if (is_array($this->rootId)) { foreach ($this->rootId as $rootId) { if ($rootCat = rex_media_category::get($rootId)) { $this->addCatOption($rootCat); } } } else { if ($rootCat = rex_media_category::get($this->rootId)) { $this->addCatOption($rootCat); } } } else { if ($rootCats = rex_media_category::getRootCategories()) { foreach ($rootCats as $rootCat) { $this->addCatOption($rootCat); } } } }
$db->insert(); $success = rex_i18n::msg('pool_kat_saved', rex_request('catname')); rex_media_cache::deleteCategoryList(rex_request('cat_id', 'int')); } } catch (rex_sql_exception $e) { $error = $e->getMessage(); } $link = rex_url::currentBackendPage(array_merge($arg_url, ['cat_id' => ''])); $breadcrumb = []; $n = []; $n['title'] = rex_i18n::msg('pool_kat_start'); $n['href'] = $link . '0'; $breadcrumb[] = $n; $cat_id = rex_request('cat_id', 'int'); if ($cat_id == 0 || !($OOCat = rex_media_category::get($cat_id))) { $OOCats = rex_media_category::getRootCategories(); $cat_id = 0; $catpath = '|'; } else { $OOCats = $OOCat->getChildren(); $paths = explode('|', $OOCat->getPath()); for ($i = 1; $i < count($paths); ++$i) { $iid = current($paths); if ($iid != '') { $icat = rex_media_category::get($iid); $n = []; $n['title'] = $icat->getName(); $n['href'] = $link . $iid; $breadcrumb[] = $n; } next($paths);