<?php //pb_backupbuddy::load_script( 'jquery-ui-core', true ); // WP core script. pb_backupbuddy::load_script('jquery-ui-datepicker', true); // WP core script. pb_backupbuddy::load_script('jquery-ui-slider', true); // WP core script. pb_backupbuddy::load_script('timepicker.js'); pb_backupbuddy::load_style('admin.css', false); // Plugin-specific file. pb_backupbuddy::load_style('jquery_smoothness.css', false); // Plugin-specific file. ?> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery( '#pb_backupbuddy_first_run' ).datetimepicker({ ampm: true }); }); </script> <?php pb_backupbuddy::$classes['core']->versions_confirm(); $date_format_example = 'mm/dd/yyyy hh:mm [am/pm]'; // Example date format for displaying to user. // HANDLE SCHEDULE DELETION. if (pb_backupbuddy::_POST('bulk_action') == 'delete_schedule') { pb_backupbuddy::verify_nonce(pb_backupbuddy::_POST('_wpnonce')); // Security check to prevent unauthorized deletions by posting from a remote place.
function ajax_header($js = true) { echo '<head>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; echo '<title>PluginBuddy</title>'; wp_print_styles('global'); wp_print_styles('wp-admin'); wp_print_styles('colors-fresh'); wp_print_styles('colors-fresh'); if ($js === true) { wp_enqueue_script('jquery'); wp_print_scripts('jquery'); } //echo '<link rel="stylesheet" href="' . pb_backupbuddy::plugin_url(); . '/css/admin.css" type="text/css" media="all" />'; pb_backupbuddy::load_script('admin.js', true); pb_backupbuddy::load_style('admin.css', true); pb_backupbuddy::load_script('tooltip.js', true); echo '<body class="wp-core-ui">'; echo '<div style="padding: 8px; padding-left: 12px; padding-right: 12px;">'; }
<?php pb_backupbuddy::$classes['core']->versions_confirm(); pb_backupbuddy::load_script('jquery'); echo '<div style="margin-top: 40px;">'; pb_backupbuddy::disalert('getting_started_hover_tip', '<span class="pb_label">Tip</span> ' . sprintf(__('Throughout the plugin you may hover your mouse over question marks %1$s for tips or click play icons %2$s for video tutorials.', 'it-l10n-backupbuddy'), pb_backupbuddy::tip(__('This tip provides additional help.', 'it-l10n-backupbuddy'), '', false), pb_backupbuddy::video('WQrOCvOYof4', __('Introduction to BackupBuddy', 'it-l10n-backupbuddy'), false))); //pb_backupbuddy::disalert( 'getting_started_tabs_tip', '<span class="pb_label">Tip</span> Select the from the tabs above for details & tutorials covering BackupBuddy\'s primary features.' ); pb_backupbuddy::$ui->start_tabs('getting_started', array(array('title' => __('Overview', 'it-l10n-backupbuddy'), 'slug' => 'overview'), array('title' => __('Backup', 'it-l10n-backupbuddy'), 'slug' => 'backup'), array('title' => __('Migrate / Restore', 'it-l10n-backupbuddy'), 'slug' => 'restore_migrate')), 'width: 100%;'); pb_backupbuddy::$ui->start_tab('overview'); //echo '<p><i>"' . pb_backupbuddy::settings( 'description' ) . '"</i></p>'; /* echo '<p>'; echo '<span class="pb_label">Tip</span> <b>Select the from the tabs above for details & tutorials covering BackupBuddy\'s primary features.</b>'; echo '</p>'; */ //echo '<p>'; echo '<h2>Quick Start</h2>'; //echo '</p>'; ?> <ol> <li type="disc">Receive error notifications by verifying your "Error Notification Email" on the <a href="?page=pb_backupbuddy_settings">Settings</a> page.</li> <li type="disc">Keep backups from piling up with "Local Archive Storage Limits" on the <a href="?page=pb_backupbuddy_settings">Settings</a> page.</li> <li type="disc">Keep your site backed up regularly by creating schedules on the <a href="?page=pb_backupbuddy_scheduling">Scheduling</a> page.</li> <li type="disc">Read the tabbed sections above or tutorials & videos linked in the "Tutorials & Support" box to the right for more in-depth information.</li> </ol> <h2>Main Features</h2><br> Select from the tabs above for information & <b>tutorials</b> about BackupBuddy's main features. The "Tutorials & Support" box to the upper right contains valuable resources for learning how to use BackupBuddy to its fullest potential as well as tips and troubleshooting information. <br><br> <h2>Additional Features</h2>
} else { die('Error #84537483: Invalid profile ID `' . htmlentities($requested_profile) . '`. Profile with this number was not found. Try deactivating then reactivating the plugin. If this fails please reset the plugin Settings back to Defaults from the Settings page.'); } } else { die('Error #85489548955. Invalid profile ID not numeric: `' . htmlentities($requested_profile) . '`.'); } } // Sending to remote destination after manual backup completes? $post_backup_steps = array(); if (pb_backupbuddy::_GET('after_destination') != '' && is_numeric(pb_backupbuddy::_GET('after_destination'))) { $destination_id = (int) pb_backupbuddy::_GET('after_destination'); if (pb_backupbuddy::_GET('delete_after') == 'true') { $delete_after = true; } else { $delete_after = false; } $post_backup_steps = array(array('function' => 'send_remote_destination', 'args' => array($destination_id, $delete_after), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0)); pb_backupbuddy::status('details', 'Manual backup set to send to remote destination `' . $destination_id . '`. Delete after: `' . $delete_after . '`. Added to post backup function steps.'); } pb_backupbuddy::load_script('backupEvents.js'); // Run the backup! pb_backupbuddy::flush(); // Flush any buffer to screen just before the backup begins. if (pb_backupbuddy::$classes['backup']->start_backup_process($profile_array, 'manual', array(), $post_backup_steps, '', $serial_override, $export_plugins) !== true) { pb_backupbuddy::alert(__('Fatal Error #4344443: Backup failure', 'it-l10n-backupbuddy'), true); } ?> </div>
<?php // Tutorial pb_backupbuddy::load_script('jquery.joyride-2.0.3.js'); pb_backupbuddy::load_script('modernizr.mq.js'); pb_backupbuddy::load_style('joyride.css'); ?> <a href="" class="pb_backupbuddy_begintour">Tour This Page</a> <ol id="pb_backupbuddy_tour" style="display: none;"> <li data-id="ui-id-1">These settings are your defaults for all backups. Profiles may be used to override many settings to customize various backups to your needs.</li> <li data-id="ui-id-2">Use profiles to customize various settings on a case-by-case basis and override default backup settings.</li> <li data-id="ui-id-3">Customize advanced options or troubleshoot issues by overriding functionality or changing default operation.</li> <li data-class="jQueryOuterTree">Database tables may be omitted from backups by hovering over a table in the list and clicking the (-) minus symbol.</li> <li data-id="exlude_dirs" data-button="Finish">Directories & files may be omitted from backups by hovering over an item in the list and clicking the (-) minus symbol.</li> </ol> <script> jQuery(window).load(function() { jQuery( '.pb_backupbuddy_begintour' ).click( function() { jQuery("#pb_backupbuddy_tour").joyride({ tipLocation: 'top', }); return false; }); }); </script> <?php pb_backupbuddy::$ui->title('BackupBuddy Settings'); pb_backupbuddy::$classes['core']->versions_confirm(); $data = array(); // To pass to view.
<?php // TODO: The entire remote destination picking / editing system is still loving in the pre-framework architecture. Migrate it. pb_backupbuddy::load_style('admin'); pb_backupbuddy::load_script('jquery'); pb_backupbuddy::load_script('admin.js', true); // pbframework version due to second param. pb_backupbuddy::load_script('admin.js'); pb_backupbuddy::load_style('admin.css', true); // pbframework version due to second param. pb_backupbuddy::load_script('tooltip.js', true); // pbframework version due to second param. ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#pluginbuddy-tabs").tabs(); jQuery('.pb_backupbuddy_selectdestination').click(function(e) { var win = window.dialogArguments || opener || parent || top; win.pb_backupbuddy_selectdestination( jQuery(this).attr( 'href' ), jQuery(this).attr( 'alt' ), '<?php if (!empty($_GET['callback_data'])) { echo $_GET['callback_data']; } ?> ' ); win.tb_remove(); return false; }); }); </script>
<html xmlns="http://www.w3.org/1999/xhtml" class="ie8" dir="ltr" lang="en-US"> <![endif]--> <!--[if !(IE 8) ]><!--> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> <!--<![endif]--> <head> <title>BackupBuddy importbuddy.php by PluginBuddy.com</title> <meta name="robots" content="noindex"> <?php pb_backupbuddy::load_style('style.css'); pb_backupbuddy::load_script('jquery.js'); pb_backupbuddy::load_script('ui.core.js'); pb_backupbuddy::load_script('ui.widget.js'); pb_backupbuddy::load_script('ui.tabs.js'); pb_backupbuddy::load_script('tooltip.js'); pb_backupbuddy::load_script('importbuddy.js'); ?> </head> <?php if (pb_backupbuddy::$options['display_mode'] == 'normal') { echo '<body>'; echo '<center><img src="importbuddy/images/bb-logo.png" title="BackupBuddy Restoration & Migration Tool" style="margin-top: 10px;"></center><br>'; } else { // Magic migration mode inside WordPress (in an iframe). echo '<body onLoad="window.parent.scroll(0,0);">'; // Auto scroll to top of parent while in iframe. } //<a href="http://ithemes.com/codex/page/BackupBuddy" style="text-decoration: none;">Need help? See the <b>Knowledge Base</b> for tutorials & more.</a><br> ?> <center>
public function rollback() { pb_backupbuddy::$ui->ajax_header(); pb_backupbuddy::load_script('jquery'); echo '<div id="pb_backupbuddy_working" style="width: 100px; margin-bottom: 30px;"><br><center><img src="' . pb_backupbuddy::plugin_url() . '/images/working.gif" title="Working... Please wait as this may take a moment..."></center></div>'; ?> <script> function pb_status_append( status_string ) { var win = window.dialogArguments || opener || parent || top; win.pb_status_append( status_string ); } function pb_status_undourl( undo_url ) { var win = window.dialogArguments || opener || parent || top; win.pb_status_undourl( undo_url ); } var win = window.dialogArguments || opener || parent || top; win.window.scrollTo(0,0); </script> <?php global $pb_backupbuddy_js_status; $pb_backupbuddy_js_status = true; pb_backupbuddy::set_status_serial('restore'); $step = strip_tags(pb_backupbuddy::_GET('step')); if ('' == $step || !is_numeric($step)) { $step = 0; } $backupFile = strip_tags(pb_backupbuddy::_GET('archive')); if ('' == $backupFile) { pb_backupbuddy::alert('The backup file to restore from must be specified.'); die; } $stepFile = pb_backupbuddy::plugin_path() . '/controllers/pages/rollback/_step' . $step . '.php'; if (!file_exists($stepFile)) { pb_backupbuddy::alert('Error #849743. Invalid roll back step `' . htmlentities(pb_backupbuddy::_GET('step')) . '` (' . $step . ').'); die; } require $stepFile; echo '<br><br><br>'; echo '<script type="text/javascript">jQuery("#pb_backupbuddy_working").hide();</script>'; pb_backupbuddy::$ui->ajax_footer(); pb_backupbuddy::flush(); die; }
function ajax_header($js = true, $padding = true) { echo '<head>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; echo '<title>PluginBuddy</title>'; wp_print_styles('wp-admin'); wp_print_styles('dashicons'); wp_print_styles('buttons'); wp_print_styles('colors'); if ($js === true) { wp_enqueue_script('jquery'); wp_print_scripts('jquery'); } pb_backupbuddy::load_style('wp-admin.css'); echo '<style> .form-table input[type=radio],.form-table input[type=checkbox] { width: 16px; height: 16px; } .form-table input[type=checkbox]:checked:before { margin: -7px; } .form-table input[type=radio]:checked:before { margin: 3px; } </style>'; //echo '<link rel="stylesheet" href="' . pb_backupbuddy::plugin_url(); . '/css/admin.css" type="text/css" media="all" />'; pb_backupbuddy::load_script('admin.js', true); pb_backupbuddy::load_style('admin.css', true); pb_backupbuddy::load_script('tooltip.js', true); echo '<body class="wp-core-ui">'; if ($padding === true) { echo '<div style="padding: 8px; padding-left: 12px; padding-right: 12px;">'; } else { echo '<div>'; } }
function __call($name, $arguments) { $page_file = pb_backupbuddy::plugin_path() . '/controllers/pages/' . $name . '.php'; if ($name == 'getting_started') { $page_file = pb_backupbuddy::plugin_path() . '/pluginbuddy/_' . $name . '.php'; } if (file_exists($page_file)) { // Load from /controllers/pages/PAGE.php if it exists. // Display page. pb_backupbuddy::load_script('admin.js', true); pb_backupbuddy::load_style('admin.css', true); pb_backupbuddy::load_script('tooltip.js', true); echo '<div class="wrap">'; require_once $page_file; echo '</div>'; echo '<div id="footer-thankyou" style="float: right; color: #777; margin-right: 21px; margin-top: 20px; margin-bottom: -34px;">Running BackupBuddy v' . pb_backupbuddy::settings('version') . '.</div>'; } else { // Not found echo '{Missing pages method `' . $name . '`.}'; } }
<?php // TODO: The entire remote destination picking / editing system is still loving in the pre-framework architecture. Migrate it. pb_backupbuddy::load_style( 'admin' ); pb_backupbuddy::load_script( 'jquery' ); pb_backupbuddy::load_script( 'admin.js', true ); // pbframework version due to second param. pb_backupbuddy::load_script( 'admin.js' ); pb_backupbuddy::load_style( 'admin.css', true ); // pbframework version due to second param. pb_backupbuddy::load_script( 'tooltip.js', true ); // pbframework version due to second param. ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery("#pluginbuddy-tabs").tabs(); jQuery('.pb_backupbuddy_selectdestination').click(function(e) { var win = window.dialogArguments || opener || parent || top; win.pb_backupbuddy_selectdestination( jQuery(this).attr( 'href' ), jQuery(this).attr( 'alt' ), '<?php if ( !empty( $_GET['callback_data'] ) ) { echo $_GET['callback_data']; } ?>' ); win.tb_remove(); return false; }); }); </script> <?php // Handle duplication. if ( pb_backupbuddy::_GET( 'duplicate' ) != '' ) { if ( !isset( pb_backupbuddy::$options['remote_destinations'][pb_backupbuddy::_GET( 'duplicate' )] ) ) { pb_backupbuddy::alert( 'Invalid destination ID to duplicate.' );
function __call($name, $arguments) { $page_file = pb_backupbuddy::plugin_path() . '/controllers/pages/' . $name . '.php'; if ($name == 'getting_started') { $page_file = pb_backupbuddy::plugin_path() . '/pluginbuddy/_' . $name . '.php'; } if (file_exists($page_file)) { // Load from /controllers/pages/PAGE.php if it exists. //pb_backupbuddy::load(); //pb_backupbuddy::init_class_controller(); // Adds ui controller if it doesnt exist yet. EDIT: now handled in pb_backupbuddy::__construct(). // Display page. pb_backupbuddy::load_script('admin.js', true); pb_backupbuddy::load_style('admin.css', true); pb_backupbuddy::load_script('tooltip.js', true); echo '<div class="wrap">'; require_once $page_file; echo '</div>'; // After page. if (pb_backupbuddy::$options['log_level'] == '3' || defined('PB_DEBUG') && PB_DEBUG === true) { pb_backupbuddy::debug(); } } else { // Not found echo '{Missing pages method `' . $name . '`.}'; } }
public function deploy() { pb_backupbuddy::$ui->ajax_header(); pb_backupbuddy::load_script('jquery'); echo '<div id="pb_backupbuddy_working" style="width: 100px; margin-bottom: 30px;"><br><center><img src="' . pb_backupbuddy::plugin_url() . '/images/working.gif" title="Working... Please wait as this may take a moment..."></center></div>'; ?> <script> function pb_status_append( status_string ) { var win = window.dialogArguments || opener || parent || top; win.pb_status_append( status_string ); } function pb_status_undourl( undo_url ) { var win = window.dialogArguments || opener || parent || top; win.pb_status_undourl( undo_url ); } var win = window.dialogArguments || opener || parent || top; win.window.scrollTo(0,0); </script> <?php global $pb_backupbuddy_js_status; $pb_backupbuddy_js_status = true; pb_backupbuddy::set_status_serial('deploy'); $step = strip_tags(pb_backupbuddy::_GET('step')); if (!ctype_alnum($step)) { die('Error #8549845: Invalid step `' . htmlentities($step) . '`.'); } $stepFile = pb_backupbuddy::plugin_path() . '/controllers/pages/deploy/_' . $step . '.php'; if (!file_exists($stepFile)) { pb_backupbuddy::alert('Error #3298238. Invalid deploy step `' . htmlentities(pb_backupbuddy::_GET('step')) . '` (' . $step . ').'); die; } require $stepFile; echo '<br><br><br>'; echo '<script type="text/javascript">jQuery("#pb_backupbuddy_working").hide();</script>'; pb_backupbuddy::$ui->ajax_footer(); pb_backupbuddy::flush(); die; }
<?php pb_backupbuddy::load_script('icicle.js'); pb_backupbuddy::load_script('icicle_setup.js'); pb_backupbuddy::load_style('jit_base.css'); pb_backupbuddy::load_style('jit_icicle.css'); ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#pb_iciclelaunch').click(function(e) { jQuery('#pb_infovis_container').slideToggle(); jQuery.post( '<?php echo pb_backupbuddy::ajax_url('icicle'); ?> ', function( data ) { jQuery('#infovis').html(''); icicle_init( data ); } ); }); jQuery( '.pb_backupbuddy_site_size_listing_button' ).click( function() { jQuery( '#pb_backupbuddy_site_size_listing_intro > .pb_backupbuddy_loading' ).show(); jQuery.post( '<?php echo pb_backupbuddy::ajax_url('site_size_listing'); ?> ', function( data ) { jQuery( '#pb_backupbuddy_site_size_listing_content' ).html( data ); jQuery( '#pb_backupbuddy_site_size_listing_intro > .pb_backupbuddy_loading' ).hide();
$picker_url = pb_backupbuddy::ajax_url('destination_picker'); } if (pb_backupbuddy::_GET('action_verb') != '') { $action_verb = ' ' . htmlentities(pb_backupbuddy::_GET('action_verb')); } else { // default $action_verb = ''; } pb_backupbuddy::load_style('admin'); pb_backupbuddy::load_style('destination_picker.css'); pb_backupbuddy::load_script('jquery'); pb_backupbuddy::load_script('jquery-ui-core'); pb_backupbuddy::load_script('jquery-ui-widget'); // Load accordion JS. Pre WP v3.3 we need to load our own JS file. Was: pb_backupbuddy::load_script( 'jquery-ui-accordion' ); global $wp_version; pb_backupbuddy::load_script(version_compare($wp_version, '3.3', '<') ? 'jquery.ui.accordion.min.js' : 'jquery-ui-accordion'); // Destinations may hide the add and test buttons by altering these variables. global $pb_hide_save; global $pb_hide_test; $pb_hide_save = false; $pb_hide_test = false; // Load destinations class. require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php'; ?> <script> jQuery(document).ready(function() {
<li data-class="nav-tab-2">View your site's files in either a graphical format or a listing. The listing also notes exclusions from backups.</li> <li data-class="nav-tab-3" data-button="Finish">Additional site tools for managing CRON schedules and database text search & replace.</li> </ol> <script> jQuery(window).load(function() { jQuery(document).on( 'click', '.pb_backupbuddy_begintour', function(e) { jQuery("#pb_backupbuddy_tour").joyride({ tipLocation: 'top', }); return false; }); }); </script> <?php pb_backupbuddy::load_script('admin.js'); pb_backupbuddy::$ui->title(__('Server Tools', 'it-l10n-backupbuddy')); backupbuddy_core::versions_confirm(); $default_tab = 0; if (is_numeric(pb_backupbuddy::_GET('tab'))) { $default_tab = pb_backupbuddy::_GET('tab'); } pb_backupbuddy::$ui->start_tabs('getting_started', array(array('title' => __('Server', 'it-l10n-backupbuddy'), 'slug' => 'server'), array('title' => __('Database', 'it-l10n-backupbuddy'), 'slug' => 'database'), array('title' => __('Site Size Maps', 'it-l10n-backupbuddy'), 'slug' => 'files'), array('title' => __('WordPress Schedules (Cron)', 'it-l10n-backupbuddy'), 'slug' => 'cron')), 'width: 100%;', true, $default_tab); pb_backupbuddy::$ui->start_tab('server'); require_once 'server_info/server.php'; require_once 'server_info/permissions.php'; $wp_upload_dir = wp_upload_dir(); $wp_settings = array(); if (isset($wp_upload_dir['path'])) { $wp_settings[] = array('Upload File Path', $wp_upload_dir['path'], 'wp_upload_dir()'); }
public static function manage($destination_settings, $destination_id = '') { if (false === ($destination = self::_init_destination($destination_settings))) { echo '{Error #546893498ad. Destination configuration file missing.}'; return false; } $destination_settings = array_merge(self::$_destination_info_defaults, $destination['settings']); // Noramlize defaults. $destination_info = $destination['info']; if ('0' != $destination_settings['disable_file_management']) { _e('Remote file management has been disabled for this destination. Its files cannot be viewed & managed from within BackupBuddy. To re-enable you must create a new destination.', 'it-l10n-backupbuddy'); return false; } $manage_file = pb_backupbuddy::plugin_path() . '/destinations/' . $destination_settings['type'] . '/_manage.php'; if (file_exists($manage_file)) { $destination =& $destination_settings; require $manage_file; // Incoming variables available to manage file: $destination pb_backupbuddy::load_script('common'); // Needed for table 'select all' feature. return true; } else { _e('Files stored at this destination cannot be viewed within BackupBuddy.', 'it-l10n-backupbuddy'); return false; } }
<?php // This file is automatically loaded for the getting started page as a `template` of sorts. // The individual plugin getting started page is included from this. // Set up supporting scripts and styles. pb_backupbuddy::load_script('dashboard'); pb_backupbuddy::load_style('dashboard'); pb_backupbuddy::load_script('jquery-ui-tabs'); ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#pluginbuddy-tabs').tabs(); }); </script> <?php //echo '<div style="float: right; width: 20%; margin-right: 30px; margin-left: 10px; margin-top: 60px;"><br><br>'; echo '<table width="100%"><tr><td valign="top" style="width: 80%;">'; if (pb_backupbuddy::settings('series') != '') { // SERIES pb_backupbuddy::$ui->title('Getting Started with ' . pb_backupbuddy::settings('series')); ?> <div id="pluginbuddy-tabs" style="width: 70%;"> <ul> <?php global $pluginbuddy_series; $i = 0; foreach ($pluginbuddy_series[pb_backupbuddy::settings('series')] as $slug => $data) { $i++; echo '<li type="disc"><a href="#pluginbuddy-tabs-' . $i . '"><span>' . $data['name'] . '</span></a></li>'; } ?>
<?php pb_backupbuddy::load_script('rollbackEvents.js'); pb_backupbuddy::$ui->title(__('Database Rollback', 'it-l10n-backupbuddy') . ' <a style="font-size: 0.6em;" href="#" onClick="jQuery(\'#pb_backupbuddy_status_wrap\').toggle();">Display Status Log</a>'); ?> <script> function pb_status_undourl( undo_url ) { if ( '' == undo_url ) { jQuery( '#pb_backupbuddy_undourl' ).parent('#message').slideUp(); return; } jQuery( '#pb_backupbuddy_undourl' ).attr( 'href', undo_url ); jQuery( '#pb_backupbuddy_undourl' ).text( undo_url ); jQuery( '#pb_backupbuddy_undourl' ).parent('#message').slideDown(); } </script> <style> #pb_backupbuddy_status_wrap { display: none; margin-bottom: 10px; } </style> <?php global $wp_version; echo '<div id="pb_backupbuddy_status_wrap">'; echo pb_backupbuddy::status_box('Starting rollback process with BackupBuddy v' . pb_backupbuddy::settings('version') . ' using WordPress v' . $wp_version . ' on ' . PHP_OS . '...');
$deployData['destination_id'] = pb_backupbuddy::_POST('destination_id'); if ('push' == pb_backupbuddy::_GET('direction')) { $post_backup_steps = array(array('function' => 'deploy_push_start', 'args' => array($deployData), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0)); pb_backupbuddy::status('details', 'Deployment PUSH set to send to remote destination `' . $deployData['destination_id'] . '`. Added to post backup function steps.'); } // end if PUSH type deployment. if ('pull' == pb_backupbuddy::_GET('direction')) { $post_backup_steps = array(array('function' => 'deploy_pull_start', 'args' => array($deployData), 'start_time' => 0, 'finish_time' => 0, 'attempts' => 0)); pb_backupbuddy::status('details', 'Deployment PULL set to send to remote destination `' . $deployData['destination_id'] . '`. Added to post backup function steps.'); } // end if PULL type deployment. } // end if deployment. $deployDestination = null; if (isset($deployData['destination'])) { $deployDestination = $deployData['destination']; } pb_backupbuddy::load_script('backupEvents.js'); pb_backupbuddy::load_script('backupPerform.js'); // Run the backup! pb_backupbuddy::flush(); // Flush any buffer to screen just before the backup begins. if ($newBackup->start_backup_process($profile_array, $trigger, array(), $post_backup_steps, '', $serial_override, $export_plugins, pb_backupbuddy::_GET('direction'), $deployDestination) !== true) { pb_backupbuddy::alert(__('Fatal Error #4344443: Backup failure. Please see any errors listed in the Status Log for details.', 'it-l10n-backupbuddy'), true); } ?> </div>
function ajax_header($js = true, $padding = true) { echo '<head>'; echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'; echo '<title>PluginBuddy</title>'; wp_print_styles('wp-admin'); wp_print_styles('dashicons'); wp_print_styles('buttons'); wp_print_styles('colors'); if ($js === true) { wp_enqueue_script('jquery'); wp_print_scripts('jquery'); } pb_backupbuddy::load_style('wp-admin.css'); pb_backupbuddy::load_style('thickboxed.css'); //echo '<link rel="stylesheet" href="' . pb_backupbuddy::plugin_url(); . '/css/admin.css" type="text/css" media="all" />'; pb_backupbuddy::load_script('admin.js', true); pb_backupbuddy::load_style('admin.css', true); pb_backupbuddy::load_script('tooltip.js', true); echo '<body class="wp-core-ui" style="background: inherit;">'; if ($padding === true) { echo '<div style="padding: 8px; padding-left: 0; padding-right: 0;">'; } else { echo '<div>'; } }
<?php backupbuddy_core::verifyAjaxAccess(); require_once pb_backupbuddy::plugin_path() . '/destinations/bootstrap.php'; pb_backupbuddy::$ui->ajax_header(); pb_backupbuddy::load_style('admin.js'); pb_backupbuddy::load_style('admin'); pb_backupbuddy::load_style('destination_picker.css'); pb_backupbuddy::load_script('jquery'); pb_backupbuddy::load_script('jquery-ui-core'); pb_backupbuddy::load_script('jquery-ui-widget'); pb_backupbuddy::load_style('backupProcess.css'); pb_backupbuddy::load_style('backupProcess2.css'); $default_tab = 0; if (is_numeric(pb_backupbuddy::_GET('tab'))) { $default_tab = pb_backupbuddy::_GET('tab'); } // Destinations may hide the add and test buttons by altering these variables. global $pb_hide_save; global $pb_hide_test; $pb_hide_save = false; $pb_hide_test = false; $mode = 'destination'; if ('' != pb_backupbuddy::_GET('alert_notice')) { pb_backupbuddy::alert(htmlentities(pb_backupbuddy::_GET('alert_notice'))); echo '<br>'; } if ($mode == 'migration') { $picker_url = pb_backupbuddy::ajax_url('migration_picker'); } else { $picker_url = pb_backupbuddy::ajax_url('destinationTabs');
public function get($name, $css = '', $classes = '', $orientation = 'horizontal') { if ($this->_ended === true) { // Form already closed and ended. Fatal problem. return '{Error: Form already closed with end function so cannot add more fields. Only end in view after all displays are done.}'; } if (isset($this->_inputs[$name])) { $prefix = $this->_prefix; if ($this->_started === false) { // Form output has not started. Start it. $return = $this->start(); } else { $return = ''; } $input =& $this->_inputs[$name]; if ($css != '') { $css = ' style="' . $css . '"'; } /********** TEXT **********/ if ($input['type'] == 'text') { $return .= '<input type="text" class="' . $classes . '" name="' . $prefix . $name . '" value="' . $input['value'] . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; /********** PLAINTEXT **********/ } elseif ($input['type'] == 'plaintext') { $return .= '<span class="' . $classes . '" ' . $css . '>' . $input['value'] . '</span>'; /********** COLOR **********/ } elseif ($input['type'] == 'color') { // TODO: this actually should only run once per PAGE load. add a function is_script and is_style into framework to see if loaded into framework yet or not. if ($this->_loaded_color === false) { // Only load the javascript, CSS, etc once per instance. pb_backupbuddy::load_script('jquery.miniColors.min.js', true); pb_backupbuddy::load_style('jquery.miniColors.css', true); echo '<script type="text/javascript"> jQuery(document).ready( function() { jQuery( ".pb_colorpicker" ).miniColors({ letterCase: "uppercase" }); }); </script> <style type="text/css"> .miniColors-trigger { background: url( ' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/minicolors/trigger.png ) center no-repeat; } .miniColors-colors { background: url( ' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/minicolors/gradient.png ) center no-repeat; } .miniColors-hues { background: url( ' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/minicolors/rainbow.png ) center no-repeat; } .miniColors-colorPicker { background: url( ' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/minicolors/circle.gif ) center no-repeat; } .miniColors-huePicker { background: url( ' . pb_backupbuddy::plugin_url() . '/pluginbuddy/images/minicolors/line.gif ) center no-repeat; } </style>'; $this->_loaded_color = true; } if ($css == '') { // default width. $css = ' style="width: 60px;"'; } $return .= '<input class="pb_colorpicker ' . $classes . '" type="text" name="' . $prefix . $name . '" value="' . $input['value'] . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; /********** HIDDEN **********/ } elseif ($input['type'] == 'hidden') { $return .= '<input type="hidden" name="' . $prefix . $name . '" value="' . $input['value'] . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; /********** WYSIWYG **********/ } elseif ($input['type'] == 'wysiwyg') { $wysiwyg_settings = array_merge($input['settings'], array('textarea_name' => $prefix . $name)); //$return .= '<input type="text" name="' . . '" value="' . . '" id="' . $prefix . $name . '"' . $css . '>'; ob_start(); wp_editor($input['value'], $prefix . $name, $wysiwyg_settings); $return .= ob_get_contents(); ob_end_clean(); /********** TITLE **********/ } elseif ($input['type'] == 'title') { // All handled by settings class currently. Showing in the th not the td. //$return .= '<h4 id="' . $prefix . $name . '"' . $css . '>' . $input['value'] . '</h4>'; /********** TEXTAREA **********/ } elseif ($input['type'] == 'textarea') { $return .= '<textarea name="' . $prefix . $name . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>' . $input['value'] . '</textarea>'; /********** PASSWORD **********/ } elseif ($input['type'] == 'password') { $return .= '<input type="password" name="' . $prefix . $name . '" value="' . $input['value'] . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; /********** SELECT **********/ } elseif ($input['type'] == 'select') { $return .= '<select name="' . $prefix . $name . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; foreach ($input['options'] as $option_value => $option_title) { $return .= '<option value="' . $option_value . '"'; if ($option_value == $input['value']) { $return .= ' selected="selected"'; } $return .= '>' . $option_title . '</option>'; } $return .= '</select>'; /********** RADIO **********/ } elseif ($input['type'] == 'radio') { $return .= '<input type="hidden" name="' . $prefix . $name . '" value="">'; // default if no radio checked $i = 0; foreach ($input['options'] as $option_value => $option_title) { $i++; $return .= '<input type="radio" name="' . $prefix . $name . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '" value="' . $option_value . '"' . $css; if ($option_value == $input['value']) { // Check if this item is selected. $return .= ' checked="checked"'; } $return .= '> ' . $option_title; if ($i < count($input['options'])) { // spacer between each one. if ($orientation == 'horizontal') { // Horizonal display. $return .= ' '; } else { // Vertical display. $return .= '<br>'; } } } /********** CHECKBOX **********/ } elseif ($input['type'] == 'checkbox') { $return .= '<input type="hidden" name="' . $prefix . $name . '" value="' . $input['options']['unchecked'] . '">'; $return .= '<input type="checkbox" name="' . $prefix . $name . '" class="' . $classes . '" id="' . $prefix . str_replace('#', '__', $name) . '" value="' . $input['options']['checked'] . '"' . $css; if ($input['options']['checked'] == $input['value']) { $return .= ' checked'; } $return .= '>'; // TODO: conditional to see if this needes to be default selected based on options. /********** SUBMIT **********/ } elseif ($input['type'] == 'submit') { $return .= '<input class="button-primary ' . $classes . '" type="submit" name="' . $prefix . $name . '" value="' . $input['value'] . '" id="' . $prefix . str_replace('#', '__', $name) . '"' . $css . '>'; /********** ~UNKNOWN TYPE~ **********/ } else { $return .= '{Unknown form item type: `' . $input['type'] . '`.}'; } return $return; } else { return '{Invalid form field: `' . $name . '`.}'; } }
<?php if ('save' != $mode) { // Load filetree sources if not already loaded pb_backupbuddy::load_script('filetree.js'); pb_backupbuddy::load_style('filetree.css'); ?> <script> jQuery(document).ready(function() { // Test a remote destination. jQuery( '.pb_backupbuddy_ftpdestination_pathpicker' ).click( function() { jQuery( '.pb_backupbuddy_ftpdestination_pathpickerboxtree' ).remove(); // Remove any current trees. jQuery( '.pb_backupbuddy_ftppicker_load' ).show(); var thisPickObj = jQuery(this); var pathPickerBox = thisPickObj.closest( 'form' ).find( '.pb_backupbuddy_ftpdestination_pathpickerbox' ); var serializedFormData = thisPickObj.closest( 'form' ).serialize(); // Get root FTP path. jQuery.get( '<?php echo pb_backupbuddy::ajax_url('destination_ftp_pathpicker'); ?> &' + serializedFormData, function(data) { data = jQuery.trim( data ); pathPickerBox.html( '<div class="jQueryOuterTree" style="width: 100%;">' + data + '</div>' ); pathPickerBox.slideDown(); // File picker. jQuery('.pb_backupbuddy_ftpdestination_pathpickerboxtree').fileTree(
function display() { pb_backupbuddy::load_script('jquery-ui-draggable'); pb_backupbuddy::load_script('jquery-ui-sortable'); ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery( '.pb_medialibrary_slot_<?php echo $this->_instance; ?> ' ).sortable({ opacity: 0.6, cursor: "move", revert: true, update: function(e,ui) { // Only save changes on drop IN, not pull out phase of the update. Prevents double firing and pulling out of things too early. if (this === ui.item.parent()[0]) { var this_placed_item = jQuery(ui.item); jQuery(ui.item).removeClass('pb_medialibrary_draggable'); jQuery(ui.item).addClass('pb_medialibrary_slotitem'); slot_items = new Array(); jQuery(this).children('.pb_medialibrary_slotitem').each(function(j) { slot_items.push( jQuery(this).attr('rel') ); }); jQuery('#pb_medialibrary_saving').show(); //alert( slot_items ); jQuery.ajax({ type: 'POST', url: '<?php echo pb_backupbuddy::ajax_url('media_library'); ?> &actionb=save_images_list', data: 'items=' + slot_items + '&save_point=<?php echo str_replace('\'', '\\\'', $this->_save_point); ?> &default_options_point=<?php echo str_replace('\'', '\\\'', $this->_default_options_point); ?> ', success: function(msg){ jQuery('#pb_saving').hide(); //alert( msg ); //this_placed_item.children('.loop_item_buttons').css({'display':'block'}); // Show settings icon on newly placed slot item. /* if ( msg.unique_id != 0 ) { this_placed_item.attr('id', 'pbloop-' + msg.unique_id); } */ } // , 'dataType': 'json' }); } }, start: function(e,ui) { /* New jQuery fix (new slot items do not cause over method to trigger. */ //jQuery('.loop_slot').css({'background':'transparent'}); /* New jQuery fix. Changing existing slot item keeps its slot bg colored. */ //jQuery(this).css({'background':'#EAF2FA'}); jQuery( '.pb_medialibrary_item' ).draggable( 'option', 'revert', false ); }, stop: function(e,ui) { jQuery(this).css({'background':'transparent'}); jQuery( '.pb_medialibrary_item' ).draggable( 'option', 'revert', true ); }, over: function(e,ui) { jQuery('.pb_medialibrary_item').css({'background':'transparent'}); /* New jQuery fix. Changing existing slot item keeps its slot bg colored. */ jQuery(this).css({'background':'#EAF2FA'}); jQuery( '.pb_medialibrary_item' ).draggable( 'option', 'revert', false ); }, out: function(e,ui) { jQuery(this).css({'background':'transparent'}); /* jQuery( '.loop_item' ).draggable( 'option', 'revert', true ); New jQuery fix. Prevents revert from double flying. */ } }); //jQuery( '.pb_medialib_1' ).disableSelection(); jQuery('.pb_medialibrary_draggable').draggable({ revert: true, opacity: '.9', zIndex: 15, helper: 'clone', appendTo: 'body', connectToSortable: '.pb_medialibrary_slot_<?php echo $this->_instance; ?> ' }); }); </script> <style type="text/css"> .pb_medialibrary div { display: inline-block; height: 150px; position: relative; cursor: move; } .pb_medialibrary div img { //margin: 3px; } .pb_medialibrary { max-height: 480px; overflow: scroll; } .pb_medialibrary_item { margin: 5px; text-align: center; line-height: 1.1em; } .pb_medialibrary_imgbox { display: inline-block; position: relative; //margin: 3px; cursor: move; } .pb_medialibrary_settingsbox { position: absolute; right: 0; z-index: 30; display: none; cursor: pointer; background: white; } .pb_medialibrary_settingsbox_hot { color: red; } </style> <?php pb_backupbuddy::$ui->start_metabox('Images in Group <span id="pb_medialibrary_saving" style="display: none;">Saving</span>', true, 'width: 48%; min-width: 400px; float: left;'); echo '<div class="pb_medialibrary_slot_' . $this->_instance . ' pb_medialibrary">'; $group_images =& pb_backupbuddy::get_group($this->_save_point); foreach ($group_images as $image_index => $image) { $image_dat = wp_get_attachment_image_src($image['id'], 'thumbnail'); echo '<div class="pb_medialibrary_item pb_medialibrary_slotitem" rel="' . $image['id'] . '"><img src="' . $image_dat[0] . '"></div>'; } echo '</div>'; pb_backupbuddy::$ui->end_metabox(); pb_backupbuddy::$ui->start_metabox('WordPress Media Library', true, 'width: 48%; min-width: 400px; float: right;'); ?> <div class="pb_medialibrary"> <?php global $wpdb; $result = mysql_query("SELECT ID,post_title FROM {$wpdb->prefix}posts WHERE post_type='attachment'"); while ($rs = mysql_fetch_assoc($result)) { //echo '<pre>' . print_r( $rs, true ) . '</pre>'; $image_dat = wp_get_attachment_image_src($rs['ID'], 'thumbnail'); //echo '<pre>' . print_r( \wp_get_attachment_metadata( $rs['ID'] ) , true ) . '</pre>'; //echo '<pre>' . print_r( $image_dat, true ) . '</pre>'; echo '<div class="pb_medialibrary_item pb_medialibrary_draggable" rel="' . $rs['ID'] . '"><span class="pb_medialibrary_settingsbox">Settings</span><img class="pb_medialibrary_lazy" data-original="' . $image_dat[0] . '" src="" title="' . $rs['post_title'] . '"></div>'; } unset($result); ?> </div> <?php pb_backupbuddy::$ui->end_metabox(); }