Einzelnen Beitrag anzeigen
Alt 15.05.2008, 11:21   #6 (permalink)
asrock
PostRank: 0
 
Registriert seit: 24.04.2008
Beiträge: 10
Hier der Code von Zeile 49 bis 104

Code:
#
# This functions displays an error message that this plugin doesn't work with PHP4, yet.
#
function wpextmgr_show_options_page_php4() { ?>
    <div class="wrap">
    <h2>Extension Manager</h2>
    <p>You're running PHP <?php echo phpversion() ?>. Please update to at least PHP 5.2 or be patient until this plugin works with PHP 4.</p>
    </div>
<?php
}


#
# The logic and layout of the options page
#
function wpextmgr_show_options_page() {
    # i18n
    load_plugin_textdomain('wpextmgr', 'wp-content/plugins/extension-manager/languages');

    try {
        if(isset($_POST['show_plugins']) or isset($_POST['install_plugin'])) {
            $pm = getPluginManager();

            # download and install the plugin and prepare a message
            if (isset($_POST['install_plugin'])) {
                $pm->downloadAndInstall($_POST['download']);
                $msg = '<p>'.__('Installed plugin', 'wpextmgr').' "'.$_POST['name'].'". ';
                $msg .= sprintf(__('Go activate it on the <a href="%s">plugins screen</a>.', 'wpextmgr'), '/wp-admin/plugins.php').'</p>';
            }

            showBody('show_plugins', $pm, $msg);
        } else if(isset($_POST["show_themes"])) {
            $tm = getThemeManager();
            # TODO implement me
            showBody('show_themes', $tm, $msg);
        } else if(isset($_POST["maintenance"]) or isset($_POST['delete_installed_plugin']) or isset($_POST['delete_downloaded_plugin'])) {
            $pm = getPluginManager();

            # remove installed or downloaded plugin and prepare a message
            if (isset($_POST['delete_installed_plugin'])) {
                $pm->deleteInstalledExtension($_POST['name']);
                $msg = '<p>'.__('Removed installed plugin', 'wpextmgr').' "'.$_POST['name'].'". ';
            } else if (isset($_POST['delete_downloaded_plugin'])) {
                $pm->deleteDownloadedExtension($_POST['name']);
                $msg = '<p>'.__('Removed downloaded plugin', 'wpextmgr').' "'.$_POST['name'].'". ';
            }

            showBody('maintenance', $pm->getInstalledAndDownloadedExtensions(), $msg);
        } else {
            showBody();
        }
    } catch (Exception $ex) {
        # catches every error that might occur
        showBody(NULL, NULL, $ex->getMessage());
    }
}
Danke für die Antworten
asrock ist offline   Mit Zitat antworten