ClientAreaPrimarySidebar.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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\ProxmoxVps\App\Helpers\ProxmoxAddonValidator::isInstalled()){
  23. return;
  24. }
  25. /**
  26. * @var main\Core\Http\Request $request
  27. */
  28. $request = \ModulesGarden\Servers\ProxmoxVps\Core\Helper\sl('request');
  29. if (!$request->get('id'))
  30. {
  31. return;
  32. }
  33. $clientAreaSideBar = new \ModulesGarden\ProxmoxAddon\App\Services\Vps\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\ProxmoxVps\Core\ModuleConstants::getFullPathWhmcs('includes') . DIRECTORY_SEPARATOR . "modulefunctions.php";
  41. }
  42. $params = \ModuleBuildParams($request->get("id"));
  43. \ModulesGarden\Servers\ProxmoxVps\Core\Helper\sl("whmcsParams")->setParams($params);
  44. if(!$clientAreaSideBar->isVpsCreated()){
  45. return;
  46. }
  47. //Page Cancel
  48. if ($request->get('action') == "cancel")
  49. {
  50. $clientAreaSideBar->informationReplaceUri();
  51. } //Page Productdetails
  52. else
  53. {
  54. if ($request->get('action') == "productdetails")
  55. {
  56. $clientAreaSideBar->informationReplaceUri();
  57. $clientAreaSideBar->build();
  58. }
  59. }
  60. }, 943
  61. );