Skip to content

Commit

Permalink
See Tag Only On Active Itemtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmr committed Dec 19, 2024
1 parent bd9f004 commit 9bde10e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/tag.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ public static function getBlacklistItemtype()
*/
public static function canItemtype($itemtype = '')
{
return !empty($itemtype) && class_exists($itemtype) && !in_array($itemtype, self::getBlacklistItemtype());
$tags = new self();
$types_menu = [];
foreach ($tags->find(['is_active' => 1]) as $tag) {
$types_menu = array_merge($types_menu ,json_decode($tag['type_menu']));
}
return !empty($itemtype) && class_exists($itemtype) && !in_array($itemtype, self::getBlacklistItemtype()) && in_array($itemtype, $types_menu);
}

public function showForm($ID, $options = [])
Expand Down

0 comments on commit 9bde10e

Please sign in to comment.