Skip to content

Commit

Permalink
refactor(form): factorize type name calls
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 30, 2023
1 parent 3dd6f98 commit 8d967fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion inc/entityconfig.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
$tabNames = [];
if (!$withtemplate) {
if ($item->getType() == 'Entity') {
$tabNames[1] = _n('Form', 'Forms', 2, 'formcreator');
$tabNames[1] = PluginFormcreatorForm::getTypeName(Session::getPluralNumber());
}
}
return $tabNames;
Expand Down
4 changes: 2 additions & 2 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
];
}
if ($item->getType() == Central::class) {
return _n('Form', 'Forms', Session::getPluralNumber(), 'formcreator');
return PluginFormcreatorForm::getTypeName(Session::getPluralNumber());
}
return '';
}
Expand Down Expand Up @@ -2029,7 +2029,7 @@ public function showForCentral() {

echo '<table class="tab_cadrehov" id="plugin_formcreatorHomepageForms">';
echo '<tr class="noHover">';
echo '<th><a href="' . FORMCREATOR_ROOTDOC . '/front/formlist.php">' . _n('Form', 'Forms', 2, 'formcreator') . '</a></th>';
echo '<th><a href="' . FORMCREATOR_ROOTDOC . '/front/formlist.php">' . PluginFormcreatorForm::getTypeName(Session::getPluralNumber()) . '</a></th>';
echo '</tr>';

$currentCategoryId = -1;
Expand Down

0 comments on commit 8d967fb

Please sign in to comment.