Exemple #1
0
 public static function getEntryPointClassForPlugin(Plugin $plugin)
 {
     // What is the entry point?
     $manifest = PluginManifest::fromPackageName($plugin->getPackageName());
     $pluginClass = $manifest->getEntryPoint();
     return $pluginClass;
 }
Exemple #2
0
require '../base.php';
ob_start();
require LANGS . 'ACPPluginsT.php';
ACPPluginsT::init();
function __autoload($c)
{
    require LIB . 'plugins/' . basename($c) . '.php';
}
if (!$userManager->loggedIn() || !$user->isAdmin()) {
    echo ErrorMessage::setText('You are not allowed to view this page.', true);
}
if (isset($_GET['install'])) {
    $packageName = basename($_GET['install']);
    try {
        $manifest = PluginManifest::fromPackageName($packageName);
        PluginHelper::installPlugin($manifest);
        header("Location: ./plugins.php");
        exit;
    } catch (Exception $e) {
        echo AdminErrorMessage::setText(ACPPluginsT::getFormat('install_error', htmlspecialchars($packageName), $e->getMessage()), true);
    }
} else {
    if (isset($_GET['uninstall'])) {
        $packageName = basename($_GET['uninstall']);
        if ($_GET['ok'] == 1) {
            PluginHelper::uninstallPlugin($packageName);
            header("Location: ./plugins.php");
            exit;
        } else {
            echo AdminQuestionMessage::setText(ACPPluginsT::get('uninstall_confirmation'), true)->addLink(GeneralT::get('yes'), './plugins.php?uninstall=' . htmlspecialchars($packageName) . '&ok=1')->addLink(GeneralT::get('no'), './plugins.php');