Hi all, I'm currently in the process of writing a plugin to help keep track of inventory for my employer. I have followed POCTOB's unofficial guide for plugin creation. While it works for what I need, I'd like to build the GUI in the same fashion as osTicket's core. That is, using osTicket's header and footer and then sandwiching the content of my plugin between the two rather than using another method of page rendering like a third party template engine. However, I'm running into some issues with this. The main components of the osTicket page that I want is the header and footer. When I try to load the page through the nav bar, I get a php error:
PHP Fatal error: Uncaught Error: Call to a member function getAllowIframes() on null in C:\wamp64\www\osTicket\include\staff\header.inc.php:3
Stack trace:
#0 C:\wamp64\www\osTicket\include\plugins\osTicket-Inventory\include\controller\Controller.php(91): require()
#1 C:\wamp64\www\osTicket\include\class.dispatcher.php(145): controller\Controller->viewAction()
#2 C:\wamp64\www\osTicket\include\class.dispatcher.php(38): UrlMatcher->dispatch('', Array)
#3 C:\wamp64\www\osTicket\include\class.dispatcher.php(120): Dispatcher->resolve('', Array)
#4 C:\wamp64\www\osTicket\include\class.dispatcher.php(38): UrlMatcher->dispatch('/inventory/dash...', NULL)
#5 C:\wamp64\www\osTicket\scp\dispatcher.php(42): Dispatcher->resolve('/inventory/dash...')
#6 {main}
thrown in C:\wamp64\www\osTicket\include\staff\header.inc.php on line 3
I understand that there is some information I need to make sure is available for the header.inc.php file when I call it using require(header.inc.php), but I'm having trouble understanding where that information comes from (I assume it would be from osticket and not my plugin since this is a system setting). If anyone has any ideas for what I'm missing, or if this is even the correct way to do this, I'd appreciate it.
I'm sure I missed including some helpful information here so please don't hesitate to request clarification!
Thanks!