IRC.pm 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package Cpanel::iContact::Provider::Schema::IRC;
  2. use strict;
  3. use warnings;
  4. sub get_settings {
  5. my $help1 = <<HALP;
  6. <p>The IRC <em>channels</em> you wish to send cPanel & WHM notifications <em>to</em>.<br />
  7. For multiple channels, delimit them with commas.<br />
  8. Example: "#YOLO,#swag"</p>
  9. HALP
  10. my $help2 = <<HALP;
  11. <p>The IRC <em>nickname</em> you wish for cPanel & WHM notifications to use.<br />
  12. Example: "cPSaurus"</p>
  13. HALP
  14. my $help3 =<<HALP;
  15. <p>Whether or not the IRC server your Notification User is registered at supports SSL/TLS.<br />
  16. If set improperly, this will cause sending notifications to fail (some IRC servers <em>require</em> SSL/TLS, some <em>don't support it</em>).
  17. </p>
  18. HALP
  19. return {
  20. 'CONTACTIRC' => {
  21. 'shadow' => 1,
  22. 'type' => 'text',
  23. 'checkval' => sub {
  24. my $value = shift;
  25. my @chans = split( ",", $value );
  26. @chans = grep { index( $_, '#' ) != -1 } @chans;
  27. return join( ",", @chans );
  28. },
  29. 'label' => 'IRC Notification Destinations',
  30. 'help' => $help1,
  31. },
  32. 'IRCNICK' => {
  33. 'shadow' => 1,
  34. 'type' => 'text',
  35. 'label' => 'IRC Notification Bot Nickname',
  36. 'help' => $help2,
  37. },
  38. 'IRCUSESSL' => {
  39. 'type' => 'binary',
  40. 'label' => 'IRC: Use SSL/TLS?',
  41. 'help' => $help3,
  42. },
  43. };
  44. }
  45. sub get_config {
  46. my $svg = "%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%3E%3Cdefs%3E%3ClinearGradient%20gradientUnits%3D%22userSpaceOnUse%22%20x2%3D%2247%22%20x1%3D%220%22%3E%3Cstop%20stop-color%3D%22%23a9a3d4%22%2F%3E%3Cstop%20offset%3D%22.47%22%20stop-color%3D%22%2387baff%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2389ec85%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%220%22%20y1%3D%22556.24%22%20x2%3D%220%22%20y2%3D%22510.24%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%232e5378%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23387898%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%221%22%20x1%3D%22421.9%22%20y1%3D%22540.44%22%20x2%3D%22422.52%22%20y2%3D%22522.5%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20stop-color%3D%22%231584d8%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%231cb2ff%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cg%20transform%3D%22matrix%281.04866%200%200%201.04866-511.61-528.36%29%22%20stroke-width%3D%221.317%22%3E%3Crect%20y%3D%22510.24%22%20x%3D%22296.96%22%20height%3D%2246%22%20width%3D%2246%22%20fill%3D%22url%28%230%29%22%20rx%3D%2223%22%20stroke-width%3D%222.164%22%20transform%3D%22matrix%28.99507%200%200%20.99507%20192.37-3.883%29%22%2F%3E%3Cpath%20d%3D%22m423.44%20523.59l-1.172%204.7h3.223l1.184-4.7h2.698l-1.184%204.7h3.381v2.6h-4.03l-.842%203.345h3.467v2.625h-4.102l-1.172%204.675h-2.698l1.172-4.675h-3.223l-1.172%204.675h-2.722l1.172-4.675h-3.406v-2.625h4l.854-3.345h-3.455v-2.6h4.126l1.172-4.7h2.722m1.379%207.3h-3.223l-.854%203.345h3.223l.854-3.345%22%20fill%3D%22%23fff%22%20fill-opacity%3D%22.85%22%20transform%3D%22matrix%281.33747%200%200%201.33747-54.714-185.56%29%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";
  47. return {
  48. 'default_level' => 'All',
  49. 'display_name' => 'IRC',
  50. 'icon_name' => 'IRC',
  51. 'icon' => "data:image/svg+xml,$svg",
  52. };
  53. }
  54. 1;