{
foreach($_POST['ce_checkboxes'] as $c)
$checkboxes[] = $c;
- $del_ex = true;
- chlkup_autoload_modal("excepts_modal");
+ do_delete_chanex($channelObj, $checkboxes);
}
- else if (isset($_POST['delete_sel_inv']))
+ if (isset($_POST['delete_sel_inv']))
{
foreach($_POST['ci_checkboxes'] as $c)
$checkboxes[] = $c;
- $del_inv = true;
- chlkup_autoload_modal("invites_modal");
+ do_delete_invite($channelObj, $checkboxes);
}
else if (isset($_POST['delete_sel_ban']))
{
foreach($_POST['cb_checkboxes'] as $c)
$checkboxes[] = $c;
- $del_ban = true;
- chlkup_autoload_modal("bans_modal");
+ do_delete_chanban($channelObj, $checkboxes);
}
if (isset($_POST['add_chban']) || isset($_POST['add_chinv']) || isset($_POST['add_chex']))
{
?>
<title><?php echo $title; ?></title>
-<h4><?php echo $title; ?></h4>
+<h6><?php echo $title; ?></h6>
<br>
<div class="container-xl">
<form method="get" action="details.php">
- <div class="input-group">
- <input class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
+ <div class="text-left input-group">
+ <input class="form-control" id="chan" name="chan" type="text" value="<?php echo $channame; ?>">
<div class="input-group-append">
<button type="submit" class="btn btn-primary">Go</button>
</div>
<?php if (!$channelObj)
return; ?>
-
-<!-- Modal for Channel Bans -->
-<div class="modal fade" id="bans_modal" name="bans_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
- <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="myModalLabel">Channel Bans</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <?php if ($del_ban) do_delete_chanban($channelObj, $checkboxes); ?>
- <form method="post">
- <?php generate_chanbans_table($channelObj); ?>
- </form>
- </div>
- </div>
- </div>
-</div>
-<!-- Modal for Channel Invited -->
-<div class="modal fade" id="invites_modal" name="#invites_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
- <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="myModalLabel">Channel Invites</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <?php if ($del_inv) do_delete_invite($channelObj, $checkboxes); ?>
- <form method="post">
- <?php generate_chaninvites_table($channelObj); ?>
- </form>
- </div>
- </div>
- </div>
-</div>
-
-<!-- Modal for Channel Exceptions -->
-<div class="modal fade" id="excepts_modal" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
- <div class="modal-dialog modal-lg modal-dialog-centered" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title" id="myModalLabel">Channel Exceptions</h5>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <?php if ($del_ex) do_delete_chanex($channelObj, $checkboxes); ?>
- <form method="post">
- <?php generate_chanexcepts_table($channelObj); ?>
- </form>
- </div>
- </div>
- </div>
-</div>
-
-
<!-- Modal for Add Ban -->
<div class="modal fade" id="ban" tabindex="-1" role="dialog" aria-labelledby="confirmModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered" role="document">
</div>
<br>
-<h3>
- Topic:<br></h3>
+<h6>
+ Topic:<br></h6>
<form method="post" action="details.php?chan=<?php echo urlencode($channelObj->name); ?>">
<div class="input-group">
<input maxlength="360" type="text" class="input-group form-control" name="set_topic" value="<?php echo (isset($channelObj->topic)) ? htmlspecialchars($channelObj->topic) : ""; ?>">
</div>
</div>
-<div class="row" style="margin-left: 0px">
- <div class="p-1">
- <button class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Bans</button>
- <div class="dropdown-menu">
- <div class="dropdown-item" data-toggle="modal" data-target="#ban">Add New</div>
- <div class="dropdown-item" data-toggle="modal" data-target="#bans_modal">List</div>
- </div>
- </div>
- <div class="p-1">
- <button class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Invites</button>
- <div class="dropdown-menu">
- <div class="dropdown-item" data-toggle="modal" data-target="#invite">Add New</div>
- <div class="dropdown-item" data-toggle="modal" data-target="#invites_modal">List</div>
- </div>
- </div>
- <div class="p-1">
- <button class="btn btn-warning dropdown-toggle" data-toggle="dropdown" aria-expanded="false">Excepts</button>
- <div class="dropdown-menu">
- <div class="dropdown-item" data-toggle="modal" data-target="#except">Add New</div>
- <div class="dropdown-item" data-toggle="modal" data-target="#excepts_modal">List</div>
- </div>
- </div>
-</div>
-<br>
-
<div class="container-xxl">
<div class="row">
<div class="col-sm-5">
<div class="card">
<div class="card-body">
- <h5 class="card-title">User List</h5>
+ <h6 class="card-title">User List</h6>
<p class="card-text"><?php generate_chan_occupants_table($channelObj); ?></p>
</div>
</div>
<div class="col-sm-6">
<div class="card">
<div class="card-body">
- <h5 class="card-title">Channel Settings</h5>
- <p class="card-text"><?php generate_html_chansettings($channelObj); ?></p>
+ <h6 class="card-title">Channel Settings</h6>
+ <ul class="nav nav-tabs" role="tablist">
+ <li class="nav-item" role="presentation"><a class="nav-link" href="#chanmodes" aria-controls="chanmodes" role="tab" data-toggle="tab">Settings / Modes</a></li>
+ <li class="nav-item" role="presentation"><a class="nav-link" href="#chanbans" aria-controls="chanbans" role="tab" data-toggle="tab">Bans</a></li>
+ <li class="nav-item" role="presentation"><a class="nav-link" href="#chaninv" aria-controls="chaninv" role="tab" data-toggle="tab">Invites</a></li>
+ <li class="nav-item" role="presentation"><a class="nav-link" href="#chanex" aria-controls="chanex" role="tab" data-toggle="tab">Excepts</a></li>
+ </ul>
+
+ <div class="tab-content">
+
+ <div role="tabpanel" class="tab-pane fade in" id="chanmodes">
+ <p class="card-text"><?php generate_html_chansettings($channelObj); ?></p>
+ </div>
+
+ <div role="tabpanel" class="tab-pane fade in" id="chanbans">
+ <p class="card-text"><?php generate_chanbans_table($channelObj); ?></p>
+ </div>
+ <div role="tabpanel" class="tab-pane fade in" id="chaninv">
+ <p class="card-text"><?php generate_chaninvites_table($channelObj); ?></p>
+ </div>
+ <div role="tabpanel" class="tab-pane fade in" id="chanex">
+ <p class="card-text"><?php generate_chanexcepts_table($channelObj); ?></p>
+ </div>
+
+ </div>
</div>
</div>
</div>
</div>
-
+<script>
+ // show dat first tab
+$('.nav-tabs a[href="#chanmodes"]').tab('show')
+</script>
<?php
require_once("../footer.php");
{
global $rpc;
$channel = $rpc->channel()->get($channel->name);
- ?>
- <form method="post"><p>
+ ?><p><table class="container-xxl table table-responsive caption-top table-striped">
+ <button class="btn btn-primary mr-1 btn-sm" data-toggle="modal" data-target="#ban">Add New</button>
+ <form method="post">
<button class="btn btn-info btn-sm" type="submit" name="delete_sel_ban">Delete</button>
</p>
- <table class="table table-responsive table-hover caption-top table-striped">
+
<thead class="table-info">
<th><input type="checkbox" label='selectall' onClick="toggle_chanbans(this)" /></th>
<th>Name</th>
{
global $rpc;
$channel = $rpc->channel()->get($channel->name);
- ?>
- <form method="post"><p>
+ ?><p><table class="table table-responsive table-hover caption-top table-striped">
+ <button class="btn btn-primary btn-sm mr-1" data-toggle="modal" data-target="#invite">Add New</button>
+ <form method="post">
<button class="btn btn-info btn-sm" type="submit" name="delete_sel_inv">Delete</button>
</p>
- <table class="table table-responsive table-hover caption-top table-striped">
+
<thead class="table-info">
<th><input type="checkbox" label='selectall' onClick="toggle_chaninvs(this)" /></th>
<th>Name</th>
function generate_chanexcepts_table($channel)
{
global $rpc;
+ echo "<form method=\"post\">";
$channel = $rpc->channel()->get($channel->name);
- ?>
- <form method="post"><p>
+ ?><p><table class="table 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>
+
<button class="btn btn-info btn-sm" type="submit" name="delete_sel_ex">Delete</button>
</p>
- <table class="table table-responsive table-hover caption-top table-striped">
+
<thead class="table-info">
<th><input type="checkbox" label='selectall' onClick="toggle_chanexs(this)" /></th>
<th>Name</th>
*/
function generate_chan_occupants_table($channel)
{
+ global $rpc;
?>
<form method="post"><p>
</p>
- <table class="table table-responsive table-hover table-striped">
+ <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>Host</th>
<th>Status</th>
- <th>Quick Actions</th>
- <th></th>
</thead>
<tbody>
<?php
- foreach ($channel->members as $member)
+ $m = sort_user_list($channel->members);
+ foreach ($m as $member)
{
$lvlstring = "";
}
echo "<tr>";
?><form method="post" action=""><?php
+ $target = $rpc->user()->get($member->id);
$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=\"".BASE_URL."users/details.php?nick=$member->id\">".htmlspecialchars($member->name)."</a></td>";
- echo "<td>$lvlstring</td>";
- echo "<td><button name=\"kickban\" value=\"$member->id\" type=\"submit\" class=\"btn-sm $disabledcolor\" $disabled>Kick ban</button></td>";
- echo "<td><button name=\"muteban\" value=\"$member->id\" type=\"submit\" class=\"btn-sm $disabledcolor\" $disabled>Mute ban</button></td>";
+ echo "<td><code>".htmlspecialchars($target->hostname)."</code></td>";
+ echo "<td class='text-right'>$lvlstring</td>";
echo "</tr>";
}
$n .= $char;
$str .= " ".$l;
}
- if ($rpc->channel()->set_mode($chan->name, "-$n", $str))
+ if ($rpc->channel()->set_mode($chan->name, htmlspecialchars("-$n"), htmlspecialchars($str)))
{
Message::Success("Deleted successfully");
return true;
{
$errs = [];
_do_chan_item_delete($chan, "except", $list, $errs);
+}
+
+
+
+/**
+ * Sort the channels user list:
+ */
+function sort_user_list($list) : array
+{
+ if (empty($list))
+ return $list;
+
+ $new = [];
+ foreach($list as $k => $user)
+ {
+ if (!property_exists($user,"level"))
+ {
+ $new["rest"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"Y"))
+ {
+ $new["Y"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"q"))
+ {
+ $new["q"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"a"))
+ {
+ $new["a"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"o"))
+ {
+ $new["o"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"h"))
+ {
+ $new["h"][] = $user;
+ $list[$k] = NULL;
+ }
+ else if (strstr($user->level,"v"))
+ {
+ $new["v"][] = $user;
+ $list[$k] = NULL;
+ }
+
+ }
+
+ unset($list);
+ $list = [];
+ if (isset($new["q"]))
+ foreach($new["q"] as $u)
+ $list[] = $u;
+
+ if (isset($new["a"]))
+ foreach($new["a"] as $u)
+ $list[] = $u;
+
+ if (isset($new["o"]))
+ foreach($new["o"] as $u)
+ $list[] = $u;
+
+ if (isset($new["h"]))
+ foreach($new["h"] as $u)
+ $list[] = $u;
+
+ if (isset($new["v"]))
+ foreach($new["v"] as $u)
+ $list[] = $u;
+
+ if (isset($new["rest"]))
+ foreach($new["rest"] as $u)
+ $list[] = $u;
+
+ return $list;
}
\ No newline at end of file