ClientAreaPrimarySidebar.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxVPS Product developed. (26.03.19)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. $hookManager->register(
  20. function (\WHMCS\View\Menu\Item $primarySidebar)
  21. {
  22. if(!\ModulesGarden\Servers\ProxmoxCloudVps\App\Helpers\ProxmoxAddonValidator::isInstalled()){
  23. return;
  24. }
  25. /**
  26. * @var main\Core\Http\Request $request
  27. */
  28. $request = \ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper\sl('request');
  29. logModuleCall(
  30. 'proxmoxCloud',
  31. __FUNCTION__,
  32. $primarySidebar,
  33. 'Debug',
  34. $request
  35. );
  36. if (!$request->get('id'))
  37. {
  38. return;
  39. }
  40. $clientAreaSideBar = new \ModulesGarden\ProxmoxAddon\App\Services\Cloud\ClientAreaSidebarService($request->get("id"), $primarySidebar);
  41. if (!$clientAreaSideBar->isActive() || !$clientAreaSideBar->isSupportedModule())
  42. {
  43. return;
  44. }
  45. if (!function_exists('ModuleBuildParams'))
  46. {
  47. require_once \ModulesGarden\Servers\ProxmoxCloudVps\Core\ModuleConstants::getFullPathWhmcs('includes') . DIRECTORY_SEPARATOR . "modulefunctions.php";
  48. }
  49. //Page Cancel
  50. if ($request->get('action') == "cancel")
  51. {
  52. $clientAreaSideBar->informationReplaceUri();
  53. } //Page Productdetails
  54. if ($request->get('action') == "productdetails")
  55. {
  56. $clientAreaSideBar->informationReplaceUri();
  57. $clientAreaSideBar->serviceDetailsOverview();
  58. $clientAreaSideBar->build();
  59. }
  60. }, 943
  61. );