CronSection.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxAddon product developed. (Sep 12, 2018)
  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. namespace ModulesGarden\ProxmoxAddon\App\UI\Settings\Sections;
  20. use ModulesGarden\ProxmoxAddon as main;
  21. use ModulesGarden\ProxmoxAddon\Core\ModuleConstants;
  22. /**
  23. * Description of CronSection
  24. *
  25. * @author Pawel Kopec <pawelk@modulesgardne.com>
  26. */
  27. class CronSection extends main\Core\UI\Widget\Forms\Sections\BoxSection
  28. {
  29. public function __construct($baseId = null)
  30. {
  31. parent::__construct();
  32. $this->initContent();
  33. }
  34. public function initContent()
  35. {
  36. $this->customTplVars['crons']['vps'] = ModuleConstants::getFullPath("cron", "cron.php") . " queue";
  37. $this->customTplVars['crons']['cloud'] = ModuleConstants::getFullPath("cron", "cron.php") . " rrddata";
  38. $this->customTplVars['crons']['users'] = ModuleConstants::getFullPath("cron", "cron.php") . " users";
  39. $this->customTplVars['crons']['recoveryList'] = ModuleConstants::getFullPath("cron", "cron.php") . " recoveryList";
  40. $this->customTplVars['crons']['migrateSync'] = ModuleConstants::getFullPath("cron", "cron.php") . " migrateSync";
  41. $this->customTplVars['crons']['task'] = ModuleConstants::getFullPath("cron", "cron.php") . " task";
  42. $this->customTplVars['crons']['usege'] = ModuleConstants::getFullPath("cron", "cron.php") . " update-server-usage";
  43. $this->customTplVars['crons']['backup'] = ModuleConstants::getFullPath("cron", "cron.php") . " remove-backups";
  44. $this->customTplVars['crons']['snapshots'] = ModuleConstants::getFullPath("cron", "cron.php") . " snapshots";
  45. $this->customTplVars['proxmoxVps'] = $this->isProxmoxVps();
  46. $this->customTplVars['proxmoxCloudVps'] = $this->isProxmoxCloud();
  47. }
  48. private function isProxmoxVps(){
  49. return file_exists(ModuleConstants::getFullPathWhmcs("modules", "servers", "proxmoxVPS", "proxmoxVPS.php"));
  50. }
  51. private function isProxmoxCloud(){
  52. return file_exists(ModuleConstants::getFullPathWhmcs("modules", "servers", "ProxmoxCloudVps", "ProxmoxCloudVps.php"));
  53. }
  54. }