function select_sites($post) { $selected_sites = unserialize(base64_decode(get_post_meta($post->ID, '_selected_sites', true))); if ($selected_sites == '') { $selected_sites = array(); } if (isset($_REQUEST['select'])) { $selected_sites = $_REQUEST['select'] == 'all' ? 'all' : array($_REQUEST['select']); } $selected_groups = unserialize(base64_decode(get_post_meta($post->ID, '_selected_groups', true))); if ($selected_groups == '') { $selected_groups = array(); } ?> <input type="hidden" name="select_sites_nonce" id="select_sites_nonce" value="<?php echo wp_create_nonce('select_sites_' . $post->ID); ?> " /><?php MainWPUI::select_sites_box_body($selected_sites, $selected_groups, 'checkbox', true, true, true); }
public static function render() { if (!mainwp_current_user_can("dashboard", "manage_pages")) { mainwp_do_not_have_permissions("manage pages"); return; } $cachedSearch = MainWPCache::getCachedContext('Page'); //Loads the page screen via AJAX, which redirects to the "posting()" to really post the posts to the saved sites ?> <?php self::renderHeader('BulkManage'); ?> <div class="mainwp-search-form"> <div class="postbox mainwp-postbox"> <h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php _e('Search Pages', 'mainwp'); ?> </h3> <div class="inside"> <ul class="mainwp_checkboxes"> <li> <input type="checkbox" id="mainwp_page_search_type_publish" <?php echo $cachedSearch == null || $cachedSearch != null && in_array('publish', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_publish" class="mainwp-label2">Published</label> </li> <li> <input type="checkbox" id="mainwp_page_search_type_pending" <?php echo $cachedSearch != null && in_array('pending', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_pending" class="mainwp-label2">Pending</label> </li> <li> <input type="checkbox" id="mainwp_page_search_type_private" <?php echo $cachedSearch != null && in_array('private', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_private" class="mainwp-label2">Private</label> </li> <li> <input type="checkbox" id="mainwp_page_search_type_future" <?php echo $cachedSearch != null && in_array('future', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_future" class="mainwp-label2">Future</label> </li> <li> <input type="checkbox" id="mainwp_page_search_type_draft" <?php echo $cachedSearch != null && in_array('draft', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_draft" class="mainwp-label2">Draft</label> </li> <li> <input type="checkbox" id="mainwp_page_search_type_trash" <?php echo $cachedSearch != null && in_array('trash', $cachedSearch['status']) ? 'checked="checked"' : ''; ?> class="mainwp-checkbox2"/> <label for="mainwp_page_search_type_trash" class="mainwp-label2">Trash</label> </li> </ul> <p> <?php _e('Containing Keyword:', 'mainwp'); ?> <br /> <input type="text" id="mainwp_page_search_by_keyword" class="mainwp-field mainwp-keyword" size="50" value="<?php if ($cachedSearch != null) { echo $cachedSearch['keyword']; } ?> "/> </p> <p> <?php _e('Date Range:', 'mainwp'); ?> <br /> <input type="text" id="mainwp_page_search_by_dtsstart" class="mainwp_datepicker mainwp-field mainwp-date" size="12" value="<?php if ($cachedSearch != null) { echo $cachedSearch['dtsstart']; } ?> "/> to <input type="text" id="mainwp_page_search_by_dtsstop" class="mainwp_datepicker mainwp-field mainwp-date" size="12" value="<?php if ($cachedSearch != null) { echo $cachedSearch['dtsstop']; } ?> "/> </p> </div> </div> <?php MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_left'); ?> <div style="clear: both;"></div> <input type="button" name="mainwp_show_pages" id="mainwp_show_pages" class="button-primary" value="<?php _e('Show Pages', 'mainwp'); ?> "/> <span id="mainwp_pages_loading"> <i class="fa fa-spinner fa-pulse"></i> <em><?php _e('Grabbing information from Child Sites', 'mainwp'); ?> </em></span> <br/><br/> </div> <div class="clear"></div> <div id="mainwp_pages_error"></div> <div id="mainwp_pages_main" <?php if ($cachedSearch != null) { echo 'style="display: block;"'; } ?> > <div class="alignleft"> <select name="bulk_action" id="mainwp_bulk_action"> <option value="none"><?php _e('Bulk Action', 'mainwp'); ?> </option> <option value="trash"><?php _e('Move to Trash', 'mainwp'); ?> </option> <option value="restore"><?php _e('Restore', 'mainwp'); ?> </option> <option value="delete"><?php _e('Delete Permanently', 'mainwp'); ?> </option> </select> <input type="button" name="" id="mainwp_bulk_page_action_apply" class="button" value="<?php _e('Apply', 'mainwp'); ?> "/> </div> <div class="alignright" id="mainwp_pages_total_results"> <?php _e('Total Results:', 'mainwp'); ?> <span id="mainwp_pages_total"><?php if ($cachedSearch != null) { echo $cachedSearch['count']; } ?> </span> </div> <div class="clear"></div> <div id="mainwp_pages_content"> <table class="wp-list-table widefat fixed pages tablesorter" id="mainwp_pages_table" cellspacing="0"> <thead> <tr> <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th> <th scope="col" id="title" class="manage-column column-title sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Title', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="author" class="manage-column column-author sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Author', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="comments" class="manage-column column-comments num sortable desc" style=""> <a href="#" onclick="return false;"> <span><span class="vers"><img alt="Comments" src="<?php echo admin_url('images/comment-grey-bubble.png'); ?> "></span></span> <span class="sorting-indicator"></span> </a> </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> <a href="#" onclick="return false;"><span><?php _e('Date', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="status" class="manage-column column-status sortable asc" style="width: 120px;"> <a href="#" onclick="return false;"><span><?php _e('Status', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="categories" class="manage-column column-categories sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Website', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> </tr> </thead> <tfoot> <tr> <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input type="checkbox"></th> <th scope="col" id="title" class="manage-column column-title sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Title', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="author" class="manage-column column-author sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Author', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="comments" class="manage-column column-comments num sortable desc" style=""> <a href="#" onclick="return false;"> <span><span class="vers"><img alt="Comments" src="<?php echo admin_url('images/comment-grey-bubble.png'); ?> "></span></span> <span class="sorting-indicator"></span> </a> </th> <th scope="col" id="date" class="manage-column column-date sortable asc" style=""> <a href="#" onclick="return false;"><span><?php _e('Date', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="status" class="manage-column column-status sortable asc" style="width: 120px;"> <a href="#" onclick="return false;"><span><?php _e('Status', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> <th scope="col" id="categories" class="manage-column column-categories sortable desc" style=""> <a href="#" onclick="return false;"><span><?php _e('Website', 'mainwp'); ?> </span><span class="sorting-indicator"></span></a> </th> </tr> </tfoot> <tbody id="the-posts-list" class="list:pages"> <?php MainWPCache::echoBody('Page'); ?> </tbody> </table> <div class="pager" id="pager"> <form> <img src="<?php echo plugins_url('images/first.png', dirname(__FILE__)); ?> " class="first"> <img src="<?php echo plugins_url('images/prev.png', dirname(__FILE__)); ?> " class="prev"> <input type="text" class="pagedisplay"> <img src="<?php echo plugins_url('images/next.png', dirname(__FILE__)); ?> " class="next"> <img src="<?php echo plugins_url('images/last.png', dirname(__FILE__)); ?> " class="last"> <span> <?php _e('Show:', 'mainwp'); ?> </span><select class="pagesize"> <option selected="selected" value="10">10</option> <option value="25">25</option> <option value="50">50</option> <option value="100">100</option> <option value="1000000000">All</option> </select><span> <?php _e('Pages per page', 'mainwp'); ?> </span> </form> </div> <div class="clear"></div> </div> </div> </div> </div> <?php if ($cachedSearch != null) { echo '<script>mainwp_pages_table_reinit();</script>'; } }
public static function renderBulkAdd() { if (isset($_POST['user_chk_bulkupload']) && $_POST['user_chk_bulkupload']) { self::renderBulkUpload(); return; } ?> <?php self::renderHeader('Add'); ?> <?php if (isset($errors) && count($errors) > 0) { ?> <div class="error below-h2"> <?php foreach ($errors as $error) { ?> <p><strong>ERROR</strong>: <?php echo $error; ?> </p> <?php } ?> </div> <?php } ?> <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div> <!-- <div id="ajax-response"></div>--> <div id="MainWPBulkAddUserLoading" class="updated"> <div><img src="images/loading.gif"/> <?php _e('Adding the user', 'mainwp'); ?> </div> </div> <div id="MainWPBulkAddUser"> <div class="mainwp_info-box"><strong><?php _e('Create a brand new user and add it to your sites.', 'mainwp'); ?> </strong></div> <form action="" method="post" name="createuser" id="createuser" class="add:users: validate" enctype="multipart/form-data"> <div class="mainwp_config_box_right"> <?php MainWPUI::select_sites_box(__("Select Sites", 'mainwp')); ?> </div> <div class="mainwp_config_box_left"> <div class="postbox"> <h3 class="mainwp_box_title"><span><?php _e('Add a Single User', 'mainwp'); ?> </span></h3> <div class="inside"> <table class="form-table"> <tr class="form-field form-required"> <th scope="row"><label for="user_login"><?php _e('Username', 'mainwp'); ?> <span class="description"><?php _e('(required)', 'mainwp'); ?> </span></label> </th> <td><input class="mainwp-field mainwp-username" name="user_login" type="text" id="user_login" value="<?php if (isset($_POST['user_login'])) { echo $_POST['user_login']; } ?> " aria-required="true"/></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="email"><?php _e('E-mail', 'mainwp'); ?> <span class="description"><?php _e('(required)', 'mainwp'); ?> </span></label></th> <td><input class="mainwp-field mainwp-email" name="email" type="text" id="email" value="<?php if (isset($_POST['email'])) { echo $_POST['email']; } ?> "/></td> </tr> <tr class="form-field"> <th scope="row"><label for="first_name"><?php _e('First Name', 'mainwp'); ?> </label></th> <td><input class="mainwp-field mainwp-name" name="first_name" type="text" id="first_name" value="<?php if (isset($_POST['first_name'])) { echo $_POST['first_name']; } ?> "/></td> </tr> <tr class="form-field"> <th scope="row"><label for="last_name"><?php _e('Last Name', 'mainwp'); ?> </label></th> <td><input class="mainwp-field mainwp-name" name="last_name" type="text" id="last_name" value="<?php if (isset($_POST['last_name'])) { echo $_POST['last_name']; } ?> "/></td> </tr> <tr class="form-field"> <th scope="row"><label for="url"><?php _e('Website', 'mainwp'); ?> </label></th> <td><input class="mainwp-field mainwp-site" name="url" type="text" id="url" class="code" value="<?php if (isset($_POST['url'])) { echo $_POST['url']; } ?> "/></td> </tr> <tr class="form-field form-required"> <th scope="row"><label for="pass1"><?php _e('Password', 'mainwp'); ?> <span class="description"><?php _e('(twice, required)', 'mainwp'); ?> </span></label></th> <td><input class="mainwp-field mainwp-password" name="pass1" type="password" id="pass1" autocomplete="off"/> <br/> <input class="mainwp-field mainwp-password" name="pass2" type="password" id="pass2" autocomplete="off"/> <br/> <div id="pass-strength-result" style="display: block"><?php _e('Strength Indicator', 'mainwp'); ?> </div><br><br> <p class="description indicator-hint"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'mainwp'); ?> </p> </td> </tr> <tr> <th scope="row"><label for="send_password"><?php _e('Send Password?', 'mainwp'); ?> </label></th> <td><label for="send_password"><input type="checkbox" name="send_password" id="send_password" <?php if (isset($_POST['send_password'])) { echo 'checked'; } ?> /> <?php _e('Send this password to the new user by email.', 'mainwp'); ?> </label></td> </tr> <tr class="form-field"> <th scope="row"><label for="role"><?php _e('Role', 'mainwp'); ?> </label></th> <td> <select name="role" id="role"> <option value='subscriber' <?php if (isset($_POST['role']) && $_POST['role'] == 'subscriber') { echo 'selected'; } ?> ><?php _e('Subscriber', 'mainwp'); ?> </option> <option value='administrator' <?php if (isset($_POST['role']) && $_POST['role'] == 'administrator') { echo 'selected'; } ?> ><?php _e('Administrator', 'mainwp'); ?> </option> <option value='editor' <?php if (isset($_POST['role']) && $_POST['role'] == 'editor') { echo 'selected'; } ?> ><?php _e('Editor', 'mainwp'); ?> </option> <option value='author' <?php if (isset($_POST['role']) && $_POST['role'] == 'author') { echo 'selected'; } ?> ><?php _e('Author', 'mainwp'); ?> </option> <option value='contributor' <?php if (isset($_POST['role']) && $_POST['role'] == 'contributor') { echo 'selected'; } ?> ><?php _e('Contributor', 'mainwp'); ?> </option> </select> </td> </tr> </table> </div> </div> <div class="postbox"> <h3 class="mainwp_box_title"><span><?php _e('Bulk Upload', 'mainwp'); ?> </span></h3> <div class="inside"> <table> <tr> <th scope="row"></th> <td> <input type="file" name="import_user_file_bulkupload" id="import_user_file_bulkupload" accept="text/comma-separated-values" class="regular-text" disabled="disabled"/> <span class="description"><?php _e('File must be in CSV format.', 'mainwp'); ?> <a href="https://mainwp.com/csv/sample_users.csv" target="_blank"><?php _e('Click here to download sample CSV file.', 'mainwp'); ?> </a></span> <div> <p> <input type="checkbox" name="user_chk_bulkupload" id="user_chk_bulkupload" value="1" /> <span class="description"><?php _e('Upload file', 'mainwp'); ?> </span> </p> <p> <input type="checkbox" name="import_user_chk_header_first" disabled="disabled" checked="checked" id="import_user_chk_header_first" value="1" /> <span class="description"><?php _e('CSV file contains a header.', 'mainwp'); ?> </span> </p> </div> </td> </tr> </table> </div> </div> </div> <p class="submit"><input type="button" name="createuser" id="bulk_add_createuser" class="button-primary" value="<?php _e('Add New User', 'mainwp'); ?> "/></p> </form> </div> <?php self::renderFooter('Add'); }
public static function render() { $show_form = true; if (isset($_POST['updateadminpassword'])) { check_admin_referer('mainwp_updateadminpassword', 'security'); $errors = array(); if (isset($_POST['select_by'])) { $selected_sites = array(); if (isset($_POST['selected_sites']) && is_array($_POST['selected_sites'])) { foreach ($_POST['selected_sites'] as $selected) { $selected_sites[] = $selected; } } $selected_groups = array(); if (isset($_POST['selected_groups']) && is_array($_POST['selected_groups'])) { foreach ($_POST['selected_groups'] as $selected) { $selected_groups[] = $selected; } } if ($_POST['select_by'] == 'group' && count($selected_groups) == 0 || $_POST['select_by'] == 'site' && count($selected_sites) == 0) { $errors[] = __('Please select the sites or groups where you want to change the admin password.', 'mainwp'); } } else { $errors[] = __('Please select whether you want to change the admin password for specific sites or groups.', 'mainwp'); } if (!isset($_POST['pass1']) || $_POST['pass1'] == '' || !isset($_POST['pass2']) || $_POST['pass2'] == '') { $errors[] = __('Please enter the password twice.', 'mainwp'); } else { if ($_POST['pass1'] != $_POST['pass2']) { $errors[] = __('Please enter the same password in the two password fields.', 'mainwp'); } } if (count($errors) == 0) { $show_form = false; $new_password = array('user_pass' => $_POST['pass1']); $dbwebsites = array(); if ($_POST['select_by'] == 'site') { //Get all selected websites foreach ($selected_sites as $k) { if (MainWPUtility::ctype_digit($k)) { $website = MainWPDB::Instance()->getWebsiteById($k); $dbwebsites[$website->id] = MainWPUtility::mapSite($website, array('id', 'url', 'name', 'adminname', 'nossl', 'privkey', 'nosslkey')); } } } else { //Get all websites from the selected groups foreach ($selected_groups as $k) { if (MainWPUtility::ctype_digit($k)) { $websites = MainWPDB::Instance()->query(MainWPDB::Instance()->getSQLWebsitesByGroupId($k)); while ($websites && ($website = @MainWPDB::fetch_object($websites))) { if ($website->sync_errors != '') { continue; } $dbwebsites[$website->id] = MainWPUtility::mapSite($website, array('id', 'url', 'name', 'adminname', 'nossl', 'privkey', 'nosslkey')); } @MainWPDB::free_result($websites); } } } if (count($dbwebsites) > 0) { $post_data = array('new_password' => base64_encode(serialize($new_password))); $output = new stdClass(); $output->ok = array(); $output->errors = array(); MainWPUtility::fetchUrlsAuthed($dbwebsites, 'newadminpassword', $post_data, array(MainWPBulkAdd::getClassName(), 'PostingBulk_handler'), $output); } } } if (!$show_form) { //Added to.. ?> <div class="wrap"> <img src="<?php echo plugins_url('images/icons/mainwp-passwords.png', dirname(__FILE__)); ?> " style="float: left; margin-right: 8px; margin-top: 7px ;" alt="MainWP Passwords" height="32"/><h2 id="add-new-user"> Update Admin Passwords</h2> <div id="message" class="updated"> <?php foreach ($dbwebsites as $website) { ?> <p><a href="<?php echo admin_url('admin.php?page=managesites&dashboard=' . $website->id); ?> "><?php echo stripslashes($website->name); ?> </a>: <?php echo isset($output->ok[$website->id]) && $output->ok[$website->id] == 1 ? __('Admin password updated.', 'mainwp') : __('ERROR: ', 'mainwp') . $output->errors[$website->id]; ?> </p> <?php } ?> </div> <br /> <a href="<?php echo get_admin_url(); ?> admin.php?page=UpdateAdminPasswords" class="add-new-h2" target="_top"><?php _e('Update admin passwords', '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 } else { // header in User page MainWPUser::renderHeader('UpdateAdminPasswords'); ?> <form action="" method="post" name="createuser" id="createuser" class="add:users: validate"> <input type="hidden" name="security" value="<?php echo wp_create_nonce('mainwp_updateadminpassword'); ?> " /> <div class="mainwp_config_box_right"> <?php MainWPUI::select_sites_box(__("Select Sites to Update", 'mainwp')); ?> </div> <div class="mainwp_config_box_left postbox mainwp-postbox"> <h3 class="mainwp_box_title"><i class="fa fa-key"></i> <?php _e('Bulk Update Administrator Passwords', 'mainwp'); ?> </h3> <div class="inside"> <table class="form-table"> <tr class="form-field form-required"> <th scope="row"><label for="pass1"><?php _e('Enter New Password ', 'mainwp'); ?> <br /><span class="description"><?php _e('(twice, required)', 'mainwp'); ?> </span></label></th> <td><input name="user_login" type="hidden" id="user_login" value="admin"> <input class="mainwp-field mainwp-password" name="pass1" type="password" id="pass1" autocomplete="off" /> <br /> <input class="mainwp-field mainwp-password" name="pass2" type="password" id="pass2" autocomplete="off" /> <br /> <div id="pass-strength-result" style="display: block;"><?php _e('Strength indicator', 'mainwp'); ?> </div> <p class="description indicator-hint" style="clear:both;"><?php _e('Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).', 'mainwp'); ?> </p> </td> </tr> <tr><td></td><td colspan="2"><input type="submit" name="updateadminpassword" id="bulk_updateadminpassword" class="button-primary" value="<?php _e('Update Now', 'mainwp'); ?> " /></td></tr> </table> </div> </div> </form> <?php MainWPUser::renderFooter('UpdateAdminPasswords'); } }
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 }
public static function renderNewEdit($task) { $selected_websites = array(); $selected_groups = array(); if ($task != null) { if ($task->sites != '') { $selected_websites = explode(',', $task->sites); } if ($task->groups != '') { $selected_groups = explode(',', $task->groups); } } $remote_destinations = apply_filters('mainwp_backups_remote_get_destinations', null, $task != null ? array('task' => $task->id) : array()); $hasRemoteDestinations = $remote_destinations == null ? $remote_destinations : count($remote_destinations); ?> <div class="mainwp_managbackups_taskoptions"> <?php //to add CSS Styling to the select sites box use the one below (this adds the css class mainwp_select_sites_box_right to the box) //MainWPUI::select_sites_box(__("Select Sites"), 'checkbox', true, true, 'mainwp_select_sites_box_right', '', $selected_websites, $selected_groups); ?> <?php MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_right', 'float: right !important; clear: both;', $selected_websites, $selected_groups, true); ?> <div class="mainwp_config_box_left"> <div class="postbox"> <h3 class="mainwp_box_title"><span><i class="fa fa-history"></i> <?php _e('Schedule Backup', 'mainwp'); ?> </span></h3> <div class="inside"> <table class="form-table" style="width: 100%"> <tr class="form-field form-required"> <th scope="row"><?php _e('Task Name:', 'mainwp'); ?> </th> <td><input type="text" id="mainwp_managebackups_add_name" class="mainwp-field mainwp-task-name" name="mainwp_managebackups_add_name" value="<?php echo isset($task) ? $task->name : ''; ?> " /><span class="mainwp-form_hint">e.g. Site1 Daily, Site1 Full Weekly, ...</span></td> </tr> <tr> <th scope="row"><?php _e('Task Schedule:', 'mainwp'); ?> </th> <td><a class="mainwp_action left backuptaskschedule <?php echo !isset($task) || $task->schedule == 'daily' ? 'mainwp_action_down' : ''; ?> " href="#" id="mainwp_managebackups_schedule_daily"><?php _e('DAILY', 'mainwp'); ?> </a><a class="mainwp_action mid backuptaskschedule <?php echo isset($task) && $task->schedule == 'weekly' ? 'mainwp_action_down' : ''; ?> " href="#" id="mainwp_managebackups_schedule_weekly"><?php _e('WEEKLY', 'mainwp'); ?> </a><a class="mainwp_action right backuptaskschedule <?php echo isset($task) && $task->schedule == 'monthly' ? 'mainwp_action_down' : ''; ?> " href="#" id="mainwp_managebackups_schedule_monthly"><?php _e('MONTHLY', 'mainwp'); ?> </a></td> </tr> <tr> <th scope="row"><?php _e('Backup File Name:', 'mainwp'); ?> </th> <td><input type="text" name="backup_filename" id="backup_filename" class="mainwp-field mainwp-file-name" value="<?php echo isset($task) ? $task->filename : ''; ?> " /><span class="mainwp-form_hint" style="display: inline; max-width: 500px;">Allowed Structure Tags: <strong>%url%</strong>, <strong>%date%</strong>, <strong>%time%</strong>, <strong>%type%</strong></span> </td> </tr> <tr><td colspan="2"><hr /></td></tr> <tr> <th scope="row"><?php _e('Backup Type:', 'mainwp'); ?> </th> <td> <a class="mainwp_action left <?php echo !isset($task) || $task->type != 'db' ? 'mainwp_action_down' : ''; ?> " href="#" id="backup_type_full"><?php _e('FULL BACKUP', 'mainwp'); ?> </a><a class="mainwp_action right <?php echo isset($task) && $task->type == 'db' ? 'mainwp_action_down' : ''; ?> " href="#" id="backup_type_db"><?php _e('DATABASE BACKUP', 'mainwp'); ?> </a> </td> </tr> <tr class="mainwp_backup_exclude_files_content" <?php echo isset($task) && $task->type == 'db' ? 'style="display: none;"' : ''; ?> ><td colspan="2"><hr /></td></tr> <tr class="mainwp-exclude-suggested"> <th scope="row" style="vertical-align: top"><?php _e('Suggested Exclude', 'mainwp'); ?> :</th> <td><p style="background: #7fb100; color: #ffffff; padding: .5em;"><?php _e('Every WordPress website is different but the sections below generally do not need to be backed up and since many of them are large in size they can even cause issues with your backup including server timeouts.', 'mainwp'); ?> </p></td> </tr> <tr class="mainwp-exclude-backup-locations"> <td colspan="2"><h4><i class="fa fa-cloud-upload"></i> <?php _e('Known Backup Locations', 'mainwp'); ?> </h4></td> </tr> <tr class="mainwp-exclude-backup-locations"> <td><label for="mainwp-known-backup-locations"><?php _e('Exclude', 'mainwp'); ?> </label><input type="checkbox" id="mainwp-known-backup-locations" <?php echo !isset($task) || $task->excludebackup == 1 ? 'checked' : ''; ?> ></td> <td class="mainwp-td-des"><a href="#" id="mainwp-show-kbl-folders"><?php _e('+ Show Excluded Folders', 'mainwp'); ?> </a><a href="#" id="mainwp-hide-kbl-folders"><?php _e('- Hide Excluded Folders', 'mainwp'); ?> </a><br/> <textarea id="mainwp-kbl-content" disabled></textarea> <br/><?php _e('This adds known backup locations of popular WordPress backup plugins to the exclude list. Old backups can take up a lot of space and can cause your current MainWP backup to timeout.', 'mainwp'); ?> </td> </tr> <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr> <tr class="mainwp-exclude-cache-locations"> <td colspan="2"><h4><i class="fa fa-cubes"></i> <?php _e('Known Cache Locations', 'mainwp'); ?> </h4></td> </tr> <tr class="mainwp-exclude-cache-locations"> <td><label for="mainwp-known-cache-locations"><?php _e('Exclude', 'mainwp'); ?> </label><input type="checkbox" id="mainwp-known-cache-locations" <?php echo !isset($task) || $task->excludecache == 1 ? 'checked' : ''; ?> ></td> <td class="mainwp-td-des"><a href="#" id="mainwp-show-kcl-folders"><?php _e('+ Show Excluded Folders', 'mainwp'); ?> </a><a href="#" id="mainwp-hide-kcl-folders"><?php _e('- Hide Excluded Folders', 'mainwp'); ?> </a><br/> <textarea id="mainwp-kcl-content" disabled></textarea> <br/><?php _e('This adds known cache locations of popular WordPress cache plugins to the exclude list. A cache can be massive with thousands of files and can cause your current MainWP backup to timeout. Your cache will be rebuilt by your caching plugin when the backup is restored.', 'mainwp'); ?> </td> </tr> <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr> <tr class="mainwp-exclude-nonwp-folders"> <td colspan="2"><h4><i class="fa fa-folder"></i> <?php _e('Non-WordPress Folders', 'mainwp'); ?> </h4></td> </tr> <tr class="mainwp-exclude-nonwp-folders"> <td><label for="mainwp-non-wordpress-folders"><?php _e('Exclude', 'mainwp'); ?> </label><input type="checkbox" id="mainwp-non-wordpress-folders" <?php echo !isset($task) || $task->excludenonwp == 1 ? 'checked' : ''; ?> ></td> <td class="mainwp-td-des"><a href="#" id="mainwp-show-nwl-folders"><?php _e('+ Show Excluded Folders', 'mainwp'); ?> </a><a href="#" id="mainwp-hide-nwl-folders"><?php _e('- Hide Excluded Folders', 'mainwp'); ?> </a><br/> <textarea id="mainwp-nwl-content" disabled></textarea> <br/><?php _e('This adds folders that are not part of the WordPress core (wp-admin, wp-content and wp-include) to the exclude list. Non-WordPress folders can contain a large amount of data or may be a sub-domain or add-on domain that should be backed up individually and not with this backup.', 'mainwp'); ?> </td> </tr> <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr> <tr class="mainwp-exclude-zips"> <td colspan="2"><h4><i class="fa fa-file-archive-o"></i> <?php _e('ZIP Archives', 'mainwp'); ?> </h4></td> </tr> <tr class="mainwp-exclude-zips"> <td><label for="mainwp-zip-archives"><?php _e('Exclude', 'mainwp'); ?> </label><input type="checkbox" id="mainwp-zip-archives" <?php echo !isset($task) || $task->excludezip == 1 ? 'checked' : ''; ?> ></td> <td class="mainwp-td-des"><?php _e('Zip files can be large and are often not needed for a WordPress backup. Be sure to deselect this option if you do have zip files you need backed up.', 'mainwp'); ?> </td> </tr> <tr class="mainwp-exclude-separator"><td colspan="2" style="padding: 0 !important;"><hr /></td></tr> <tr class="mainwp_backup_exclude_files_content" <?php echo isset($task) && $task->type == 'db' ? 'style="display: none;"' : ''; ?> > <th scope="row" style="vertical-align: top"><h4 class="mainwp-custom-excludes"><i class="fa fa-minus-circle"></i> <?php _e('Custom Excludes', 'mainwp'); ?> </h4></th> <td> <p style="background: #7fb100; color: #ffffff; padding: .5em;"><?php _e('Exclude any additional files that you do not need backed up for this site. Click a folder name to drill down into the directory.', 'mainwp'); ?> </p> <br /> <?php printf(__('Click directories to navigate. Click the red sign ( <img style="margin-bottom: -3px;" src="%s"> ) to exclude a folder.', 'mainwp'), plugins_url('images/exclude.png', dirname(__FILE__))); ?> <br /><br /> <table class="mainwp_excluded_folders_cont"> <tr> <td style="width: 280px"> <div id="backup_exclude_folders" class="mainwp_excluded_folders"></div> </td> <td> <?php _e('Excluded files & directories:', 'mainwp'); ?> <br/> <textarea id="excluded_folders_list"><?php $excluded = isset($task) ? $task->exclude : ""; if ($excluded != '') { $excluded = explode(',', $excluded); echo implode("/\n", $excluded) . "/\n"; } ?> </textarea> </td> </tr> </table> <span class="description"><strong><?php _e('ATTENTION:', 'mainwp'); ?> </strong> <?php _e('Do not exclude any folders if you are using this backup to clone or migrate the wordpress installation.', 'mainwp'); ?> </span> </td> </tr> <tr><td colspan="2"><hr /></td></tr> <?php if ($hasRemoteDestinations !== null) { ?> <tr> <th scope="row"><?php _e('Store Backup In:', 'mainwp'); ?> </th> <td> <a class="mainwp_action left <?php echo !$hasRemoteDestinations ? 'mainwp_action_down' : ''; ?> " href="#" id="backup_location_local"><?php _e('LOCAL SERVER ONLY', 'mainwp'); ?> </a><a class="mainwp_action right <?php echo $hasRemoteDestinations ? 'mainwp_action_down' : ''; ?> " href="#" id="backup_location_remote"><?php _e('REMOTE DESTINATION', 'mainwp'); ?> </a> </td> </tr> <tr class="mainwp_backup_destinations" <?php echo !$hasRemoteDestinations ? 'style="display: none;"' : ''; ?> > <th scope="row"><?php _e('Backup Subfolder:', 'mainwp'); ?> </th> <td><input type="text" id="mainwp_managebackups_add_subfolder" name="backup_subfolder" value="<?php echo isset($task) ? $task->subfolder : 'MainWP Backups/%url%/%type%/%date%'; ?> "/><span class="mainwp-form_hint" style="display: inline; max-width: 500px;">Allowed Structure Tags: <strong>%sitename%</strong>, <strong>%url%</strong>, <strong>%date%</strong>, <strong>%task%</strong>, <strong>%type%</strong></span></td> </tr> <?php } ?> <?php do_action('mainwp_backups_remote_settings', array('task' => $task)); ?> <tr><td colspan="2"><hr /></td></tr> <?php $globalArchiveFormat = get_option('mainwp_archiveFormat'); if ($globalArchiveFormat == false) { $globalArchiveFormat = 'tar.gz'; } if ($globalArchiveFormat == 'zip') { $globalArchiveFormatText = 'Zip'; } else { if ($globalArchiveFormat == 'tar') { $globalArchiveFormatText = 'Tar'; } else { if ($globalArchiveFormat == 'tar.gz') { $globalArchiveFormatText = 'Tar GZip'; } else { if ($globalArchiveFormat == 'tar.bz2') { $globalArchiveFormatText = 'Tar BZip2'; } } } } $archiveFormat = isset($task) ? $task->archiveFormat : 'site'; $useGlobal = $archiveFormat == 'global'; $useSite = $archiveFormat == '' || $archiveFormat == 'site'; ?> <tr> <th scope="row"><?php _e('Archive Format', 'mainwp'); ?> </th> <td> <table class="mainwp-nomarkup"> <tr> <td valign="top"> <span class="mainwp-select-bg"><select name="mainwp_archiveFormat" id="mainwp_archiveFormat"> <option value="site" <?php if ($useSite) { ?> selected<?php } ?> >Site specific setting</option> <option value="global" <?php if ($useGlobal) { ?> selected<?php } ?> >Global setting (<?php echo $globalArchiveFormatText; ?> )</option> <option value="zip" <?php if ($archiveFormat == 'zip') { ?> selected<?php } ?> >Zip</option> <option value="tar" <?php if ($archiveFormat == 'tar') { ?> selected<?php } ?> >Tar</option> <option value="tar.gz" <?php if ($archiveFormat == 'tar.gz') { ?> selected<?php } ?> >Tar GZip</option> <option value="tar.bz2" <?php if ($archiveFormat == 'tar.bz2') { ?> selected<?php } ?> >Tar BZip2</option> </select><label></label></span> </td> <td> <i> <span id="info_site" class="archive_info" <?php if (!$useSite) { ?> style="display: none;"<?php } ?> >Depends on the settings of the child site</span> <span id="info_global" class="archive_info" <?php if (!$useGlobal) { ?> style="display: none;"<?php } ?> ><?php if ($globalArchiveFormat == 'zip') { ?> Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php } elseif ($globalArchiveFormat == 'tar') { ?> Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php } elseif ($globalArchiveFormat == 'tar.gz') { ?> Creates a GZipped tar-archive. (Good compression, fast, low memory usage)<?php } elseif ($globalArchiveFormat == 'tar.bz2') { ?> Creates a BZipped tar-archive. (Best compression, fast, low memory usage)<?php } ?> </span> <span id="info_zip" class="archive_info" <?php if ($archiveFormat != 'zip') { ?> style="display: none;"<?php } ?> >Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)</span> <span id="info_tar" class="archive_info" <?php if ($archiveFormat != 'tar') { ?> style="display: none;"<?php } ?> >Creates an uncompressed tar-archive. (No compression, fast, low memory usage)</span> <span id="info_tar.gz" class="archive_info" <?php if ($archiveFormat != 'tar.gz') { ?> style="display: none;"<?php } ?> >Creates a GZipped tar-archive. (Good compression, fast, low memory usage)</span> <span id="info_tar.bz2" class="archive_info" <?php if ($archiveFormat != 'tar.bz2') { ?> style="display: none;"<?php } ?> >Creates a BZipped tar-archive. (Best compression, fast, low memory usage)</span> </i> </td> </tr> </table> </td> </tr> <?php $maximumFileDescriptorsOverride = isset($task) ? $task->maximumFileDescriptorsOverride == 1 : false; $maximumFileDescriptorsAuto = isset($task) ? $task->maximumFileDescriptorsAuto == 1 : false; $maximumFileDescriptors = isset($task) ? $task->maximumFileDescriptors : 150; ?> <tr class="archive_method archive_zip" <?php if ($archiveFormat != 'zip') { ?> style="display: none;"<?php } ?> > <th scope="row"><?php _e('Maximum File Descriptors on Child', 'mainwp'); ?> <?php MainWPUtility::renderToolTip('The maximum number of open file descriptors on the child hosting.', 'http://docs.mainwp.com/maximum-number-of-file-descriptors/'); ?> </th> <td> <div class="mainwp-radio" style="float: left;"> <input type="radio" value="" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_global" <?php echo !$maximumFileDescriptorsOverride ? 'checked="true"' : ''; ?> "/> <label for="mainwp_options_maximumFileDescriptorsOverride_global"></label> </div>Global Setting (<a href="<?php echo admin_url('admin.php?page=Settings'); ?> ">Change Here</a>)<br/> <div class="mainwp-radio" style="float: left;"> <input type="radio" value="override" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_override" <?php echo $maximumFileDescriptorsOverride ? 'checked="true"' : ''; ?> "/> <label for="mainwp_options_maximumFileDescriptorsOverride_override"></label> </div>Override<br/><br /> <div style="float: left">Auto detect: </div><div class="mainwp-checkbox"><input type="checkbox" id="mainwp_maximumFileDescriptorsAuto" name="mainwp_maximumFileDescriptorsAuto" <?php echo $maximumFileDescriptorsAuto ? 'checked="checked"' : ''; ?> /> <label for="mainwp_maximumFileDescriptorsAuto"></label></div><div style="float: left"><i>(<?php _e('Enter a fallback value because not all hosts support this function.', 'mainwp'); ?> )</i></div><div style="clear:both"></div> <input type="text" name="mainwp_options_maximumFileDescriptors" id="mainwp_options_maximumFileDescriptors" value="<?php echo $maximumFileDescriptors; ?> "/><span class="mainwp-form_hint"><?php _e('The maximum number of open file descriptors on the child hosting. 0 sets unlimited.', 'mainwp'); ?> </span> </td> </tr> <tr class="archive_method archive_zip" <?php if ($archiveFormat != 'zip') { ?> style="display: none;"<?php } ?> > <th scope="row">Load files in memory before zipping <?php MainWPUtility::renderToolTip('This causes the files to be opened and closed immediately, using less simultaneous I/O operations on the disk. For huge sites with a lot of files we advise to disable this, memory usage will drop but we will use more file handlers when backing up.', 'http://docs.mainwp.com/load-files-memory/'); ?> </th> <td> <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_global" value="1" <?php if (!isset($task) || $task->loadFilesBeforeZip == false || $task->loadFilesBeforeZip == 1) { ?> checked="true"<?php } ?> /> Global setting (<a href="<?php echo admin_url('admin.php?page=Settings'); ?> ">Change Here</a>)<br /> <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_yes" value="2" <?php if (isset($task) && $task->loadFilesBeforeZip == 2) { ?> checked="true"<?php } ?> /> Yes<br /> <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_no" value="0" <?php if (isset($task) && $task->loadFilesBeforeZip == 0) { ?> checked="true"<?php } ?> /> No<br /> </td> </tr> </table> </div> </div> </div> <div class="clear"></div> </div> <?php if ($task != null) { ?> <input type="hidden" id="backup_task_id" value="<?php echo $task->id; ?> " /> <script>mainwp_managebackups_updateExcludefolders();</script> <?php } }
public function select_sites_box($title = "", $type = 'checkbox', $show_group = true, $show_select_all = true, $class = '', $style = '', $selected_websites = array(), $selected_groups = array()) { MainWPUI::select_sites_box($title, $type, $show_group, $show_select_all, $class, $style, $selected_websites, $selected_groups); }
public static function render() { $cachedSearch = MainWPCache::getCachedContext('Themes'); self::renderHeader('Manage'); ?> <div class="mainwp-search-form"> <div class="postbox mainwp-postbox"> <h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php _e('Search Themes', 'mainwp'); ?> </h3> <div class="inside"> <div class="mainwp_info-box-blue"> <?php _e('To only <strong>View or Ignore</strong> themes select <strong>All Themes</strong>', 'mainwp'); ?> <br/> <?php _e('To <strong>Activate</strong> or <strong>Delete</strong> a Theme select <strong>Inactive</strong> (A theme needs to be Deactivated in order for it to be Enabled)', 'mainwp'); ?> <br/> </div> <p> <?php _e('Status:', 'mainwp'); ?> <br /> <select name="mainwp_theme_search_by_status" id="mainwp_theme_search_by_status"> <option value="all" <?php if ($cachedSearch != null && $cachedSearch['the_status'] == 'all') { echo 'selected'; } ?> ><?php _e('All Themes', 'mainwp'); ?> </option> <option value="active" <?php if ($cachedSearch != null && $cachedSearch['the_status'] == 'active') { echo 'selected'; } ?> ><?php _e('Active', 'mainwp'); ?> </option> <option value="inactive" <?php if ($cachedSearch != null && $cachedSearch['the_status'] == 'inactive') { echo 'selected'; } ?> ><?php _e('Inactive', 'mainwp'); ?> </option> </select> </p> <p> <?php _e('Containing Keyword:', 'mainwp'); ?> <br/> <input type="text" id="mainwp_theme_search_by_keyword" class="mainwp-field mainwp-keyword" size="50" value="<?php if ($cachedSearch != null) { echo $cachedSearch['keyword']; } ?> "/> </p> </div> </div> <?php MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_left'); ?> <div style="clear: both;"></div> <input type="button" name="mainwp_show_themes" id="mainwp_show_themes" class="button-primary" value="<?php _e('Show Themes', 'mainwp'); ?> "/> <span id="mainwp_themes_loading"> <i class="fa fa-spinner fa-pulse"></i> <em><?php _e('Grabbing information from Child Sites', 'mainwp'); ?> </em></span> <span id="mainwp_themes_loading_info"><?php _e('Automatically refreshing to get up to date information.', 'mainwp'); ?> </span> <br/><br/> </div> <div class="clear"></div> <div id="mainwp_themes_error"></div> <div id="mainwp_themes_main" <?php if ($cachedSearch != null) { echo 'style="display: block;"'; } ?> > <div id="mainwp_themes_content"> <?php MainWPCache::echoBody('Themes'); ?> </div> </div> <?php if ($cachedSearch != null) { echo '<script>mainwp_themes_all_table_reinit();</script>'; } self::renderFooter('Manage'); }