serviceAddon.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. if (!defined("WHMCS")) {
  3. die("This file cannot be accessed directly");
  4. }
  5. function serviceAddon_CreateAccount(array $params) {
  6. logModuleCall(
  7. 'iServiceAddon',
  8. __FUNCTION__,
  9. $params,
  10. 'Debug',
  11. App::self()
  12. );
  13. return 'success';
  14. }
  15. function serviceAddon_SuspendAccount(array $params) {
  16. return 'success';
  17. }
  18. function serviceAddon_UnsuspendAccount(array $params) {
  19. return 'success';
  20. }
  21. function serviceAddon_TerminateAccount(array $params) {
  22. return 'success';
  23. }
  24. function serviceAddon_ChangePackage(array $params) {
  25. return 'success';
  26. }
  27. function serviceAddon_TestConnection(array $params) {
  28. return 'success';
  29. }
  30. function serviceAddon_UsageUpdate(array $params) {
  31. return 'success';
  32. }
  33. function serviceAddon_ConfigOptions(array $params) {
  34. $response = localAPI('GetEmailTemplates');
  35. $emailTemplates = array('none');
  36. foreach ($response['emailtemplates']['emailtemplate'] as $emailTemplate) {
  37. array_push($emailTemplates, $emailTemplate['name']);
  38. }
  39. $configOptions = array("Create_Mail" => [
  40. "FriendlyName" => "Create Action E-Mail Template",
  41. "Type" => "dropdown", # Dropdown Choice of Options
  42. "Options" => $emailTemplates,
  43. "Description" => "E-Mail Template auswählen",
  44. "Default" => "option1",
  45. ]);
  46. logModuleCall(
  47. 'iServiceAddon',
  48. __FUNCTION__,
  49. $configOptions,
  50. 'Debug',
  51. $emailTemplates
  52. );
  53. /* return array(
  54. 'Dropdown Field' => array(
  55. 'Type' => 'dropdown',
  56. 'Options' => array(
  57. 'Display Value 1',
  58. 'Second Option',
  59. 'Another Option',
  60. ),
  61. 'Description' => 'Choose one',
  62. )
  63. ); */
  64. return $configOptions;
  65. }
  66. function serviceAddon_MetaData() {
  67. }
  68. function serviceAddon_AdminCustomButtonArray($params) {
  69. }
  70. function serviceAddon_AdminServicesTabFields($params) {
  71. }
  72. function serviceAddon_ClientArea($params) {
  73. return array(
  74. 'tabOverviewReplacementTemplate' => 'templates/clientarea',
  75. 'vars' => array(
  76. 'test1' => 'hello',
  77. 'test2' => 'world',
  78. ),
  79. );
  80. }