예제 #1
0
    public static function renderManager()
    {
        $backupTask = null;
        if (isset($_GET['id']) && MainWPUtility::ctype_digit($_GET['id'])) {
            if (!mainwp_current_user_can("dashboard", "edit_backup_tasks")) {
                mainwp_do_not_have_permissions("edit backup tasks");
                return;
            }
            $backupTaskId = $_GET['id'];
            $backupTask = MainWPDB::Instance()->getBackupTaskById($backupTaskId);
            if (!MainWPUtility::can_edit_backuptask($backupTask)) {
                $backupTask = null;
            }
            if ($backupTask != null) {
                if (!self::validateBackupTasks(array($backupTask))) {
                    $backupTask = MainWPDB::Instance()->getBackupTaskById($backupTaskId);
                }
            }
        }
        $primaryBackupMethods = apply_filters("mainwp-getprimarybackup-methods", array());
        if (!is_array($primaryBackupMethods)) {
            $primaryBackupMethods = array();
        }
        if ($backupTask == null) {
            self::renderHeader('');
            ?>
            <?php 
            if (count($primaryBackupMethods) == 0) {
                ?>
                <tr>
                    <div class="mainwp_info-box"><?php 
                _e('Did you know that MainWP has Extensions for working with popular backup plugins? Visit the <a href="https://extensions.mainwp.com/product-category/mainwp-extensions/backups/" target="_blank" ?>Extensions Site</a> for options.', 'mainwp');
                ?>
</div>
                </tr>
            <?php 
            }
            ?>
            <div id="mainwp_managebackups_content">
                <div id="mainwp_managebackups_add_errors" class="mainwp_error error"></div>
                <div id="mainwp_managebackups_add_message" class="mainwp_updated updated" style="display: <?php 
            if (isset($_GET['a']) && $_GET['a'] == '1') {
                echo 'block';
            } else {
                echo 'none';
            }
            ?>
"><?php 
            if (isset($_GET['a']) && $_GET['a'] == '1') {
                echo __('<p>The backup task was added successfully</p>', 'mainwp');
            }
            ?>
</div>
                <p></p>
                <?php 
            self::$sitesTable->prepare_items();
            ?>
        <div id="mainwp_managebackups_content">
            <form method="post" class="mainwp-table-container">
              <input type="hidden" name="page" value="sites_list_table">
              <?php 
            MainWPManageSitesView::_renderNotes();
            self::$sitesTable->display();
            self::$sitesTable->clear_items();
            ?>
            </form>
        </div>
                <div id="managebackups-task-status-box" title="Running task" style="display: none; text-align: center">
                    <div style="height: 190px; overflow: auto; margin-top: 20px; margin-bottom: 10px; text-align: left" id="managebackups-task-status-text">
                    </div>
                    <input id="managebackups-task-status-close" type="button" name="Close" value="<?php 
            _e('Cancel', 'mainwp');
            ?>
" class="button" />
                </div>
            </div>
            <?php 
            self::renderFooter('');
        } else {
            MainWPManageBackups::renderEdit($backupTask);
        }
    }
예제 #2
0
 public static function renderMetabox()
 {
     $website = MainWPUtility::get_current_wpid();
     if (!$website) {
         return;
     }
     $website = MainWPDB::Instance()->getWebsiteById($website);
     MainWPManageSitesView::showSEOWidget($website);
 }