You are not logged in.
Pages: 1
Hello ,
I try to add entry in tools menu but it doesn't work and I don't understand why....
here's my code:
setup.php
...
function plugin_init_mizuhocard() {
global $PLUGIN_HOOKS;
//required!
$PLUGIN_HOOKS['csrf_compliant']['mizuhocard'] = true;
//some code here, like call to Plugin::registerClass(), populating PLUGIN_HOOKS, ...
if (Plugin::isPluginActive('mizuhocard')) {
$PLUGIN_HOOKS['menu_toadd']['mizuhocard'] = ['Tools' => 'PluginMizuhocardMenu'];
}
}
inc/menu.class.php
<?php
class PluginMizuhocardMenu extends CommonGLPI {
static function getMenuName() {
return __('Mizuho Card plugin', 'mizuhocard');
}
static function getMenuContent() {
$URL=Plugin::getWebDir('mizuhocard').'/front/menu.php';
$menu = [
'title' => self::getMenuName(),
'page' => $URL,
'icon' => 'fas fa-file-import',
];
return $menu;
}
}
Any idea?
Offline
$URL=Plugin::getWebDir('mizuhocard').'/front/menu.php'; should be
$URL=Plugin::getWebDir('mizuhocard').'/front/mizuhocard.php';
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
even if I made the above changes the result is the same, no entry in tools menu
Offline
I'm a bit confused with your plugin class name
I thought class name should be like PluginMizuhocardsMisuhocard and then menu class like PluginMizuhocardsMizuhocardMenu (not sure this will solve your problem)
did you also create profile thats allows you to see the plugin , otherwise plugin menu wont show until you've got right profile.
Trouver la panne avant de réparer...
GLPI10.0.16 (ubuntu 22.04 PHP8.1 Mariadb10.6 ) plugins : comportements 2.7.3 reports 1.16.0 formcreator 2.13.9, datainjection 2.13.5 fields 1.21.9
Offline
Make sure you log out and back in or enable debug mode for your user when testing menu changes because otherwise, the menu content is cached in your login session data.
GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.
Offline
thanks , after logout and login I see the entry
Offline
Good day sir, I am facing the same issue. Can you please help me?
Offline
Pages: 1