]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - misc/channel-lookup-misc.php
3 function generate_chanbans_table($channel)
6 $channel = $rpc->channel()->get($channel->name
);
8 <form method
="post"><p
>
9 <button
class="btn btn-info btn-sm" type
="submit" name
="delete_sel_ban">Delete
</button
>
11 <table
class="table table-responsive table-hover">
12 <thead
class="table-info">
13 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_chanbans(this)" /></th
>
21 foreach ($channel->bans
as $ban) {
23 echo "<td scope=\"row\"><input type=\"checkbox\" value='$ban->name' name=\"cb_checkboxes[]\"></td>";
24 echo "<td><code>".htmlspecialchars($ban->name
)."</code></td>";
25 $set_by = htmlspecialchars($ban->set_by
);
26 echo "<td>$set_by</td>";
27 $set_at = $ban->set_at
;
28 echo "<td>$set_at</td>";
39 function generate_chaninvites_table($channel)
42 $channel = $rpc->channel()->get($channel->name
);
44 <form method
="post"><p
>
45 <button
class="btn btn-info btn-sm" type
="submit" name
="delete_sel_inv">Delete
</button
>
47 <table
class="table table-responsive table-hover">
48 <thead
class="table-info">
49 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_chaninvs(this)" /></th
>
57 foreach ($channel->invite_exceptions
as $inv) {
59 echo "<td scope=\"row\"><input type=\"checkbox\" value='$inv->name' name=\"ci_checkboxes[]\"></td>";
60 echo "<td><code>".htmlspecialchars($inv->name
)."</code></td>";
61 $set_by = htmlspecialchars($inv->set_by
);
62 echo "<td>$set_by</td>";
63 $set_at = $inv->set_at
;
64 echo "<td>$set_at</td>";
77 function generate_chanexcepts_table($channel)
80 $channel = $rpc->channel()->get($channel->name
);
82 <form method
="post"><p
>
83 <button
class="btn btn-info btn-sm" type
="submit" name
="delete_sel_ex">Delete
</button
>
85 <table
class="table table-responsive table-hover">
86 <thead
class="table-info">
87 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_chanexs(this)" /></th
>
95 foreach ($channel->ban_exemptions
as $ex) {
97 echo "<td scope=\"row\"><input type=\"checkbox\" value='$ex->name' name=\"ce_checkboxes[]\"></td>";
98 echo "<td><code>".htmlspecialchars($ex->name
)."</code></td>";
99 $set_by = htmlspecialchars($ex->set_by
);
100 echo "<td>$set_by</td>";
101 $set_at = $ex->set_at
;
102 echo "<td>$set_at</td>";
115 * Generate the user list of a channel
117 * Why is it called chan occupants? o.o
118 * For the code, to avoid mixups
119 * It's called "User List" on the website
120 * @param mixed $channel
123 function generate_chan_occupants_table($channel)
126 <form method
="post"><p
>
129 <table
class="table table-responsive table-hover">
130 <thead
class="table-info">
131 <th
><input type
="checkbox" label
='selectall' onClick
="toggle_checkbox(this)" /></th
>
139 foreach ($channel->members
as $member) {
141 echo "<td scope=\"row\"><input type=\"checkbox\" value='$member->id' name=\"checkboxes[]\"></td>";
142 echo "<td><a href=\"".BASE_URL
."users/details.php?nick=$member->id\">".htmlspecialchars($member->name
)."</a></td>";
143 echo "<td>Status</td>";
145 echo "<td>Deop</td>";
158 * Force loading of a particular modal by name
160 function chlkup_autoload_modal($name)
164 $
(document
).ready(function () {
165 $
("#<?php echo $name; ?>").modal("show");
172 function _do_chan_item_delete($chan, string $type, array $list, array &$errors) : bool
178 if ($type == "invite")
180 elseif ($type == "ban")
182 elseif ($type == "except")
192 if ($rpc->channel()->set_mode($chan->name
, "-$n", $str))
194 Message::Success("Deleted successfully
");
197 $errors[] = $rpc->error . " ($rpc->errno
)";
198 Message::Fail("An error occurred
: $rpc->error
");
202 function do_delete_invite($chan, $list)
205 _do_chan_item_delete($chan, "invite
", $list, $errs);
208 function do_delete_chanban($chan, $list)
211 _do_chan_item_delete($chan, "ban
", $list, $errs);
214 function do_delete_chanex($chan, $list)
217 _do_chan_item_delete($chan, "except
", $list, $errs);