Response.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. /**
  8. * Description of Response
  9. *
  10. * @author Vitalii Aloksa
  11. */
  12. namespace MGModule\DNSManager2\mgLibs\ModuleAPI;
  13. use \MGModule\DNSManager2\mgLibs\lang;
  14. class Response
  15. {
  16. public static function successZoneRemove( )
  17. {
  18. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_removed_successfully' ));
  19. }
  20. public static function successZoneCreate( )
  21. {
  22. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_created_successfully' ));
  23. }
  24. public static function successZoneUpdate( )
  25. {
  26. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'zone_updated_successfully' ));
  27. }
  28. public static function successRecordsRemove( )
  29. {
  30. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_removed_successfully' ));
  31. }
  32. public static function successRecordsCreate( )
  33. {
  34. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_created_successfully' ));
  35. }
  36. public static function successRecordsUpdate( )
  37. {
  38. return array('message' => lang::T( 'addonCA','dashboard', 'infos' ,'records_updated_successfully' ));
  39. }
  40. public static function errorSubmodule( $param )
  41. {
  42. $erros = array(
  43. 'default' => '"There have been problems with Submodule. Please try again later.',
  44. 'notfound' => lang::T( 'addonCA','dns_submodule_connection_problem' )
  45. );
  46. return isset($erros[$param]) ? $erros[$param] : $erros['default'];
  47. }
  48. public static function proccessExceptionResponse( &$errors, $Exception )
  49. {
  50. $trace = $Exception->getTrace();
  51. if(!strpos($trace[0]['class'], '\loader'))
  52. {
  53. $errors[] = $Exception->getMessage();
  54. return ;
  55. }
  56. }
  57. }