I created an extension module which extends a few CMDB classes and this it's working. I installed it and I'm also able to update it via the toolkit.
I then added a main.my-module.php file with the example code for the popup menu but it's not working. It seems it's not called, because when I insert a die() statement in the code it has no effect.
Any idea what's missing? Thanks in advance!
greetings
Martin
main.my-module.php
classMyPopupExtensionimplementsiPopupMenuExtension{publicstaticfunctionEnumItems($iMenuId,$param){if($iMenuId==self::MENU_OBJDETAILS_ACTIONS){$oObject=$param;if($oObjectinstanceofServer){$sUID='MyPopupExtension-Monitoring';// Make sure that each menu item has a unique "ID"$sLabel='Monthlyreport';$sURL='http://myapp/show_report?server_fqdn='.$oObject->Get('name');$sTarget='_blank';$oMenuItem=newURLPopupMenuItem($sUID,$sLabel,$sURL,$sTarget);returnarray($oMenuItem);}}returnarray();}}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
My installation:
iTop version 2.3.4-3302 built on 2017-04-14 19:00:51
Data model: 2.3.0
MySQL: 5.5.52-MariaDB
PHP: 5.4.16
I tried to implement a PopupMeu item as described in the documentation: https://wiki.openitop.org/doku.php?id=2_3_0:customization:extensions_api
I created an extension module which extends a few CMDB classes and this it's working. I installed it and I'm also able to update it via the toolkit.
I then added a main.my-module.php file with the example code for the popup menu but it's not working. It seems it's not called, because when I insert a die() statement in the code it has no effect.
Any idea what's missing? Thanks in advance!
greetings
Martin
main.my-module.php
Update: Solution found by Rafael: https://sourceforge.net/p/itop/discussion/922360/thread/088879eb/#2947
You have to add it to module.my...php