Skip to content

Commit 9a2a11a

Browse files
committed
comment out unused code
1 parent 61a59b9 commit 9a2a11a

File tree

2 files changed

+67
-67
lines changed

2 files changed

+67
-67
lines changed

Diff for: resources/lib/UnityGroup.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ public function requestGroup($send_mail_to_admins, $send_mail = true)
9393
"group_request"
9494
);
9595

96-
$this->WEBHOOK->sendWebhook(
97-
"group_request_admin",
98-
array(
99-
"user" => $this->getOwner()->getUID(),
100-
"org" => $this->getOwner()->getOrg(),
101-
"name" => $this->getOwner()->getFullname(),
102-
"email" => $this->getOwner()->getMail()
103-
)
104-
);
96+
// $this->WEBHOOK->sendWebhook(
97+
// "group_request_admin",
98+
// array(
99+
// "user" => $this->getOwner()->getUID(),
100+
// "org" => $this->getOwner()->getOrg(),
101+
// "name" => $this->getOwner()->getFullname(),
102+
// "email" => $this->getOwner()->getMail()
103+
// )
104+
// );
105105

106106
if ($send_mail_to_admins) {
107107
$this->MAILER->sendMail(

Diff for: resources/lib/UnityWebhook.php

+58-58
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,69 @@
1-
<?php
1+
// <?php
22

3-
namespace UnityWebPortal\lib;
3+
// namespace UnityWebPortal\lib;
44

5-
class UnityWebhook
6-
{
7-
private $template_dir;
8-
private $override_template_dir;
9-
private $url;
10-
private $MSG_LINKREF;
5+
// class UnityWebhook
6+
// {
7+
// private $template_dir;
8+
// private $override_template_dir;
9+
// private $url;
10+
// private $MSG_LINKREF;
1111

12-
public function __construct(
13-
$template_dir,
14-
$override_template_dir,
15-
$url,
16-
$msg_linkref
17-
) {
18-
$this->template_dir = $template_dir;
19-
$this->override_template_dir = $override_template_dir;
20-
$this->url = $url;
21-
$this->MSG_LINKREF = $msg_linkref;
22-
}
12+
// public function __construct(
13+
// $template_dir,
14+
// $override_template_dir,
15+
// $url,
16+
// $msg_linkref
17+
// ) {
18+
// $this->template_dir = $template_dir;
19+
// $this->override_template_dir = $override_template_dir;
20+
// $this->url = $url;
21+
// $this->MSG_LINKREF = $msg_linkref;
22+
// }
2323

24-
public function htmlToMarkdown($html)
25-
{
26-
// Define regex patterns for each markdown format
27-
$bold = '/<(b|strong)\b[^>]*>(.*?)<\/(b|strong)>/s';
28-
$italic = '/<i\b[^>]*>(.*?)<\/i>/s';
29-
$strikethrough = '/<del\b[^>]*>(.*?)<\/del>/s';
30-
$link = '/<a\b[^>]*href=["\']?([^"\'\s]*)[^>]*>(.*?)<\/a>/s';
24+
// public function htmlToMarkdown($html)
25+
// {
26+
// // Define regex patterns for each markdown format
27+
// $bold = '/<(b|strong)\b[^>]*>(.*?)<\/(b|strong)>/s';
28+
// $italic = '/<i\b[^>]*>(.*?)<\/i>/s';
29+
// $strikethrough = '/<del\b[^>]*>(.*?)<\/del>/s';
30+
// $link = '/<a\b[^>]*href=["\']?([^"\'\s]*)[^>]*>(.*?)<\/a>/s';
3131

32-
// Replace each HTML tag with its corresponding markdown format
33-
$md = preg_replace($bold, '*$2*', $html);
34-
$md = preg_replace($italic, '_$1_', $md);
35-
$md = preg_replace($strikethrough, '~$1~', $md);
36-
$md = preg_replace($link, '$2: $1', $md);
32+
// // Replace each HTML tag with its corresponding markdown format
33+
// $md = preg_replace($bold, '*$2*', $html);
34+
// $md = preg_replace($italic, '_$1_', $md);
35+
// $md = preg_replace($strikethrough, '~$1~', $md);
36+
// $md = preg_replace($link, '$2: $1', $md);
3737

38-
// Replace any remaining HTML tags with an empty string
39-
$md = strip_tags($md);
38+
// // Replace any remaining HTML tags with an empty string
39+
// $md = strip_tags($md);
4040

41-
return $md;
42-
}
41+
// return $md;
42+
// }
4343

44-
public function sendWebhook($template = null, $data = null)
45-
{
46-
$template_filename = $template . ".php";
47-
if (file_exists($this->override_template_dir . "/" . $template_filename)) {
48-
$template_path = $this->override_template_dir . "/" . $template_filename;
49-
} else {
50-
$template_path = $this->template_dir . "/" . $template_filename;
51-
}
44+
// public function sendWebhook($template = null, $data = null)
45+
// {
46+
// $template_filename = $template . ".php";
47+
// if (file_exists($this->override_template_dir . "/" . $template_filename)) {
48+
// $template_path = $this->override_template_dir . "/" . $template_filename;
49+
// } else {
50+
// $template_path = $this->template_dir . "/" . $template_filename;
51+
// }
5252

53-
ob_start();
54-
include $template_path;
55-
$mes_html = ob_get_clean();
53+
// ob_start();
54+
// include $template_path;
55+
// $mes_html = ob_get_clean();
5656

57-
$message = $this->htmlToMarkdown($mes_html);
57+
// $message = $this->htmlToMarkdown($mes_html);
5858

59-
$ch = curl_init();
60-
curl_setopt($ch, CURLOPT_URL, $this->url);
61-
curl_setopt($ch, CURLOPT_POST, 1);
62-
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
63-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
64-
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('text' => $message)));
65-
$result = curl_exec($ch);
66-
curl_close($ch);
67-
return $result;
68-
}
69-
}
59+
// $ch = curl_init();
60+
// curl_setopt($ch, CURLOPT_URL, $this->url);
61+
// curl_setopt($ch, CURLOPT_POST, 1);
62+
// curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
63+
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
64+
// curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array('text' => $message)));
65+
// $result = curl_exec($ch);
66+
// curl_close($ch);
67+
// return $result;
68+
// }
69+
// }

0 commit comments

Comments
 (0)