本文整理汇总了PHP中pb_backupbuddy::tip方法的典型用法代码示例。如果您正苦于以下问题:PHP pb_backupbuddy::tip方法的具体用法?PHP pb_backupbuddy::tip怎么用?PHP pb_backupbuddy::tip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pb_backupbuddy
的用法示例。
在下文中一共展示了pb_backupbuddy::tip方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _e
<table class="form-table">
<tr>
<td><label for="title"><?php
_e('Destination Name', 'it-l10n-backupbuddy');
pb_backupbuddy::tip(__('Name of the new destination to create. This is for your convenience only.', 'it-l10n-backupbuddy'));
?>
</label></td>
<td><input type="text" name="#title" id="title" size="45" maxlength="45" value="<?php
echo $options['title'];
?>
" /></td>
</tr>
<tr>
<td><label for="email"><?php
_e('Email', 'it-l10n-backupbuddy');
pb_backupbuddy::tip(__('[Example: your@email.com] - Email address for this destination.', 'it-l10n-backupbuddy'));
?>
</label></td>
<td><input type="text" name="#email" id="email" size="45" maxlength="255" value="<?php
echo $options['email'];
?>
" /></td>
</tr>
</table>
<?php
if (isset($_GET['edit']) && $_GET['edit'] != '' && $_GET['type'] == 'email') {
echo '<p class="submit"><input type="submit" name="edit_destination" value="', __('Save Changes', 'it-l10n-backupbuddy'), '" class="button-primary" /></p>';
} else {
echo '<p class="submit"><input type="submit" name="add_destination" value="+ ', __('Add Destination', 'it-l10n-backupbuddy'), '" class="button-primary" /></p>';
}
示例2: backups_list
//.........这里部分代码省略.........
$pretty_status = array('pass' => 'Good', 'fail' => '<font color="red">Bad</font>');
$pretty_type = array('full' => 'Full', 'db' => 'Database');
//echo '<pre>' . print_r( pb_backupbuddy::$options['backups'][$serial], true ) . '</pre>';
// Calculate time for each step.
$step_times = array();
$step_time_details = array();
$zip_time = 0;
if (isset(pb_backupbuddy::$options['backups'][$serial]['steps'])) {
foreach (pb_backupbuddy::$options['backups'][$serial]['steps'] as $step) {
if (!isset($step['finish_time']) || $step['finish_time'] == 0) {
$step_times[] = '<span class="description">Unknown</span>';
} else {
$step_time = $step['finish_time'] - $step['start_time'];
$step_times[] = $step_time;
// Pretty step name:
if ($step['function'] == 'backup_create_database_dump') {
$step_name = 'Database dump';
} elseif ($step['function'] == 'backup_zip_files') {
$step_name = 'Zip archive creation';
} elseif ($step['function'] == 'post_backup') {
$step_name = 'Post-backup cleanup';
} else {
$step_name = $step['function'];
}
$step_time_details[] = '<b>' . $step_name . '</b><br> ' . $step_time . ' seconds in ' . $step['attempts'] . ' attempts.';
if ($step['function'] == 'backup_zip_files') {
$zip_time = $step_time;
}
}
}
// End foreach.
} else {
// End if serial in array is set.
$step_times[] = '<span class="description">Unknown</span>';
}
// End if serial in array is NOT set.
$step_times = implode(', ', $step_times);
//echo '<pre>' . print_r( pb_backupbuddy::$options['backups'][$serial], true ) . '</pre>';
// Calculate start and finish.
if (isset(pb_backupbuddy::$options['backups'][$serial]['start_time']) && isset(pb_backupbuddy::$options['backups'][$serial]['finish_time']) && pb_backupbuddy::$options['backups'][$serial]['start_time'] > 0 && pb_backupbuddy::$options['backups'][$serial]['finish_time'] > 0) {
$start_time = pb_backupbuddy::$options['backups'][$serial]['start_time'];
$finish_time = pb_backupbuddy::$options['backups'][$serial]['finish_time'];
$total_time = $finish_time - $start_time;
} else {
$total_time = '<span class="description">Unknown</span>';
}
// Calculate write speed in MB/sec for this backup.
if ($zip_time == '0') {
// Took approx 0 seconds to backup so report this speed.
if (!isset($finish_time) || $finish_time == '0') {
$write_speed = '<span class="description">Unknown</span>';
} else {
$write_speed = '> ' . pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size']);
}
} else {
$write_speed = pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size'] / $zip_time);
}
// Figure out trigger.
if (isset(pb_backupbuddy::$options['backups'][$serial]['trigger'])) {
$trigger = pb_backupbuddy::$options['backups'][$serial]['trigger'];
} else {
$trigger = __('Unknown', 'it-l10n-backupbuddy');
}
// HTML output for stats.
$statistics = "\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Total time:</span>{$total_time} secs<br>\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Step times:</span>{$step_times}<br>\n\t\t\t\t\t<span style='width: 80px; display: inline-block;'>Write speed:</span>{$write_speed}/sec\n\t\t\t\t";
// HTML output for stats details (for tooltip).
$statistic_details = '<br><br>' . implode('<br>', $step_time_details) . '<br><br><i>Trigger: ' . $trigger . '</i>';
// Calculate time ago.
$time_ago = '<span class="description">' . pb_backupbuddy::$format->time_ago(pb_backupbuddy::$options['backups'][$serial]['integrity']['modified']) . ' ago</span>';
// Calculate main row string.
if ($type == 'default') {
// Default backup listing.
$main_string = '<a href="' . pb_backupbuddy::ajax_url('download_archive') . '&backupbuddy_backup=' . basename($file) . '">' . basename($file) . '</a>';
} elseif ($type == 'migrate') {
// Migration backup listing.
$main_string = '<a class="pb_backupbuddy_hoveraction_migrate" rel="' . basename($file) . '" href="' . pb_backupbuddy::page_url() . '&migrate=' . basename($file) . '&value=' . basename($file) . '">' . basename($file) . '</a>';
} else {
$main_string = '{Unknown type.}';
}
// Add comment to main row string if applicable.
if (isset(pb_backupbuddy::$options['backups'][$serial]['integrity']['comment']) && pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] !== false && pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] !== '') {
$main_string .= '<br><span class="description">Note: <span class="pb_backupbuddy_notetext">' . pb_backupbuddy::$options['backups'][$serial]['integrity']['comment'] . '</span></span>';
}
$backups[basename($file)] = array(array(basename($file), $main_string), pb_backupbuddy::$format->date(pb_backupbuddy::$options['backups'][$serial]['integrity']['modified']) . '<br>' . $time_ago, pb_backupbuddy::$format->file_size(pb_backupbuddy::$options['backups'][$serial]['integrity']['size']), pb_backupbuddy::$format->prettify(pb_backupbuddy::$options['backups'][$serial]['integrity']['status'], $pretty_status) . ' ' . pb_backupbuddy::tip(pb_backupbuddy::$options['backups'][$serial]['integrity']['status_details'] . '<br><br>Checked ' . pb_backupbuddy::$format->date(pb_backupbuddy::$options['backups'][$serial]['integrity']['scan_time']) . $statistic_details, '', false) . ' <a href="' . pb_backupbuddy::page_url() . '&reset_integrity=' . $serial . '" title="' . __('Refresh backup integrity status for this file', 'it-l10n-backupbuddy') . '"><img src="' . pb_backupbuddy::plugin_url() . '/images/refresh_gray.gif" style="vertical-align: -1px;"></a>', pb_backupbuddy::$format->prettify(pb_backupbuddy::$options['backups'][$serial]['integrity']['detected_type'], $pretty_type), $statistics);
$backup_sort_dates[basename($file)] = pb_backupbuddy::$options['backups'][$serial]['integrity']['modified'];
}
// End foreach().
}
// End if.
// Sort backup sizes.
arsort($backup_sort_dates);
// Re-arrange backups based on sort dates.
$sorted_backups = array();
foreach ($backup_sort_dates as $backup_file => $backup_sort_date) {
$sorted_backups[$backup_file] = $backups[$backup_file];
unset($backups[$backup_file]);
}
unset($backups);
return $sorted_backups;
}
示例3: __
$hover_actions['migrate'] = __('Migrate', 'it-l10n-backupbuddy');
$hover_actions['note'] = __('Note', 'it-l10n-backupbuddy');
$bulk_actions = array();
/*
foreach( $backups as $backup_id => $backup ) {
if ( $backup[1] == 'Database' ) {
unset( $backups[$backup_id] );
}
}
*/
}
if (count($backups) == 0) {
_e('No backups have been created yet.', 'it-l10n-backupbuddy');
echo '<br>';
} else {
$columns = array(__('Backups', 'it-l10n-backupbuddy') . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', __('Type', 'it-l10n-backupbuddy') . ' | ' . __('Profile', 'it-l10n-backupbuddy'), __('File Size', 'it-l10n-backupbuddy'), __('Status', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Backups are checked to verify that they are valid BackupBuddy backups and contain all of the key backup components needed to restore. Backups may display as invalid until they are completed. Click the refresh icon to re-verify the archive.', 'it-l10n-backupbuddy'), '', false));
// Remove some columns for migration mode.
/*
if ( $listing_mode != 'default' ) {
foreach( $backups as &$backup ) {
unset( $backup[1] ); // Remove backup type (only full shows for migration).
$backup = array_values( $backup );
}
$backups = array_values( $backups );
unset( $columns[1] );
$columns = array_values( $columns );
}
示例4: str_pad
echo '<tr>';
}
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo str_pad(pb_backupbuddy::$format->file_size($item[0]), 10, ' ', STR_PAD_RIGHT) . "\t" . str_pad($excluded_size, 10, ' ', STR_PAD_RIGHT) . "\t" . $id . "\n";
} else {
echo '<td>' . $id . '</td><td>' . pb_backupbuddy::$format->file_size($item[0]) . '</td><td>' . $excluded_size . '</td></tr>';
}
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo str_pad(pb_backupbuddy::$format->file_size($total_size), 10, ' ', STR_PAD_RIGHT) . "\t" . str_pad(pb_backupbuddy::$format->file_size($total_size_excluded), 10, ' ', STR_PAD_RIGHT) . "\t" . __('TOTALS', 'it-l10n-backupbuddy') . "\n";
} else {
echo '<tr><td align="right"><b>' . __('TOTALS', 'it-l10n-backupbuddy') . ':</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size) . '</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size_excluded) . '</b></td></tr>';
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo "\n\nEXCLUSIONS (" . count($exclusions) . "):" . "\n" . implode("\n", $exclusions);
echo '</textarea>';
pb_backupbuddy::$ui->ajax_footer();
} else {
echo '</tbody>';
echo '</table>';
echo '<br>';
echo 'Exclusions (' . count($exclusions) . ')';
pb_backupbuddy::tip('List of directories that will be excluded in an actual backup. This includes user-defined directories and BackupBuddy directories such as the archive directory and temporary directories.');
echo '<div id="pb_backupbuddy_serverinfo_exclusions" style="background-color: #EEEEEE; padding: 4px; float: right; white-space: nowrap; height: 90px; width: 70%; min-width: 400px; overflow: auto;"><i>' . implode("<br>", $exclusions) . '</i></div>';
echo '<br style="clear: both;">';
echo '<br><br><center>';
echo '<a href="' . pb_backupbuddy::ajax_url('site_size_listing') . '&text=true&TB_iframe=1&width=640&height=600" class="thickbox button secondary-button">' . __('Display Directory Size Listing in Text Format', 'it-l10n-backupbuddy') . '</a>';
echo '</center>';
}
die;
示例5: mode
<input type="hidden" name="advanced_options[ignore_sql_errors]" value="false">
<input type="checkbox" name="advanced_options[ignore_sql_errors]" value="true" /> Ignore SQL errors & hide them. <br>
<input type="hidden" name="advanced_options[skip_database_import]" value="false">
<input type="checkbox" name="advanced_options[skip_database_import]" value="true" /> Skip import of database. <br>
<input type="hidden" name="advanced_options[skip_database_migration]" value="false">
<input type="checkbox" name="advanced_options[skip_database_migration]" value="true" /> Skip migration of database. <br>
<input type="hidden" name="advanced_options[force_compatibility_medium]" value="false">
<input type="checkbox" name="advanced_options[force_compatibility_medium]" value="true" /> Force medium speed compatibility mode (ZipArchive). <br>
<input type="hidden" name="advanced_options[force_compatibility_slow]" value="false">
<input type="checkbox" name="advanced_options[force_compatibility_slow]" value="true" /> Force slow speed compatibility mode (PCLZip). <br>
<br>
PHP Maximum Execution Time: <input type="text" name="advanced_options[max_execution_time]" value="<?php
echo $this->detected_max_execution_time;
?>
" size="5"> seconds. <?php
pb_backupbuddy::tip('The maximum allowed PHP runtime. If your database import step is timing out then lowering this value will instruct the script to limit each `chunk` to allow it to finish within this time period.');
?>
</div>
</td>
</tr>
</table>
<?php
submit_button(__('Next Step') . ' »', 'primary', 'add-site');
?>
</form>
示例6: site_size_listing
//.........这里部分代码省略.........
if (0 == $result) {
pb_backupbuddy::alert('Error #5656653. Unable to access directory map listing for directory `' . ABSPATH . '`.');
die;
}
$total_size = pb_backupbuddy::$options['stats']['site_size'] = $result[0];
$total_size_excluded = pb_backupbuddy::$options['stats']['site_size_excluded'] = $result[1];
pb_backupbuddy::$options['stats']['site_size_updated'] = time();
pb_backupbuddy::save();
arsort($dir_array);
if (pb_backupbuddy::_GET('text') == 'true') {
pb_backupbuddy::$ui->ajax_header();
echo '<h3>' . __('Site Size Listing & Exclusions', 'it-l10n-backupbuddy') . '</h3>';
echo '<textarea style="width:100%; height: 300px; font-family: monospace;" wrap="off">';
echo __('Size + Children', 'it-l10n-backupbuddy') . "\t";
echo __('- Exclusions', 'it-l10n-backupbuddy') . "\t";
echo __('Directory', 'it-l10n-backupbuddy') . "\n";
} else {
?>
<style>
.backupbuddy_sizemap_table th {
white-space: nowrap;
}
.backupbuddy_sizemap_table td {
word-break: break-all;
}
</style>
<table class="widefat backupbuddy_sizemap_table">
<thead>
<tr class="thead">
<?php
echo '<th>', __('Directory', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Children', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Exclusions', 'it-l10n-backupbuddy'), '<br><span class="description">Global defaults profile</span></th>';
?>
</tr>
</thead>
<tfoot>
<tr class="thead">
<?php
echo '<th>', __('Directory', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Children', 'it-l10n-backupbuddy'), '</th>', '<th>', __('Size with Exclusions', 'it-l10n-backupbuddy'), '<br><span class="description">Global defaults profile</span></th>';
?>
</tr>
</tfoot>
<tbody>
<?php
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo str_pad(pb_backupbuddy::$format->file_size($total_size), 10, ' ', STR_PAD_RIGHT) . "\t" . str_pad(pb_backupbuddy::$format->file_size($total_size_excluded), 10, ' ', STR_PAD_RIGHT) . "\t" . __('TOTALS', 'it-l10n-backupbuddy') . "\n";
} else {
echo '<tr><td align="right"><b>' . __('TOTALS', 'it-l10n-backupbuddy') . ':</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size) . '</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size_excluded) . '</b></td></tr>';
}
$item_count = 0;
foreach ($dir_array as $id => $item) {
// Each $item is in format array( TOTAL_SIZE, TOTAL_SIZE_TAKING_EXCLUSIONS_INTO_ACCOUNT );
$item_count++;
if ($item_count > 100) {
flush();
$item_count = 0;
}
if ($item[1] === false) {
if (pb_backupbuddy::_GET('text') == 'true') {
$excluded_size = 'EXCLUDED';
echo '**';
} else {
$excluded_size = '<span class="pb_label pb_label-important">Excluded</span>';
echo '<tr style="background: #fcc9c9;">';
}
} else {
$excluded_size = pb_backupbuddy::$format->file_size($item[1]);
if (pb_backupbuddy::_GET('text') != 'true') {
echo '<tr>';
}
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo str_pad(pb_backupbuddy::$format->file_size($item[0]), 10, ' ', STR_PAD_RIGHT) . "\t" . str_pad($excluded_size, 10, ' ', STR_PAD_RIGHT) . "\t" . $id . "\n";
} else {
echo '<td>' . $id . '</td><td>' . pb_backupbuddy::$format->file_size($item[0]) . '</td><td>' . $excluded_size . '</td></tr>';
}
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo str_pad(pb_backupbuddy::$format->file_size($total_size), 10, ' ', STR_PAD_RIGHT) . "\t" . str_pad(pb_backupbuddy::$format->file_size($total_size_excluded), 10, ' ', STR_PAD_RIGHT) . "\t" . __('TOTALS', 'it-l10n-backupbuddy') . "\n";
} else {
echo '<tr><td align="right"><b>' . __('TOTALS', 'it-l10n-backupbuddy') . ':</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size) . '</b></td><td><b>' . pb_backupbuddy::$format->file_size($total_size_excluded) . '</b></td></tr>';
}
if (pb_backupbuddy::_GET('text') == 'true') {
echo "\n\nEXCLUSIONS (" . count($exclusions) . "):" . "\n" . implode("\n", $exclusions);
echo '</textarea>';
pb_backupbuddy::$ui->ajax_footer();
} else {
echo '</tbody>';
echo '</table>';
echo '<br>';
echo 'Exclusions (' . count($exclusions) . ')';
pb_backupbuddy::tip('List of directories that will be excluded in an actual backup. This includes user-defined directories and BackupBuddy directories such as the archive directory and temporary directories.');
echo '<div id="pb_backupbuddy_serverinfo_exclusions" style="background-color: #EEEEEE; padding: 4px; float: right; white-space: nowrap; height: 90px; width: 70%; min-width: 400px; overflow: auto;"><i>' . implode("<br>", $exclusions) . '</i></div>';
echo '<br style="clear: both;">';
echo '<br><br><center>';
echo '<a href="' . pb_backupbuddy::ajax_url('site_size_listing') . '&text=true&TB_iframe=1&width=640&height=600" class="thickbox button secondary-button">' . __('Display Directory Size Listing in Text Format', 'it-l10n-backupbuddy') . '</a>';
echo '</center>';
}
die;
}
示例7: __
'name' => 'title_exclusions',
'title' => __( 'Directory Exclusions', 'it-l10n-backupbuddy' ) . ' ' . pb_backupbuddy::video( 'PmXLw_tS42Q#94', __('Backup Directory Excluding Tutorial', 'it-l10n-backupbuddy' ), false ),
) );
$settings_form->add_setting( array(
'type' => 'textarea',
'name' => 'excludes',
'title' => 'Click directories to navigate or click <img src="' . pb_backupbuddy::plugin_url() .'/images/bullet_delete.png" style="vertical-align: -3px;"> to exclude.' . ' ' .
pb_backupbuddy::tip( __('Click on a directory name to navigate directories. Click the red minus sign to the right of a directory to place it in the exclusion list. /wp-content/, /wp-content/uploads/, and BackupBuddy backup & temporary directories cannot be excluded. BackupBuddy directories are automatically excluded.', 'it-l10n-backupbuddy' ), '', false ) .
'<br><div id="exlude_dirs" class="jQueryOuterTree"></div>' .
'<span class="description">' . __( 'Available if server does not require compatibility mode.', 'it-l10n-backupbuddy' ) . '</span>' .
pb_backupbuddy::tip( __('If you receive notifications that your server is entering compatibility mode or that native zip functionality is unavailable then this feature will not be available due to technical limitations of the compatibility mode. Ask your host to correct the problems causing compatibility mode or move to a new server.', 'it-l10n-backupbuddy' ), '', false ),
//'tip' => ,
'rules' => 'string[0-9000]',
'css' => 'width: 100%; height: 103px;',
'before' => __('Excluded directories (relative to WordPress installation directory)' , 'it-l10n-backupbuddy' ) . pb_backupbuddy::tip( __('List paths relative to the WordPress installation directory to be excluded from backups. You may use the directory selector to the left to easily exclude directories by ctrl+clicking them. Paths are relative to root, for example: /wp-content/uploads/junk/', 'it-l10n-backupbuddy' ), '', false ) . '<br>',
'after' => '<span class="description">' . __( 'One directory exclusion per line. This may be manually edited.', 'it-l10n-backupbuddy' ) . '</span>',
) );
$settings_form->add_setting( array(
'type' => 'title',
'name' => 'title_troubleshooting',
'title' => __( 'Troubleshooting & Compatibility', 'it-l10n-backupbuddy' ) . ' ' . pb_backupbuddy::video( 'PmXLw_tS42Q#108', __('Troubleshooting options', 'it-l10n-backupbuddy' ), false ),
) );
$settings_form->add_setting( array(
'type' => 'checkbox',
'name' => 'lock_archives_directory',
'options' => array( 'unchecked' => '0', 'checked' => '1' ),
'title' => __( 'Lock archive directory (high security)', 'it-l10n-backupbuddy' ),
示例8: foreach
if ($listing_mode == 'migrate') {
$hover_actions['migrate'] = 'Migrate this backup';
$hover_actions[pb_backupbuddy::ajax_url('download_archive') . '&backupbuddy_backup='] = 'Download file';
$hover_actions['hash'] = 'Get hash';
$hover_actions['note'] = 'Note';
foreach ($backups as $backup_id => $backup) {
if ($backup[1] == 'Database') {
unset($backups[$backup_id]);
}
}
}
if (count($backups) == 0) {
_e('No backups have been created yet.', 'it-l10n-backupbuddy');
echo '<br>';
} else {
$columns = array(__('Backup File', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Files include random characters in their name for increased security. Verify that write permissions are available for this directory. Backup files are stored in ', 'it-l10n-backupbuddy') . str_replace('\\', '/', pb_backupbuddy::$options['backup_directory']), '', false) . '<span class="pb_backupbuddy_backuplist_loading" style="display: none; margin-left: 10px;"><img src="' . pb_backupbuddy::plugin_url() . '/images/loading.gif" alt="' . __('Loading...', 'it-l10n-backupbuddy') . '" title="' . __('Loading...', 'it-l10n-backupbuddy') . '" width="16" height="16" style="vertical-align: -3px;" /></span>', __('Type', 'it-l10n-backupbuddy'), __('File Size', 'it-l10n-backupbuddy'), __('Created', 'it-l10n-backupbuddy') . ' <img src="' . pb_backupbuddy::plugin_url() . '/images/sort_down.png" style="vertical-align: 0px;" title="Sorted most recent first">', __('Statistics', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Various statistics collected during backup such as time taken. Hover over the question mark in the status column for additional detailed information about the backup.', 'it-l10n-backupbuddy'), '', false), __('Status', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Backups are checked to verify that they are valid BackupBuddy backups and contain all of the key backup components needed to restore. Backups may display as invalid until they are completed. Click the refresh icon to re-verify the archive.', 'it-l10n-backupbuddy'), '', false));
// Remove some columns for migration mode.
if ($listing_mode != 'default') {
foreach ($backups as &$backup) {
unset($backup[1]);
// Remove backup type (only full shows for migration).
unset($backup[4]);
// Remove stats
$backup = array_values($backup);
}
$backups = array_values($backups);
unset($columns[1]);
unset($columns[4]);
$columns = array_values($columns);
}
pb_backupbuddy::$ui->list_table($backups, array('action' => pb_backupbuddy::page_url(), 'columns' => $columns, 'hover_actions' => $hover_actions, 'hover_action_column_key' => '0', 'bulk_actions' => array('delete_backup' => 'Delete'), 'css' => 'width: 100%;'));
示例9: mode
<?php // These advanced options will be available via $this->advanced_options from within the msimport class on each page. Passed along in the submitted form per step. ?>
<span class="pb_toggle button-secondary" id="advanced">Advanced Configuration Options</span>
<div id="pb_toggle-advanced" class="pb_toggled" style="margin-top: 12px; width: 600px;">
<b>WARNING:</b> Improper use of Advanced Options could result in data loss.<br><br>
<input type="hidden" name="advanced_options[skip_files]" value="false">
<input type="checkbox" name="advanced_options[skip_files]" value="true"> Skip zip file extraction. <?php pb_backupbuddy::tip( 'Checking this box will prevent extraction/unzipping of the backup ZIP file. You will need to manually extract it either on your local computer then upload it or use a server-based tool such as cPanel to extract it. This feature is useful if the extraction step is unable to complete for some reason.' ); ?><br>
<input type="hidden" name="advanced_options[ignore_sql_errors]" value="false">
<input type="checkbox" name="advanced_options[ignore_sql_errors]" value="true" /> Ignore SQL errors & hide them. <br>
<input type="hidden" name="advanced_options[skip_database_import]" value="false">
<input type="checkbox" name="advanced_options[skip_database_import]" value="true" /> Skip import of database. <br>
<input type="hidden" name="advanced_options[skip_database_migration]" value="false">
<input type="checkbox" name="advanced_options[skip_database_migration]" value="true" /> Skip migration of database. <br>
<input type="hidden" name="advanced_options[force_compatibility_medium]" value="false">
<input type="checkbox" name="advanced_options[force_compatibility_medium]" value="true" /> Force medium speed compatibility mode (ZipArchive). <br>
<input type="hidden" name="advanced_options[force_compatibility_slow]" value="false">
<input type="checkbox" name="advanced_options[force_compatibility_slow]" value="true" /> Force slow speed compatibility mode (PCLZip). <br>
<br>
PHP Maximum Execution Time: <input type="text" name="advanced_options[max_execution_time]" value="<?php echo $this->detected_max_execution_time; ?>" size="5"> seconds. <?php pb_backupbuddy::tip( 'The maximum allowed PHP runtime. If your database import step is timing out then lowering this value will instruct the script to limit each `chunk` to allow it to finish within this time period.' ); ?>
</div>
</td>
</tr>
</table>
<?php submit_button( __('Next Step') . ' »', 'primary', 'add-site' ); ?>
</form>
示例10: pb_backupbuddy_selectdestination
function pb_backupbuddy_selectdestination( destination_id, destination_title, callback_data, delete_after, mode ) {
window.location.href = '<?php
echo pb_backupbuddy::page_url();
?>
&custom=remoteclient&destination_id=' + destination_id;
}
</script>
<?php
/* BEGIN CONFIGURING PLUGIN SETTINGS FORM */
$settings_form = new pb_backupbuddy_settings('settings', '', 'tab=0', 350);
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_general', 'title' => __('General', 'it-l10n-backupbuddy')));
$settings_form->add_setting(array('type' => 'password', 'name' => 'importbuddy_pass_hash', 'title' => __('ImportBuddy password', 'it-l10n-backupbuddy'), 'tip' => __('[Example: myp@ssw0rD] - Required password for running the ImportBuddy import/migration script. This prevents unauthorized access when using this tool. You should not use your WordPress password here.', 'it-l10n-backupbuddy'), 'value' => $importbuddy_pass_dummy_text, 'css' => 'width: 120px;', 'after' => ' <span style="white-space: nowrap;">Confirm: <input style="width: 120px;" type="password" name="pb_backupbuddy_importbuddy_pass_hash_confirm" value="' . $importbuddy_pass_dummy_text . '"></span>'));
$settings_form->add_setting(array('type' => 'text', 'name' => 'backup_directory', 'title' => __('Custom local storage directory', 'it-l10n-backupbuddy'), 'tip' => __('Leave blank for default. To customize, enter a full local path where all backup ZIP files will be saved to. This directory must have proper write and read permissions. Upon changing, any backups in the existing directory will be moved to the new directory. Note: This is only where local backups will be, not remotely stored backups. Remote storage is configured on the Remote Destinations page.', 'it-l10n-backupbuddy'), 'rules' => '', 'css' => 'width: 250px;', 'before' => '<span style="white-space: nowrap;">', 'after' => ' <span class="description">' . __('Blank for default', 'it-l10n-backupbuddy') . ':</span> <span class="code" style="background: #EAEAEA; white-space: normal;">' . backupbuddy_core::_getBackupDirectoryDefault() . '</span>'));
$settings_form->add_setting(array('type' => 'select', 'name' => 'role_access', 'title' => __('BackupBuddy access permission', 'it-l10n-backupbuddy'), 'options' => array('administrator' => __('Administrator (default)', 'it-l10n-backupbuddy'), 'moderate_comments' => __('Editor (moderate_comments)', 'it-l10n-backupbuddy'), 'edit_published_posts' => __('Author (edit_published_posts)', 'it-l10n-backupbuddy'), 'edit_posts' => __('Contributor (edit_posts)', 'it-l10n-backupbuddy')), 'tip' => __('[Default: Administrator] - Allow other user levels to access BackupBuddy. Use extreme caution as users granted access will have FULL access to BackupBuddy and your backups, including remote destinations. This is a potential security hole if used improperly. Use caution when selecting any other user roles or giving users in such roles access. Not applicable to Multisite installations.', 'it-l10n-backupbuddy'), 'after' => ' <span class="description">Use caution changing from "administrator".</span>', 'rules' => 'required'));
require_once '_email.php';
$settings_form->add_setting(array('type' => 'title', 'name' => 'title_archivestoragelimits', 'title' => __('Local Archive Storage Limits', 'it-l10n-backupbuddy') . ' ' . pb_backupbuddy::tip('Prevent too many backups from piling up on your local server by setting limits. Limits are applied in the order listed below.', '', false)));
if ('settings' == pb_backupbuddy::_POST('pb_backupbuddy_')) {
if (!is_numeric(pb_backupbuddy::_POST('pb_backupbuddy_archive_limit_db'))) {
pb_backupbuddy::alert(__('Archive limiting by database type must be a numerical value. Reset to zero.', 'it-l10n-backupbuddy'));
$_POST['pb_backupbuddy_archive_limit_db'] = 0;
} else {
pb_backupbuddy::$options['archive_limit_db'] = pb_backupbuddy::_POST('pb_backupbuddy_archive_limit_db');
}
if (!is_numeric(pb_backupbuddy::_POST('pb_backupbuddy_archive_limit_files'))) {
pb_backupbuddy::alert(__('Archive limiting by files only type must be a numerical value. Reset to zero.', 'it-l10n-backupbuddy'));
$_POST['pb_backupbuddy_archive_limit_files'] = 0;
} else {
pb_backupbuddy::$options['archive_limit_files'] = pb_backupbuddy::_POST('pb_backupbuddy_archive_limit_files');
}
}
$settings_form->add_setting(array('type' => 'text', 'name' => 'archive_limit_age', 'title' => __('Age limit of local backups', 'it-l10n-backupbuddy'), 'tip' => __('[Example: 90] - Maximum age (in days) to allow your local archives to reach (remote archive limits are configured per destination on their respective settings pages). Any backups exceeding this age will be deleted as new backups are created. Changes to this setting take place once a new backup is made. Set to zero (0) for no limit.', 'it-l10n-backupbuddy'), 'rules' => 'required|int|int', 'css' => 'width: 50px;', 'after' => ' days. <span class="description">0 for no limit.</span>'));
示例11: _e
<td><span style="font-size: 1.17em; font-weight: bold; white-space: nowrap;"><?php
_e('Status Log', 'it-l10n-backupbuddy');
?>
</span></td>
<td width="16"><span id="pb_backupbuddy_loading" style="display: none; margin-left: 10px;"><img src="<?php
echo pb_backupbuddy::plugin_url();
?>
/images/loading.gif" <?php
echo 'alt="', __('Loading...', 'it-l10n-backupbuddy'), '" title="', __('Loading...', 'it-l10n-backupbuddy'), '"';
?>
width="16" height="16" style="vertical-align: -3px;" /></span></td>
<td width="100%" align="right"><?php
_e('Archive size', 'it-l10n-backupbuddy');
?>
: <span class="backupbuddy_archive_size">0 MB</span> <?php
pb_backupbuddy::tip(__('This is the current size of the backup archive as it is being generated. This size will grow until the backup is complete.', 'it-l10n-backupbuddy'));
?>
</td>
</tr></table>
<!-- ··· Starting backup procedure... ··· -->
<textarea wrap="off" id="backupbuddy_messages" style="width: 793px; white-space: nowrap;">Time Elapsed Memory Message</textarea>
<div id="backupbuddy_errors_notice"><span id="backupbuddy_errors_notice_count"></span> or more errors encountered in the status log above.<br><span id="backupbuddy_errors_notice_subtext"><b>Not all errors are fatal.</b> Look up error codes & troubleshooting details in the <a href="http://ithemes.com/codex/page/BackupBuddy#Troubleshooting" target="_new"><b>Knowledge Base</b></a>.<br>Provide a copy of the status log above if seeking support.</span></div>
<br><br><br>
<div style="text-align: center;" id="pb_backupbuddy_stop">
<a class="button secondary-button">Cancel Backup</a>
示例12: if
<input type="checkbox" name="skip_database_migration" <?php if ( pb_backupbuddy::$options['skip_database_migration'] == '1' ) echo 'checked'; ?>> Skip migration of database. <br>
<br>
<b>After importing, skip data migration on these tables:</b><?php pb_backupbuddy::tip( 'Database tables to exclude from migration. These tables will still be imported into the database but URLs and paths will not be modified. This is useful if the migration is timing out.' ); ?><br><textarea name="exclude_tables" style="width: 300px; height: 75px;"></textarea>
</div>
*/
?>
<div style="clear: both; display: none; background-color: #F1EDED; -moz-border-radius:4px 4px 4px 4px; border:1px solid #DFDFDF; margin-right:10px; padding:3px;" id="ithemes_loading">
<img src="importbuddy/images/loading.gif">Loading ...</div>
</div>
<?php
if (pb_backupbuddy::$options['force_high_security'] != false || isset(pb_backupbuddy::$options['dat_file']['high_security']) && pb_backupbuddy::$options['dat_file']['high_security'] === true) {
?>
<label> </label><br>
<h3>Create Administrator Account <?php
pb_backupbuddy::tip('Your backup was created either with High Security Mode enabled or from a WordPress Multisite installation. For security your must provide a WordPress username and password to grant administrator privileges to.', '', true);
?>
</h3>
<label>
New admin username
</label>
<input type="text" name="admin_user" id="admin_user" value="" style="width: 175px;" />
<span class="light">(if user exists, it will be overwritten)</span>
<br>
<label>
Password
</label>
<input type="text" name="admin_pass" id="admin_pass" value="" style="width: 175px;" />
<br>
<?php
}
示例13: __
});
</script>
<?php
pb_backupbuddy::$ui->title(__('Scheduled Backups', 'it-l10n-backupbuddy'));
pb_backupbuddy::$ui->start_metabox($mode_title . ' ' . pb_backupbuddy::video('MGiUdYb68ps', __('Scheduling', 'it-l10n-backupbuddy'), false), true, 'width: 100%;');
$schedule_form->display_settings('+ ' . $mode_title);
echo '<br><br>';
pb_backupbuddy::$ui->end_metabox();
if (count($schedules) == 0) {
//echo '<h4>' . __( 'No schedules have been created yet.', 'it-l10n-backupbuddy' ) . '</h4>';
} else {
pb_backupbuddy::$ui->list_table($schedules, array('action' => pb_backupbuddy::page_url(), 'columns' => array(__('Title', 'it-l10n-backupbuddy'), __('Type', 'it-l10n-backupbuddy'), __('Interval', 'it-l10n-backupbuddy'), __('Destinations', 'it-l10n-backupbuddy'), __('First Run', 'it-l10n-backupbuddy'), __('Last Run', 'it-l10n-backupbuddy') . pb_backupbuddy::tip(__('Last run time is the last time that this scheduled backup started. This does not imply that the backup completed, only that it began at this time. The last run time is reset if the schedule is edited.', 'it-l10n-backupbuddy'), '', false)), 'hover_actions' => array('edit' => 'Edit Schedule'), 'bulk_actions' => array('delete_schedule' => 'Delete'), 'css' => 'width: 100%;'));
}
echo '<br>';
?>
<br /><br />
<div class="description" style="width: 793px; text-align: center;">
<?php
_e('Due to the way schedules are triggered in WordPress someone must visit your site<br /> for scheduled backups to occur. If there are no visits, some schedules may not be triggered.', 'it-l10n-backupbuddy');
?>
<br>
WordPress cron events may be viewed or run manually from the <a href="?page=pb_backupbuddy_server_info">Server Information page</a>.<br>
Additional cron control is available via the free plugin <a target="_new" href="http://wordpress.org/extend/plugins/wp-cron-control/">WP-Cron Control</a> by Automaticc.
示例14: htmlentities
?>
&database_replace=1&parent_config=<?php
echo htmlentities(pb_backupbuddy::_GET('parent_config'));
?>
" method="post">
<input type="hidden" name="action" value="replace">
<h4>Replace <?php
pb_backupbuddy::tip('Text you want to be searched for and replaced. Everything in the box is considered one match and may span multiple lines.');
?>
</h4>
<textarea name="needle" style="width: 100%;"></textarea>
<br>
<h4>With <?php
pb_backupbuddy::tip('Text you want to replace with. Any text found matching the box above will be replaced with this text. Everything in the box is considered one match and may span multiple lines.');
?>
</h4>
<textarea name="replacement" style="width: 100%;"></textarea>
<h4>In table(s)</h4>
<label style="float: none;" for="table_selection_all"><input id="table_selection_all" checked='checked' type="radio" name="table_selection" value="all"> all tables</label>
<label style="float: none;" for="table_selection_prefix"><input id="table_selection_prefix" type="radio" name="table_selection" value="prefix"> with prefix:</label>
<select name="table_prefix" id="table_selection_prefix" onclick="jQuery('#table_selection_prefix').click();">
<?php
foreach ($prefixes as $prefix) {
echo '<option value="' . $prefix . '">' . $prefix . '</option>';
}
?>
</select>
<label style="float: none;" for="table_selection_table"><input id="table_selection_table" type="radio" name="table_selection" value="single_table"> single:</label>
示例15: elseif
if (version_compare($wpdb->db_version(), '5.0.15', '<=')) {
$parent_class_test['status'] = 'FAIL';
} elseif (version_compare($wpdb->db_version(), '5.5.0', '<=')) {
$parent_class_test['status'] = 'WARNING';
} else {
$parent_class_test['status'] = 'OK';
}
array_push($tests, $parent_class_test);
// ADDHANDLER HTACCESS CHECK
$parent_class_test = array('title' => 'AddHandler in .htaccess', 'suggestion' => 'host dependant (none best unless required)', 'tip' => __('If detected then you may have difficulty migrating your site to some hosts without first removing the AddHandler line. Some hosts will malfunction with this line in the .htaccess file.', 'it-l10n-backupbuddy'));
if (file_exists(ABSPATH . '.htaccess')) {
$addhandler_note = '';
$htaccess_lines = file(ABSPATH . '.htaccess');
foreach ($htaccess_lines as $htaccess_line) {
if (preg_match('/^(\\s*)AddHandler(.*)/i', $htaccess_line, $matches) > 0) {
$addhandler_note = pb_backupbuddy::tip(htmlentities($matches[0]), __('AddHandler Value', 'it-l10n-backupbuddy'), false);
}
}
unset($htaccess_lines);
if ($addhandler_note == '') {
$parent_class_test['status'] = 'OK';
$parent_class_test['value'] = __('none, n/a', 'it-l10n-backupbuddy');
} else {
$parent_class_test['status'] = 'WARNING';
$parent_class_test['value'] = __('exists', 'it-l10n-backupbuddy') . $addhandler_note;
}
unset($htaccess_contents);
} else {
$parent_class_test['status'] = 'OK';
$parent_class_test['value'] = __('n/a', 'it-l10n-backupbuddy');
}