]>
jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - settings/plugins.php
3 require_once "../inc/common.php";
4 require_once "../inc/header.php";
9 <h2
>Active Plugins
<a
class="btn btn-sm btn-primary" href
="add-plugin.php">Add
New</a
></h2
>
11 Your installed plugins
:
13 <table
class="container-xxl table table-sm table-responsive caption-top table-striped">
14 <thead
class="table-primary">
16 <th scope
="col"><input type
="checkbox" label
='selectall' onClick
="toggle_tkl(this)" /></th
>
17 <th scope
="col">Plugin Name
</th
>
18 <th scope
="col">Version
</th
>
19 <th scope
="col">Description
</th
>
20 <th scope
="col">Author
</th
>
21 <th scope
="col">Contact
</th
>
22 <th scope
="col">Uninstall
</th
>
27 foreach(Plugins
::$list as $plugin)
30 echo "<th scope=\"col\"><input type=\"checkbox\" label='selectall' onClick=\"toggle_tkl(this)\" /></th>";
31 echo "<td scope=\"col\" onClick=\"create_plugin_info_modal('".$plugin->handle
."')\">".$plugin->name
."</td>";
32 echo "<td scope=\"col\"><code>".$plugin->version
."</code></td>";
33 echo "<td scope=\"col\">".$plugin->description
."</td>";
34 echo "<td scope=\"col\">".$plugin->author
."</td>";
35 echo "<td scope=\"col\"><a href='mailto:$plugin->email'>".$plugin->email
."</a></td>";
36 echo "<td width=\"110\" scope=\"col\"><div id=\"".$plugin->handle
."install\" class='text-center btn-sm btn-danger btn-install-plugin'>Uninstall</div></td>";
44 const ibtns
= document
.querySelectorAll(".btn-install-plugin");
45 ibtns
.forEach((ib
) => {
46 ib
.addEventListener('click', (e
) => {
48 if (ib
.innerHTML
!== "Install" && ib
.innerHTML
!== "Uninstall") // some point between, don't do anything
50 else if (ib
.innerHTML
== "Install") // install button pressed!
52 let req
= requestInstall(ib
.id
.slice(0,-7))
55 ib
.classList
.replace("btn-primary", "btn-secondary");
56 ib
.innerHTML
= "Installing...";
60 let uhoh
= new bsModal("Error", "Could not install: "+req
, "", null, false, true);
63 else if (ib
.innerHTML
== "Uninstall")
65 let req
= requestInstall(ib
.id
.slice(0,-7), true); // true = uninstall
68 ib
.classList
.replace("btn-outline-danger", "btn-secondary");
69 ib
.innerHTML
= "Uninstalling...";
73 let uhoh
= new bsModal("Error", "Could not uninstall: "+req
, "", null, false, true);
78 const installed
= document
.querySelectorAll(".installed");
79 installed
.forEach((el
) => {
80 let btn
= document
.getElementById(el
.id +
'install');
81 btn
.classList
.replace("btn-primary", "btn-outline-danger");
82 btn
.innerHTML
= "Uninstall";
87 require_once "../inc/footer.php";