query("UPDATE plugins SET pluginStatus = ".(isset($_POST['pluginEnable']) ? 1 : 0)." WHERE pluginId = $_POST[pluginId]")) redirect(get_current_link()); else array_push($error, $_locale['plugin_not_updated']); } echo "

$_locale[plugins]

"; $pluginsQuery = $_sql->query("SELECT * FROM plugins ORDER BY pluginStatus DESC"); $plugins = array(); if ($pluginsQuery->num_rows) { echo ""; echo ""; while ($data = $pluginsQuery->fetch_assoc()) { $pinfo = './plugins/'.$data['pluginLib'].'/info.json'; if (file_exists($pinfo)) { $pinfo = (array)json_decode(file_get_contents($pinfo)); if (!isset($pinfo['enabler']) || (isset($pinfo['enabler']) && in_array($pinfo['enabler'], ['true', '1', 'yes', 'y']))) if ($data['pluginStatus']) $button = ""; else $button = ""; else $button = "{locale:plugin_noenable}"; echo ""; } array_push($plugins, $data['pluginLib']); } echo "
{locale:plugin_name}{locale:description}{locale:scope}{locale:status}
$pinfo[name]$pinfo[description]$pinfo[paths]
$button
"; } else echo "

$_locale[plugins_empty]

"; if ($handle = opendir('./plugins')) { while (false !== ($entry = readdir($handle))) { if (!in_array($entry, $plugins) && file_exists('./plugins/'.$entry.'/info.json')) if ($_sql->query("INSERT INTO plugins (pluginLib, pluginStatus) VALUES ('$entry', 0)")) array_push($info, $_locale['plugin_added'].$entry); else array_push($error, $_locale['plugin_not_added'].$entry); } closedir($handle); }