<?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();
function quickstart() { pb_backupbuddy::$ui->ajax_header(); pb_backupbuddy::load_style('thickboxed.css'); require_once pb_backupbuddy::plugin_path() . '/views/_quicksetup.php'; pb_backupbuddy::$ui->ajax_footer(); die; }
<?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 if (!is_admin()) { die('Access denied.'); } pb_backupbuddy::$ui->ajax_header(); pb_backupbuddy::load_style('thickboxed.css'); require_once pb_backupbuddy::plugin_path() . '/views/_quicksetup.php'; pb_backupbuddy::$ui->ajax_footer(); die;
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 . '`.}'; } }
<?php // $mode is defined prior to this file load as either destination or migration. if ($mode == 'migration') { $picker_url = pb_backupbuddy::ajax_url('migration_picker'); } else { $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'; ?>
<?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>
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 . '`.}'; } }
<!DOCTYPE html> <!--[if IE 8]> <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> ?>
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>'; } }
<?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('nprogress.js'); pb_backupbuddy::load_script('importbuddy.js'); // Tutorial pb_backupbuddy::load_script('jquery.joyride-2.0.3.js'); pb_backupbuddy::load_script('modernizr.mq.js'); pb_backupbuddy::load_style('joyride.css'); pb_backupbuddy::load_style('nprogress.css');
<?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.' );
<?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 if (!current_user_can(pb_backupbuddy::$options['role_access'])) { die('Access Denied. Error 445543454754.'); } wp_enqueue_script('thickbox'); wp_print_scripts('thickbox'); wp_print_styles('thickbox'); // Handles thickbox auto-resizing. Keep at bottom of page to avoid issues. if (!wp_script_is('media-upload')) { wp_enqueue_script('media-upload'); wp_print_scripts('media-upload'); } pb_backupbuddy::load_style('quicksetup.css'); ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery( '#pb_backupbuddy_quickstart_password, #pb_backupbuddy_quickstart_passwordconfirm' ).keyup( function() { if ( ( jQuery( '#pb_backupbuddy_quickstart_password' ).val() != '' ) && ( jQuery( '#pb_backupbuddy_quickstart_password' ).val() == jQuery( '#pb_backupbuddy_quickstart_passwordconfirm' ).val() ) ) { jQuery( '#pb_backupbuddy_quickstart_password_check_fail,#pb_backupbuddy_quickstart_password_check_fail > img' ).hide(); jQuery( '#pb_backupbuddy_quickstart_password_check' ).show(); } else { jQuery( '#pb_backupbuddy_quickstart_password_check' ).hide(); if ( ( jQuery( '#pb_backupbuddy_quickstart_password' ).val() != '' ) || ( jQuery( '#pb_backupbuddy_quickstart_passwordconfirm' ).val() != '' ) ) { // Mismatch non-blank. jQuery( '#pb_backupbuddy_quickstart_password_check_fail,#pb_backupbuddy_quickstart_password_check_fail > img' ).show(); } else if ( ( jQuery( '#pb_backupbuddy_quickstart_password' ).val() == '' ) && ( jQuery( '#pb_backupbuddy_quickstart_passwordconfirm' ).val() == '' ) ) { // both blank jQuery( '#pb_backupbuddy_quickstart_password_check_fail,#pb_backupbuddy_quickstart_password_check_fail > img' ).hide(); }
<?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.
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(
<?php /* BackupBuddy Stash Live Setup & Configuration -- shown on first run * * @author Dustin Bolton * @since 7.0 * */ pb_backupbuddy::$ui->title(__('BackupBuddy Stash Live', 'it-l10n-backupbuddy')); pb_backupbuddy::load_style('backupbuddy_live.css'); require_once pb_backupbuddy::plugin_path() . '/destinations/live/init.php'; if ('' != pb_backupbuddy::$options['email_notify_scheduled_complete']) { $email = pb_backupbuddy::$options['email_notify_scheduled_complete']; } elseif ('' != pb_backupbuddy::$options['email_notify_error']) { $email = pb_backupbuddy::$options['email_notify_error']; } elseif ('' != get_option('admin_email')) { $email = get_option('admin_email'); } else { $email = ''; } ?> <script> jQuery(document).ready(function() { jQuery( '.backupbuddy_live_setup_form' ).submit( function(e) { e.preventDefault(); backupbuddy_loading_spinner = setTimeout( function(){ jQuery( '.pb_backupbuddy_destpicker_saveload' ).show() }, 500 ); jQuery.post( '<?php echo pb_backupbuddy::ajax_url('live_setup'); ?>