'files', 'screen' => 'files' ) ); } protected function get_table_classes() { return array( 'widefat striped' ); } public function get_columns() { $columns = array(); $columns['wpvivid_file'] = __( 'File', 'wpvivid-backuprestore' ); return $columns; } public function _column_wpvivid_file( $file ) { echo '
'. esc_html($file['key']).'
'; if($file['status']=='completed') { echo ''.esc_html__('File Size: ', 'wpvivid-backuprestore').''.esc_html($file['size']).'|'. esc_html__('Download', 'wpvivid-backuprestore').''; } else if($file['status']=='file_not_found') { echo '' . esc_html__('File not found', 'wpvivid-backuprestore') . ''; } else if($file['status']=='need_download') { echo ''.esc_html__('File Size: ', 'wpvivid-backuprestore').''.esc_html($file['size']).'|'. esc_html__('Prepare to Download', 'wpvivid-backuprestore').''; } else if($file['status']=='running') { echo '
' . esc_html__('Retriving (remote storage to web server)', 'wpvivid-backuprestore') . '|' . esc_html__('File Size: ', 'wpvivid-backuprestore') . ''.esc_html($file['size']).'|'. esc_html__('Downloaded Size: ', 'wpvivid-backuprestore').''.esc_html($file['downloaded_size']).'
'; } else if($file['status']=='timeout') { echo '
Download timeout, please retry.
'.esc_html__('File Size: ', 'wpvivid-backuprestore').''.esc_html($file['size']).'|'. esc_html__('Prepare to Download', 'wpvivid-backuprestore').'
'; } else if($file['status']=='error') { echo '
'.esc_html($file['error']).'
'.esc_html__('File Size: ', 'wpvivid-backuprestore').''.esc_html($file['size']).'|'. esc_html__('Prepare to Download', 'wpvivid-backuprestore').'
'; } echo '
'; //size } public function set_files_list($file_list,$backup_id,$page_num=1) { $this->file_list=$file_list; $this->backup_id=$backup_id; $this->page_num=$page_num; } public function get_pagenum() { if($this->page_num=='first') { $this->page_num=1; } else if($this->page_num=='last') { $this->page_num=$this->_pagination_args['total_pages']; } $pagenum = $this->page_num ? $this->page_num : 0; if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) { $pagenum = $this->_pagination_args['total_pages']; } return max( 1, $pagenum ); } public function prepare_items() { $columns = $this->get_columns(); $hidden = array(); $sortable = array(); $this->_column_headers = array($columns, $hidden, $sortable); $total_items =sizeof($this->file_list); $this->set_pagination_args( array( 'total_items' => $total_items, 'per_page' => 10, ) ); } public function has_items() { return !empty($this->file_list); } public function display_rows() { $this->_display_rows($this->file_list); } private function _display_rows($file_list) { $page=$this->get_pagenum(); $page_file_list=array(); $count=0; while ( $count<$page ) { $page_file_list = array_splice( $file_list, 0, 10); $count++; } foreach ( $page_file_list as $key=>$file) { $file['key']=$key; $this->single_row($file); } } public function single_row($file) { ?> single_row_columns( $file ); ?> _pagination_args ) ) { return; } $total_items = $this->_pagination_args['total_items']; $total_pages = $this->_pagination_args['total_pages']; $infinite_scroll = false; if ( isset( $this->_pagination_args['infinite_scroll'] ) ) { $infinite_scroll = $this->_pagination_args['infinite_scroll']; } if ( 'top' === $which && $total_pages > 1 ) { $this->screen->render_screen_reader_content( 'heading_pagination' ); } $output = '' . sprintf( _n( '%s item', '%s items', $total_items, 'wpvivid-backuprestore' ), number_format_i18n( $total_items ) ) . ''; $current = $this->get_pagenum(); $page_links = array(); $total_pages_before = ''; $total_pages_after = ''; $disable_first = $disable_last = $disable_prev = $disable_next = false; if ( $current == 1 ) { $disable_first = true; $disable_prev = true; } if ( $current == 2 ) { $disable_first = true; } if ( $current == $total_pages ) { $disable_last = true; $disable_next = true; } if ( $current == $total_pages - 1 ) { $disable_last = true; } if ( $disable_first ) { $page_links[] = ''; } else { $page_links[] = sprintf( "
%s
", __( 'First page', 'wpvivid-backuprestore' ), '«' ); } if ( $disable_prev ) { $page_links[] = ''; } else { $page_links[] = sprintf( "
%s
", $current, __( 'Previous page', 'wpvivid-backuprestore' ), '‹' ); } if ( 'bottom' === $which ) { $html_current_page = $current; $total_pages_before = '' . __( 'Current Page', 'wpvivid-backuprestore' ) . ''; } else { $html_current_page = sprintf( "%s", '', $current, strlen( $total_pages ) ); } $html_total_pages = sprintf( "%s", number_format_i18n( $total_pages ) ); $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging', 'wpvivid-backuprestore' ), $html_current_page, $html_total_pages ) . $total_pages_after; if ( $disable_next ) { $page_links[] = ''; } else { $page_links[] = sprintf( "
%s
", $current, __( 'Next page', 'wpvivid-backuprestore' ), '›' ); } if ( $disable_last ) { $page_links[] = ''; } else { $page_links[] = sprintf( "
%s
", __( 'Last page', 'wpvivid-backuprestore' ), '»' ); } $pagination_links_class = 'pagination-links'; if ( ! empty( $infinite_scroll ) ) { $pagination_links_class .= ' hide-if-js'; } $output .= "\n" . join( "\n", $page_links ) . ''; if ( $total_pages ) { $page_class = $total_pages < 2 ? ' one-page' : ''; } else { $page_class = ' no-pages'; } $this->_pagination = "
$output
"; echo $this->_pagination; } protected function display_tablenav( $which ) { $css_type = ''; if ( 'top' === $which ) { wp_nonce_field( 'bulk-' . $this->_args['plural'] ); $css_type = 'margin: 0 0 10px 0'; } else if( 'bottom' === $which ) { $css_type = 'margin: 10px 0 0 0'; } $total_pages = $this->_pagination_args['total_pages']; if ( $total_pages >1) { ?>
extra_tablenav( $which ); $this->pagination( $which ); ?>
_args['singular']; $this->display_tablenav( 'top' ); $this->screen->render_screen_reader_content( 'heading_list' ); ?> print_column_headers(); ?> > display_rows_or_placeholder(); ?>
display_tablenav( 'bottom' ); } } function wpvivid_add_backup_type($type_name) { ?>



backup2->_list_tasks_ex(); $general_setting=WPvivid_Setting::get_setting(true, ""); if( (isset($general_setting['options']['wpvivid_common_setting']['estimate_backup'])) &&($general_setting['options']['wpvivid_common_setting']['estimate_backup'] == 0) ) { ?> jQuery('#wpvivid_estimate_backup_info').hide(); jQuery('#wpvivid_postbox_backup_percent').hide(); jQuery('#wpvivid_backup_cancel_btn').css({'pointer-events': 'auto', 'opacity': '1'}); jQuery('#wpvivid_quickbackup_btn').css({'pointer-events': 'auto', 'opacity': '1'}); jQuery('#wpvivid_postbox_backup_percent').show(); '.__('About backup download', 'wpvivid-backuprestore').'

'; $html .= '
    '; $html .= '
  • '.__('->If backups are stored in remote storage, our plugin will retrieve the backup to your web server first. This may take a little time depending on the size of backup files. Please be patient. Then you can download them to your PC.', 'wpvivid-backuprestore').'
  • '; $html .= '
  • '.__('->If backups are stored in web server, the plugin will list all relevant files immediately.', 'wpvivid-backuprestore').'
  • '; $html .= '
'; return $html; } function wpvivid_restore_website_descript($html){ $html = '

'.__('How to restore your website from a backup(scheduled, manual, uploaded and received backup)', 'wpvivid-backuprestore').'

'; $html .= '
'; return $html; } function wpvivid_backuppage_load_backuplist($backuplist_array){ $backuplist_array['list_backup'] = array('index' => '1', 'tab_func' => 'wpvivid_backuppage_add_tab_backup', 'page_func' => 'wpvivid_backuppage_add_page_backup'); $backuplist_array['list_log'] = array('index' => '3', 'tab_func' => 'wpvivid_backuppage_add_tab_log', 'page_func' => 'wpvivid_backuppage_add_page_log'); $backuplist_array['list_restore'] = array('index' => '4', 'tab_func' => 'wpvivid_backuppage_add_tab_restore', 'page_func' => 'wpvivid_backuppage_add_page_restore'); $backuplist_array['list_download'] = array('index' => '5', 'tab_func' => 'wpvivid_backuppage_add_tab_downlaod', 'page_func' => 'wpvivid_backuppage_add_page_downlaod'); return $backuplist_array; } function wpvivid_backuppage_add_tab_backup(){ ?>
'.esc_html__('About backup download', 'wpvivid-backuprestore').'

'; echo '
    '; echo '
  • '.esc_html__('->If backups are stored in remote storage, our plugin will retrieve the backup to your web server first. This may take a little time depending on the size of backup files. Please be patient. Then you can download them to your PC.', 'wpvivid-backuprestore').'
  • '; echo '
  • '.esc_html__('->If backups are stored in web server, the plugin will list all relevant files immediately.', 'wpvivid-backuprestore').'
  • '; echo '
'; ?>
'.esc_html__('How to restore your website from a backup(scheduled, manual, uploaded and received backup)', 'wpvivid-backuprestore').'

'; echo '
'; ?>
|
input type="radio"
input type="checkbox"

$value) { if(in_array($key, $default_remote_storage)) { $remote_storage_type[]=$value['type']; } } $remote=array(); $remote=apply_filters('wpvivid_remote_pic', $remote); if(is_array($remote)) { foreach ($remote as $key => $value) { $title = $value['title']; if (in_array($key, $remote_storage_type)) { $pic = $value['selected_pic']; } else { $pic = $value['default_pic']; } $url = apply_filters('wpvivid_get_wpvivid_pro_url', WPVIVID_PLUGIN_URL, $key); echo ''; } echo ''; } ?>