';
-
- if (ini_get("open_basedir") && function_exists("curl_init") && !defined("NO_CURL")) {
- print_warning("Your PHP configuration has open_basedir restrictions enabled. Some plugins relying on CURL for functionality may not work correctly.");
- }
-
- if ($_SESSION["safe_mode"]) {
- print_error("You have logged in using safe mode, no user plugins will be actually enabled until you login again.");
- }
-
- $feed_handler_whitelist = [ "Af_Comics" ];
-
- $feed_handlers = array_merge(
- PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FEED_FETCHED),
- PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FEED_PARSED),
- PluginHost::getInstance()->get_hooks(PluginHost::HOOK_FETCH_FEED));
-
- $feed_handlers = array_filter($feed_handlers, function($plugin) use ($feed_handler_whitelist) {
- return in_array(get_class($plugin), $feed_handler_whitelist) === false; });
-
- if (count($feed_handlers) > 0) {
- print_error(
- T_sprintf("The following plugins use per-feed content hooks. This may cause excessive data usage and origin server load resulting in a ban of your instance:
%s " ,
- implode(", ", array_map(function($plugin) { return get_class($plugin); }, $feed_handlers))
- ) . " (
".__("More info...")." )"
- );
- }
-
- print "
".__("System plugins")." ";
+ private function index_plugins_system() {
print_notice("System plugins are enabled in
config.php for all users.");
- $system_enabled = array_map("trim", explode(",", PLUGINS));
- $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
+ $system_enabled = array_map("trim", explode(",", (string)PLUGINS));
$tmppluginhost = new PluginHost();
$tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"], true);
- //$tmppluginhost->load_data(true);
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
if ($about[3] ?? false) {
- if (in_array($name, $system_enabled)) {
- $checked = "checked='1'";
- } else {
- $checked = "";
- }
+ $is_checked = in_array($name, $system_enabled) ? "checked" : "";
+ ?>
+
+ = $name ?>:
+
+ type='checkbox'>= htmlspecialchars($about[1]) ?>
+
- print "
- $name:
-
-
- ".htmlspecialchars($about[1]). " ";
-
- if ($about[4] ?? false) {
- print "
- open_in_new ".__("More info...")." ";
- }
-
- print "".
- htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])).
- "
";
-
- print " ";
+
+
+ open_in_new = __("More info...") ?>
+
+
+ = htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])) ?>
+
+
+ ".__("User plugins")."";
+ private function index_plugins_user() {
+ $system_enabled = array_map("trim", explode(",", (string)PLUGINS));
+ $user_enabled = array_map("trim", explode(",", get_pref("_ENABLED_PLUGINS")));
+
+ $tmppluginhost = new PluginHost();
+ $tmppluginhost->load_all($tmppluginhost::KIND_ALL, $_SESSION["uid"], true);
foreach ($tmppluginhost->get_plugins() as $name => $plugin) {
$about = $plugin->about();
if (empty($about[3]) || $about[3] == false) {
- $checked = "";
- $disabled = "";
+ $is_checked = "";
+ $is_disabled = "";
if (in_array($name, $system_enabled)) {
- $checked = "checked='1'";
- $disabled = "disabled='1'";
+ $is_checked = "checked='1'";
+ $is_disabled = "disabled='1'";
} else if (in_array($name, $user_enabled)) {
- $checked = "checked='1'";
+ $is_checked = "checked='1'";
}
- print "
- $name:
-
-
- ".htmlspecialchars($about[1])." ";
+ ?>
- if (count($tmppluginhost->get_all($plugin)) > 0) {
- if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
- print "
- clear ".__("Clear data")." ";
- }
- }
+
+ = $name ?>:
+
+ = $is_disabled ?> type='checkbox'>
+ = htmlspecialchars($about[1]) ?>
+
+
- if ($about[4] ?? false) {
- print "
- open_in_new ".__("More info...")." ";
- }
+ get_all($plugin)) > 0) {
+ if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) { ?>
+
+ clear = __("Clear data") ?>
+
- print "".
- htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])).
- "
";
+
+
+ open_in_new = __("More info...") ?>
+
- print " ";
+
+ = htmlspecialchars(T_sprintf("v%.2f, by %s", $about[0], $about[2])) ?>
+
+
+
+ "; #content-pane
- print '
';
+ private function index_plugins() {
+ ?>
+
"; #pane
+
+
- print "