- ?>
- <form method="post"><p>
- <button class="btn btn-info btn-sm" type="submit" name="delete_sel_ex">Delete</button>
- </p>
- <table class="table table-responsive table-hover">
- <thead class="table-info">
- <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
- <th>Name</th>
- <th>Set by</th>
- <th>Set at</th>
- <th></th>
- </thead>
- <tbody>
- <?php
- foreach ($channel->ban_exemptions as $ex) {
- echo "<tr>";
- echo "<td scope=\"row\"><input type=\"checkbox\" value='$ex->name' name=\"checkboxes[]\"></td>";
- echo "<td><code>".htmlspecialchars($ex->name)."</code></td>";
- $set_by = htmlspecialchars($ex->set_by);
- echo "<td>$set_by</td>";
- $set_at = $ex->set_at;
- echo "<td>$set_at</td>";
- echo "<td></td>";
- echo "</tr>";
- }
-
- ?>
- </tbody>
+ global $rpc;
+
+ $channel = $rpc->channel()->get($channel->name);
+ ?><p><table class="table table-sm table-responsive table-hover caption-top table-striped">
+ <button class="btn btn-primary mr-1 btn-sm" data-toggle="modal" data-target="#except">Add New</button>
+ <form method="post">
+ <button class="btn btn-info btn-sm" type="submit" name="delete_sel_ex">Delete</button>
+ </p>
+
+ <thead class="table-info">
+ <th><input type="checkbox" label='selectall' onClick="toggle_chanexs(this)" /></th>
+ <th>Name</th>
+ <th>Set by</th>
+ <th>Set at</th>
+ <th></th>
+ </thead>
+ <tbody>
+ <?php
+ foreach ($channel->ban_exemptions as $ex) {
+ echo "<tr>";
+ echo "<td scope=\"row\"><input type=\"checkbox\" value='$ex->name' name=\"ce_checkboxes[]\"></td>";
+ echo "<td><code>".htmlspecialchars($ex->name)."</code></td>";
+ $set_by = htmlspecialchars($ex->set_by);
+ echo "<td>$set_by</td>";
+ $set_at = $ex->set_at;
+ echo "<td>$set_at</td>";
+ echo "<td></td>";
+ echo "</tr>";
+ }
+
+ ?>
+ </tbody>
+ </table>
+ </form>
+ <?php
+}
+
+/**
+ * Generate the user list of a channel
+ *
+ * Why is it called chan occupants? o.o
+ * For the code, to avoid mixups
+ * It's called "User List" on the website
+ * @param mixed $channel
+ * @return void
+ */
+function generate_chan_occupants_table($channel)
+{
+ global $rpc;
+ ?>
+ <form method="post"><p>
+
+ </p>
+ <table class="container-xxl table table-sm table-responsive caption-top table-striped">
+ <thead class="table-info">
+ <th><input type="checkbox" label='selectall' onClick="toggle_checkbox(this)" /></th>
+ <th>Name</th>
+ <th>Status</th>
+ <th>Host</th>
+ </thead>
+ <tbody>
+ <?php
+ $m = sort_user_list($channel->members);
+
+ $i = 0;
+ foreach ($m as $member)
+ {
+ $lvlstring = "";
+
+ if (isset($member->level))
+ {
+ for ($i = 0; isset($member->level[$i]) && $m = $member->level[$i]; $i++)
+ {
+ switch ($m)
+ {
+ case "v":
+ $lvlstring .= "<div class='badge rounded-pill badge-primary'>Voice</div> ";
+ break;
+ case "h":
+ $lvlstring .= "<div class='badge rounded-pill badge-secondary'>Half-Op</div> ";
+ break;
+ case "o":
+ $lvlstring .= "<div class='badge rounded-pill badge-warning'>Op</div> ";
+ break;
+ case "a":
+ $lvlstring .= "<div class='badge rounded-pill badge-danger'>Admin</div> ";
+ break;
+ case "q":
+ $lvlstring .= "<div class='badge rounded-pill badge-success'>Owner</div> ";
+ break;
+
+ // providing support third/ojoin
+ case "Y":
+ $lvlstring .= "<div class='badge rounded-pill'>OJOIN</div> ";
+ break;
+ }
+ }
+ }
+
+ echo "<tr>";
+ ?><form method="post" action=""><?php
+ $disabled = (current_user_can(PERMISSION_EDIT_CHANNEL_USER)) ? "" : "disabled";
+ $disabledcolor = ($disabled) ? "btn-secondary" : "btn-primary";
+ echo "<td scope=\"row\"><input type=\"checkbox\" value='$member->id' name=\"checkboxes[]\"></td>";
+ echo "<td><a href=\"".get_config("base_url")."users/details.php?nick=$member->id\">".htmlspecialchars($member->name)."</a></td>";
+ echo "<td class='text-right'>$lvlstring</td>";
+ echo "<td><code>".((property_exists($member, 'hostname')) ? htmlspecialchars($member->hostname) : "")."</code></td>";
+ echo "</tr>";
+ }
+
+ ?>
+ </tbody>
+ </table>
+ </form>
+
+ <?php
+}
+
+function generate_html_chansettings($channel)
+{
+ ?>
+
+ <table class="table-sm table-responsive caption-top table-hover">
+ <tbody>
+ <?php
+ if (BadPtr($channel->modes))
+ {
+ echo "No modes set";
+ return;
+ }
+ $fmodes = $channel->modes;
+ $tok = split($fmodes);
+ $modes = $tok[0];
+ $params = rparv($fmodes);
+ $paramed_modes = sort_paramed_modes($modes, $params);
+
+ for ($i=0; ($mode = (isset($modes[$i])) ? $modes[$i] : NULL); $i++)
+ {
+ $modeinfo = IRCList::lookup($mode);
+ if (!$modeinfo)
+ continue;
+ ?>
+ <tr>
+ <th><?php echo $modeinfo['name']; ?></th>
+ <td><code><?php echo isset($paramed_modes[$mode]) ? $paramed_modes[$mode] : ""; ?></code></td>
+ <td>
+ <?php echo $modeinfo['description']; ?>
+ </td>
+ </tr>
+ <?php
+ }
+
+
+ ?>
+ </tbody>