Ejemplo n.º 1
0
/**
* This function allows to plugins to show their own options
*/
function main_rm_plugin($dir)
{
    $path = RMCPATH . '/plugins';
    if (!file_exists($path . '/' . $dir . '/' . strtolower($dir) . '-plugin.php')) {
        header("location: plugins.php");
        die;
    }
    $plugin = new RMPlugin($dir);
    if ($plugin->isNew()) {
        header("location: plugins.php");
        die;
    }
    if (!$plugin->get_info('hasmain')) {
        header("location: plugins.php");
        die;
    }
    $class = ucfirst($dir) . 'CUPlugin';
    $plugin = new $class();
    if (!method_exists($plugin, 'main')) {
        header("location: plugins.php");
        die;
    }
    load_plugin_locale($dir);
    $plugin->main();
}