ClientAreaPrimarySidebar.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. if (!$request->get('id'))
  30. {
  31. return;
  32. }
  33. $clientAreaSideBar = new \ModulesGarden\ProxmoxAddon\App\Services\Cloud\ClientAreaSidebarService($request->get("id"), $primarySidebar);
  34. if (!$clientAreaSideBar->isActive() || !$clientAreaSideBar->isSupportedModule())
  35. {
  36. return;
  37. }
  38. if (!function_exists('ModuleBuildParams'))
  39. {
  40. require_once \ModulesGarden\Servers\ProxmoxCloudVps\Core\ModuleConstants::getFullPathWhmcs('includes') . DIRECTORY_SEPARATOR . "modulefunctions.php";
  41. }
  42. //Page Cancel
  43. if ($request->get('action') == "cancel")
  44. {
  45. $clientAreaSideBar->informationReplaceUri();
  46. } //Page Productdetails
  47. if ($request->get('action') == "productdetails")
  48. {
  49. $clientAreaSideBar->informationReplaceUri();
  50. $clientAreaSideBar->serviceDetailsOverview();
  51. $clientAreaSideBar->build();
  52. }
  53. }, 943
  54. );