$PluginMessages) { foreach ($PluginMessages as $Message) { ?>
- :

getBaseName(); $Identifier = "EnabledCheckbox-".$BaseName; return "isEnabled() ? " checked" : "") .(($BaseName == "CWISCore" || $BaseName == "MetavusCore") ? " readonly disabled" : "") ." onchange='this.form.submit();'>"; } /** * Get content for "Name" column in plugin list. * @param Plugin $Plugin Plugin for this row. * @return string Generated content. */ function getContentForName(Plugin $Plugin): string { $Name = $Plugin->getName(); $BaseName = $Plugin->getBaseName(); return (str_replace(" ", "", $Name) == $BaseName) ? $Name : $Name." (".$BaseName.")"; } /** * Get content for "Dependencies" column in plugin list. * @param Plugin $Plugin Plugin for this row. * @return string Generated content. */ function getContentForDependencies(Plugin $Plugin): string { $Content = "

"; $Dependencies = $Plugin->getDependencies(); uksort( $Dependencies, function ($A, $B) { return (($A == "CWISCore") || ($A == "MetavusCore")) ? -1 : ($A <=> $B); } ); foreach ($Dependencies as $Name => $Version) { $Content .= "
- ".htmlspecialchars($Name)." " .$Version."
"; } return $Content."

"; } /** * Get content (if any) for "Actions" column in plugin list. * @param Plugin $Plugin Plugin for this row. * @return string Generated content. */ function getContentForActions(Plugin $Plugin): string { $Content = ""; $Attribs = $Plugin->getAttributes(); $BaseName = $Plugin->getBaseName(); $AF = ApplicationFramework::getInstance(); if ($Plugin->isInstalled()) { $CfgLink = !is_null($Attribs["CfgPage"]) && strlen($Attribs["CfgPage"]) ? $Attribs["CfgPage"] : (count($Attribs["CfgSetup"]) ? "index.php?P=PluginConfig&PN=".$BaseName : ""); if (strlen($CfgLink)) { $Content .= "" .""; } if (($BaseName != "CWISCore") && ($BaseName != "MetavusCore")) { $Content .= "" .""; } } $Content .= ""; return $Content; } /** * Get CSS class (if any) for cells for item. * @param Plugin $Plugin Plugin for this row. * @return string CSS class (if any). */ function getCssClassForPluginRow(Plugin $Plugin) { return (!$Plugin->isReady()) ? "text-muted" : ""; } # ----- SETUP ---------------------------------------------------------------- if (!isset($H_StatusMsgs)) { throw new Exception("Status messages not loaded."); } if (!isset($H_ErrMsgs)) { throw new Exception("Error messages not loaded."); } $AF = ApplicationFramework::getInstance(); $Plugins = $GLOBALS["G_PluginManager"]->GetPlugins(); usort( $Plugins, function ($A, $B) { return $A->getName() <=> $B->getName(); } ); $BasePlugins = []; $LocalPlugins = []; foreach ($Plugins as $Plugin) { if (preg_match("%/local/plugins/%", $Plugin->getClassFile())) { $LocalPlugins[$Plugin->getBaseName()] = $Plugin; } else { $BasePlugins[$Plugin->getBaseName()] = $Plugin; } } $ListFields = [ "Enabled" => [ "Heading" => "", "ValueFunction" => "Metavus\\getContentForEnabled", "AllowHTML" => true, ], "Name" => [ "ValueFunction" => "Metavus\\getContentForName", "CssClassFunction" => "Metavus\\getCssClassForPluginRow", ], "Version" => [ "Heading" => "Ver", "ClassFunction" => "Metavus\\getCssClassForPluginRow", ], "Description" => [ "ClassFunction" => "Metavus\\getCssClassForPluginRow", "AllowHTML" => true, ], "Dependencies" => [ "ValueFunction" => "Metavus\\getContentForDependencies", "ClassFunction" => "Metavus\\getCssClassForPluginRow", "AllowHTML" => true, ], "Actions" => [ "Heading" => "", "ValueFunction" => "Metavus\\getContentForActions", "AllowHTML" => true, ], ]; $BaseListUI = new ItemListUI($ListFields); $BaseListUI->setItemsPerPage(200); $BaseListUI->fieldsSortableByDefault(false); $LocalListUI = clone $BaseListUI; $BaseListUI->heading("Base Plugins"); $BaseListUI->setItems($BasePlugins); $LocalListUI->heading("Local Plugins"); $LocalListUI->setItems($LocalPlugins); # ----- DISPLAY -------------------------------------------------------------- $AF->setPageTitle("Plugins"); ?>

# Plugins

pluginReady("Developer")) { print $PluginMgr->getPlugin("Developer")->getSettingsInfoHtml(); } ?> getHtml(); ?> getHtml(); ?>