-<tbody>
- <?php
- foreach($channels as $channel)
- {
- echo "<tr>";
- echo "<td><a href=\"details.php?chan=".urlencode(htmlspecialchars($channel->name))."\">".htmlspecialchars($channel->name)."</a></td>";
- echo "<td>".$channel->num_users."</td>";
- $modes = (isset($channel->modes)) ? "+" . $channel->modes : "<none>";
- echo "<td>".htmlspecialchars($modes)."</td>";
- $topic = (isset($channel->topic)) ? htmlspecialchars($channel->topic) : "";
- echo "<td>".$topic."</td>";
- echo "<td>".$channel->creation_time."</td>";
- echo "</tr>";
+</table>
+
+<script>
+let data_list_table = null;
+
+$(document).ready( function () {
+ args = {
+ 'responsive': true,
+ 'fixedHeader': {
+ header: true,
+ headerOffset: 53
+ },
+ 'ajax': {
+ 'url': '<?php echo get_config("base_url"); ?>api/channels.php',
+ dataSrc: ''
+ },
+ 'pageLength':100,
+ 'order':[[1,'desc']],
+ 'columns': [
+ { 'data': 'Name', 'responsivePriority': 1, 'className':'virtuallink' },
+ { 'data': 'Users', 'responsivePriority': 2 },
+ { 'data': 'Modes', 'responsivePriority': 3 },
+ { 'data': 'Topic', 'responsivePriority': 5, 'className':'tdwrap' },
+ { 'data': 'Created', 'responsivePriority': 4 },
+ ],
+ };
+ /* Hide on mobile */
+ if (window.innerWidth > 8000)
+ {
+ args['dom'] = 'Pfrtip';
+ args['searchPanes'] = {
+ 'initCollapsed': 'true',
+ 'columns': [1,3],
+ 'dtOpts': {
+ select: { style: 'multi'},
+ order: [[ 1, "desc" ]]
+ },