Skip to content

Commit

Permalink
feat: blacklist some types from tag plugin with hook
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Sep 6, 2022
1 parent aee2be0 commit e0898bb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions hook.php
Original file line number Diff line number Diff line change
Expand Up @@ -715,3 +715,14 @@ function plugin_formcreator_hook_update_user(CommonDBTM $item) {
}
}
}

function plugin_formcreator_hook_tag_blacklisted_types($list) {
return array_merge([
PluginFormcreatorFormanswer::class,
PluginFormcreatorSection::class,
PluginFormcreatorQuestion::class,
PluginFormcreatorTargetTicket::class,
PluginFormcreatorTargetChange::class,
PluginFormcreatorTargetProblem::class,
], $list);
}
1 change: 1 addition & 0 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ function plugin_formcreator_hook(): void {
}

$PLUGIN_HOOKS['dashboard_cards']['formcreator'] = 'plugin_formcreator_hook_dashboard_cards';
$PLUGIN_HOOKS['tag_get_blacklisted_types']['formcreator'] = 'plugin_formcreator_hook_tag_blacklisted_types';

if (Session::getLoginUserID() === false) {
return;
Expand Down

0 comments on commit e0898bb

Please sign in to comment.