| | |
| | | } |
| | | |
| | | } |
| | | return $icon; |
| | | return match($icon) { |
| | | 'favourites' => 'heart', |
| | | default => $icon |
| | | }; |
| | | }); |
| | | } |
| | | protected function getSlug(string $slug, string $page):string |
| | |
| | | //content types |
| | | $all = array_merge( |
| | | Registrar::getRegistered('post'), |
| | | Registrar::getFeatured('is_content', 'term') |
| | | Registrar::withFeature('is_content', 'term') |
| | | ); |
| | | $availableContent = array_filter($pages, function($page, $key) use($all) { |
| | | return !is_numeric($key) && in_array($key, $all) && JVB()->roles()->checkRole($this->user, $key); |
| | |
| | | <?php |
| | | $i=1; |
| | | $content = Registrar::getRegistered('post'); |
| | | $contentTax = Registrar::getFeatured('is_content', 'term'); |
| | | $contentTax = Registrar::withFeature('is_content', 'term'); |
| | | $taxonomies = Registrar::getRegistered('term'); |
| | | foreach($contentTax as $index => $tax) { |
| | | unset($taxonomies[$index]); |
| | |
| | | $pages[] = 'Favourites'; |
| | | } |
| | | |
| | | if (!empty(Registrar::getFeatured('karma'))) { |
| | | if (!empty(Registrar::withFeature('karma'))) { |
| | | $pages[] = 'Karmic Score'; |
| | | } |
| | | |
| | |
| | | foreach ($roles as $role) { |
| | | $contents = Registrar::getInstance($role)?->getCreatable(); |
| | | if (!empty($contents)) { |
| | | $hasKarma = Registrar::getFeatured('karma'); |
| | | $hasKarma = Registrar::withFeature('karma'); |
| | | $remove = empty(array_intersect($contents, $hasKarma)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | protected function getRolesWithDashboard():array |
| | | { |
| | | return Registrar::getFeatured('has_dashboard', 'user'); |
| | | return Registrar::withFeature('has_dashboard', 'user'); |
| | | } |
| | | |
| | | /** |