3 require_once "../inc/common.php";
4 require_once "../inc/header.php";
5 require_once "../Classes/class-plugin-git.php";
7 if (!current_user_can(PERMISSION_MANAGE_PLUGINS
))
10 $p = new PluginRepo();
13 <h2
>Add
New Plugin
</h2
>
19 Welcome to our lively plugins hub, where creativity takes center stage.<br>
20 We've got two fantastic plugins to kick things off (one practical, one for a playful twist).<br>
21 Join us on this exciting journey and unlock new possibilities for your website!<br><br>";
24 echo "Oops! Could not find plugins list. This is an upstream error, which means there is nothing wrong<br>
25 on your panel, it just means we can't check the plugins information webpage for some reason.<br>
26 Nothing to worry about! Try again later!";
28 require_once "../inc/footer.php";
34 const ibtns
= document
.querySelectorAll(".btn-install-plugin");
35 ibtns
.forEach((ib
) => {
36 ib
.addEventListener('click', (e
) => {
37 if (ib
.innerHTML
!== "Install" && ib
.innerHTML
!== "Uninstall") // some point between, don't do anything
39 else if (ib
.innerHTML
== "Install") // install button pressed!
41 let req
= requestInstall(ib
.id
.slice(0,-7))
44 ib
.classList
.replace("btn-primary", "btn-secondary");
45 ib
.innerHTML
= "Installing...";
49 let uhoh
= new bsModal("Error", "Could not install: "+req
, "", null, false, true);
52 else if (ib
.innerHTML
== "Uninstall")
54 let req
= requestInstall(ib
.id
.slice(0,-7), true); // true = uninstall
57 ib
.classList
.replace("btn-outline-danger", "btn-secondary");
58 ib
.innerHTML
= "Uninstalling...";
62 let uhoh
= new bsModal("Error", "Could not uninstall: "+req
, "", null, false, true);
67 const installed
= document
.querySelectorAll(".installed");
68 installed
.forEach((el
) => {
69 let btn
= document
.getElementById(el
.id +
'install');
70 btn
.classList
.replace("btn-primary", "btn-outline-danger");
71 btn
.innerHTML
= "Uninstall";
76 const infoButtons
= document
.querySelectorAll('.more-info');
77 infoButtons
.forEach((el
) => {
78 el
.addEventListener('click', (event
) => {
79 create_plugin_info_modal(el
.id
);