Пример #1
0
    _e('Extensions', 'framework');
    ?>
</a>
	<?php 
}
?>
</h2>
<?php 
global $plugin_installer, $themePlugins;
$tgm = new TGM_Plugin_Activation();
$link = admin_url('admin.php?page=plugin-installer');
$redirect = '<script type="text/javascript">window.location = "' . $link . '";</script>';
$action = isset($_GET['action']) ? $_GET['action'] : '';
switch ($action) {
    case 'install':
        $tgm->do_plugin_install();
        echo $redirect;
        break;
    case 'activate':
        $tgm->do_plugin_activate();
        echo $redirect;
        break;
    case 'install-extension':
        $extensions = $_POST['ext_chk'];
        if ($extensions[0] == 'on') {
            unset($extensions[0]);
        }
        foreach ($extensions as $key => $ext) {
            $tmp = explode('/', $ext);
            $extension = $tmp[0];
            $this->make_plugin_from_extension($extension);