Exemplo n.º 1
0
 function mainwp_installbulknavsearch()
 {
     $this->secure_request();
     if ($_REQUEST['page'] == 'PluginsInstall') {
         if (mainwp_current_user_can("dashboard", "install_plugins")) {
             MainWPInstallBulk::renderSearch('Plugins');
         } else {
             mainwp_do_not_have_permissions("plugins install");
         }
     } else {
         if (mainwp_current_user_can("dashboard", "install_themes")) {
             MainWPInstallBulk::renderSearch('Themes');
         } else {
             mainwp_do_not_have_permissions("themes install");
         }
     }
     die;
 }
Exemplo n.º 2
0
    public static function render($title, $type = "plugin")
    {
        if ($type == "plugin" && !mainwp_current_user_can("dashboard", "install_plugins") || $type == "theme" && !mainwp_current_user_can("dashboard", "install_themes")) {
            mainwp_do_not_have_permissions("install plugins");
            return;
        }
        $tab = 'search';
        if (isset($_REQUEST['tab'])) {
            $tab = $_REQUEST['tab'];
        }
        ?>
            <?php 
        if ($tab == 'install') {
        } else {
            ?>
                <a href="#" class="mainwp_action left <?php 
            if ($tab == 'search') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavSearch"><?php 
            _e('Search', 'mainwp');
            ?>
</a><a href="#" class="mainwp_action right <?php 
            if ($tab == 'upload') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavUpload"><?php 
            _e('Upload', 'mainwp');
            ?>
</a>


                <br class="clear" /><br />
                <form method="POST" action="">
                    <div class="mainwp_config_box_right stick-to-window">
<!--                    <div>-->
                        <?php 
            MainWPUI::select_sites_box();
            ?>
                  	</div>
                        <div class="mainwp_config_box_left">
               	 	<div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
                    <div id="MainWPInstallBulkAjax">
                        <?php 
            switch ($tab) {
                case 'search':
                    MainWPInstallBulk::renderSearch($title);
                    break;
                case 'upload':
                    MainWPInstallBulk::renderUpload($title);
                    break;
                default:
                    MainWPInstallBulk::renderSearch($title);
            }
            ?>
                    </div>
                   	</div>
                </form>
                <?php 
        }
        ?>
            <div id="MainWPInstallBulkNew" style="display: none">
                <br />
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=<?php 
        echo $title;
        ?>
Install" class="add-new-h2" target="_top"><?php 
        _e('Add New', 'mainwp');
        ?>
</a>
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=mainwp_tab" class="add-new-h2" target="_top"><?php 
        _e('Return to Dashboard', 'mainwp');
        ?>
</a>
            </div>
        <?php 
    }