<?php wp_nonce_field('welcome-panel-nonce', 'welcomepanelnonce', false); ?> <a class="welcome-panel-close" href="<?php echo esc_url(admin_url('?welcome=0')); ?> "><?php _e('Dismiss'); ?> </a> <?php do_action('welcome_panel'); ?> </div> <?php } ?> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> <div class="clear"></div> </div><!-- dashboard-widgets-wrap --> </div><!-- wrap --> <?php require ABSPATH . 'wp-admin/admin-footer.php';
); wp_dashboard_setup(); wp_enqueue_script( 'dashboard' ); wp_enqueue_script( 'plugin-install' ); wp_admin_css( 'dashboard' ); wp_admin_css( 'plugin-install' ); add_thickbox(); add_screen_option('layout_columns', array('max' => 4, 'default' => 2) ); require_once( '../admin-header.php' ); ?> <div class="wrap"> <?php screen_icon(); ?> <h2><?php echo esc_html( $title ); ?></h2> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> <div class="clear"></div> </div><!-- dashboard-widgets-wrap --> </div><!-- wrap --> <?php include( '../admin-footer.php' ); ?>
public static function renderDashboardBody($websites, $pDashboard, $pScreenLayout) { $opts = get_option('mainwp_opts_showhide_sections', false); $hide_shortcuts = is_array($opts) && isset($opts['welcome_shortcuts']) && $opts['welcome_shortcuts'] == 'hide' ? true : false; ?> <form action="admin-post.php" method="post"> <?php wp_nonce_field('mainwp_tab-general'); ?> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> <input type="hidden" name="action" value="save_howto_testPages_general"/> <div id="mainwp-welocme-bar" class="welcome-panel" style="padding-left: 2em;"> <table id="mainwp-refresh-bar" width="100%"> <tbody> <tr> <td> <div id="mainwp-welocme-bar-top"> <span style="float:right;"> <a style="font-size: 18px;" class="button-hero button mainwp-upgrade-button" id="dashboard_refresh" title="<?php echo MainWP_Right_Now::renderLastUpdate(); ?> "><i class="fa fa-refresh"></i> <?php _e('Sync Data with Child Sites', 'mainwp'); ?> </a> <a style="font-size: 18px;" class="button-hero button-primary button" target="_blank" href="https://extensions.mainwp.com"><i class="fa fa-cart-plus"></i> <?php _e('Get New Extensions', 'mainwp'); ?> </a> </span> <?php $current_wp_id = MainWP_Utility::get_current_wpid(); $website = null; if (!empty($current_wp_id)) { $website = $websites[0]; } $imgfavi = ''; if ($website !== null) { if (get_option('mainwp_use_favicon', 1) == 1) { $favi = MainWP_DB::Instance()->getWebsiteOption($website, 'favi_icon', ''); $favi_url = MainWP_Utility::get_favico_url($favi, $website); $imgfavi = '<img src="' . $favi_url . '" width="16" height="16" style="vertical-align:middle;"/> '; } } if ($website !== null) { if (time() - $website->dtsSync > 60 * 60 * 24) { ?> <h3> <i class="fa fa-flag"></i> <?php _e('Your MainWP Dashboard has not been synced for 24 hours!', 'mainwp'); ?> </h3> <p class="about-description"><?php _e('Click the Sync Data button to get the latest data from child sites.', 'mainwp'); ?> </p> <?php } else { ?> <h3><?php echo sprintf(__('Welcome to %s Dashboard!', 'mainwp'), stripslashes($website->name)); ?> </h3> <p class="about-description"><?php echo sprintf(__('This information is only for %s%s', 'mainwp'), $imgfavi, MainWP_Utility::getNiceURL($website->url, true)); ?> </p> <?php } } else { $sync_status = MainWP_DB::Instance()->getLastSyncStatus(); if ($sync_status === 'not_synced') { ?> <h3> <i class="fa fa-flag"></i> <?php _e('Your MainWP Dashboard has not been synced for 24 hours!', 'mainwp'); ?> </h3> <p class="about-description"><?php _e('Click the Sync Data button to get the latest data from child sites.', 'mainwp'); ?> </p> <?php } else { if ($sync_status === 'all_synced') { ?> <h3><?php echo __('All sites have been synced within the last 24 hours!', 'mainwp'); ?> </h3> <p class="about-description"><?php echo __('Manage your WordPress sites with ease.', 'mainwp'); ?> </p> <?php } else { ?> <h3><i class="fa fa-flag"></i> <?php echo __("Some child sites didn't sync correctly!", 'mainwp'); ?> </h3> <p class="about-description"><?php echo __('Check the Sync Status widget to review sites that have not been synced.', 'mainwp'); ?> </p> <?php } } } ?> </div> <br/> <span style="float: right; margin-right: 1em;"><a id="mainwp-link-showhide-welcome-shortcuts" status="<?php echo $hide_shortcuts ? 'hide' : 'show'; ?> " href="#"><?php echo $hide_shortcuts ? __('Show Shortcuts', 'mainwp') : __('Hide Shortcuts', 'mainwp'); ?> </a></span> <div id="mainwp-welcome-bar-shotcuts" style="clear: both;<?php echo $hide_shortcuts ? 'display: none;' : ''; ?> "> <div class="welcome-panel-column"> <h4><?php _e('Get Started', 'mainwp'); ?> </h4> <ul> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=managesites&do=new"><i class="fa fa-globe"></i> <?php _e('Add New Site', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=ManageGroups"><i class="fa fa-globe"></i> <?php _e('Create Child Site Groups', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=ManageBackupsAddNew"><i class="fa fa-hdd-o"></i> <?php _e('Schedule Backups', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=Settings"><i class="fa fa-cogs"></i> <?php _e('Check MainWP Settings', 'mainwp'); ?> </a></li> </ul> </div> <div class="welcome-panel-column"> <h4><?php _e('Next Steps', 'mainwp'); ?> </h4> <ul> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=PostBulkAdd"><i class="fa fa-file-text"></i> <?php _e('Add Post to Child Site(s)', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=PageBulkAdd"><i class="fa fa-file"></i> <?php _e('Add Page to Child Site(s)', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=PluginsInstall"><i class="fa fa-plug"></i> <?php _e('Add Plugin to Child Site(s)', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=ThemesInstall"><i class="fa fa-paint-brush"></i> <?php _e('Add Theme to Child Site(s)', 'mainwp'); ?> </a></li> </ul> </div> <div class="welcome-panel-column welcome-panel-last"> <h4><?php _e('More Actions', 'mainwp'); ?> </h4> <ul> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=managesites&do=test"><i class="fa fa-globe"></i> <?php _e('Test Connection', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=Extensions"><i class="fa fa-plug"></i> <?php _e('Manage Extensions', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=ServerInformation"><i class="fa fa-server"></i> <?php _e('Check MainWP Requirements', 'mainwp'); ?> </a></li> <li> <a href="<?php echo get_admin_url(); ?> admin.php?page=DashboardOptions"><i class="fa fa-cogs"></i> <?php _e('Set Your Preferences', 'mainwp'); ?> </a></li> </ul> </div> </div> <div id="dashboard_refresh_statusextra" style="display: none"> <i class="fa fa-spinner fa-pulse"></i></div> </div> <div id="mainwp_dashboard_refresh_status"></div> </td></tr></tbody> </table> </div> <div id="mainwp_main_errors" class="mainwp_error"></div> </form> <div id="mainwp-dashboard-info-box"> <?php if (empty($current_wp_id) && MainWP_Twitter::enabledTwitterMessages()) { $filter = array('upgrade_everything', 'upgrade_all_wp_core', 'upgrade_all_plugins', 'upgrade_all_themes'); foreach ($filter as $what) { $twitters = MainWP_Twitter::getTwitterNotice($what); if (is_array($twitters)) { foreach ($twitters as $timeid => $twit_mess) { $sendText = ""; if (!empty($twit_mess)) { if (!empty($sendText)) { $sendText = MainWP_Twitter::getTwitToSend($what, $timeid); ?> <div class="mainwp-tips mainwp_info-box-blue twitter"> <span class="mainwp-tip" twit-what="<?php echo $what; ?> " twit-id="<?php echo $timeid; ?> "><?php echo $twit_mess; ?> </span> <?php MainWP_Twitter::genTwitterButton($sendText); ?> <span><a href="#" class="mainwp-dismiss-twit"><i class="fa fa-times-circle"></i> <?php _e('Dismiss', 'mainwp'); ?> </a></span></div> <?php } } } } } ?> <?php } ?> </div> <div id="dashboard-widgets-wrap"> <?php require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wp_dashboard(); ?> <div class="clear"></div> </div><!-- dashboard-widgets-wrap --> <?php }
public static function renderDashboardBody($websites, $pDashboard, $pScreenLayout) { ?> <form action="admin-post.php" method="post"> <?php wp_nonce_field('mainwp_tab-general'); ?> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> <input type="hidden" name="action" value="save_howto_testPages_general"/> <div class="postbox" style="padding-top: 1em;"> <table id="mainwp-refresh-bar" width="100%"> <tbody><tr> <?php $current_wp_id = MainWPUtility::get_current_wpid(); $website = null; if (!empty($current_wp_id)) { $website = $websites[0]; } $imgfavi = ""; if ($website !== null) { if (get_option('mainwp_use_favicon', 1) == 1) { $favi = MainWPDB::Instance()->getWebsiteOption($website, 'favi_icon', ""); $favi_url = MainWPUtility::get_favico_url($favi, $website); $imgfavi = '<img src="' . $favi_url . '" width="16" height="16" style="vertical-align:middle;"/> '; } } if (time() - ($website == null ? MainWPDB::Instance()->getFirstSyncedSite() : $website->dtsSync) > 60 * 60 * 24) { ?> <td id="mainwp-welcome-bar" width="47%" style="padding-left: 1em;"> <span class="mainwp-reminder"><?php _e('Your MainWP Dashboard has not been synced for 24 hours! Click the Sync Data button to get the latest data from child sites.', 'mainwp'); ?> </span><br/> </td> <?php } else { ?> <td id="mainwp-welcome-bar" width="47%" style="padding-left: 1em;"> <span style="font-size: 24px"><?php echo $website == null ? __('Welcome to Your MainWP Dashboard!', 'mainwp') : sprintf(__('Welcome to %s Dashboard!', 'mainwp'), stripslashes($website->name)); ?> </span><br/> <span style="font-style: italic; font-size: 14px;"><?php echo $website == null ? __('Manage your WordPress sites with ease.', 'mainwp') : sprintf(__('This information is only for %s%s', 'mainwp'), $imgfavi, MainWPUtility::getNiceURL($website->url, true)); ?> </span> </td> <?php } ?> <td id="mainwp-refresh-bar-buttons"> <a class="button-hero button mainwp-upgrade-button" id="dashboard_refresh" title="<?php echo MainWPRightNow::renderLastUpdate(); ?> "><?php _e('<i class="fa fa-refresh"></i> Sync Data', 'mainwp'); ?> </a> <a class="button-hero button-primary button mainwp-addsite-button" href="admin.php?page=managesites&do=new"><?php _e('<i class="fa fa-plus"></i> Add New Site', 'mainwp'); ?> </a> <a class="button-hero button-primary button mainwp-button-red" target="_blank" href="https://extensions.mainwp.com"><?php _e('<i class="fa fa-cart-plus"></i> Get New Extensions', 'mainwp'); ?> </a> </td> <div id="dashboard_refresh_statusextra" style="display: none"> <i class="fa fa-spinner fa-pulse"></i> </div> </tr></tbody> </table> <div id="mainwp_dashboard_refresh_status"></div> </div> <div id="mainwp_main_errors" class="mainwp_error"></div> </form> <div id="dashboard-widgets-wrap"> <?php require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wp_dashboard(); ?> <div class="clear"></div> </div><!-- dashboard-widgets-wrap --> <?php }
function tp_main() { echo '<div id="dashboard-widgets-wrap">'; /** Load WordPress dashboard API */ require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wp_enqueue_script('dashboard'); wp_admin_css('dashboard'); add_thickbox(); wp_dashboard(); echo '<div class="clear"></div>'; }
public function load_dashboard($load_title = false) { global $plugin_page, $hook_suffix, $current_screen, $title, $menu, $submenu, $pagenow, $typenow; $hook_suffix = 'admin.php'; $pagenow = 'admin.php'; $typenow = ''; $title = __('Dashboard', 'mainwp'); $this->init_load(); if (wp_verify_nonce($_REQUEST['nonce'], 'mainwp_ajax')) { if ($load_title) { echo esc_html($this->get_title()); exit; } set_current_screen(); require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wp_dashboard_setup(); wp_enqueue_script('dashboard'); wp_enqueue_script('plugin-install'); wp_enqueue_script('media-upload'); add_thickbox(); $title = __('Dashboard'); $parent_file = 'index.php'; if (is_user_admin()) { add_screen_option('layout_columns', array('max' => 4, 'default' => 2)); } else { add_screen_option('layout_columns', array('max' => 4, 'default' => 2)); } //$screen_layout_columns = 2; $help = '<p>' . __('Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.', 'mainwp') . '</p>'; get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview', 'mainwp'), 'content' => $help)); // Help tabs $help = '<p>' . __('The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.', 'mainwp') . '</p>'; $help .= '<p>' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.', 'mainwp') . '</p>'; get_current_screen()->add_help_tab(array('id' => 'help-navigation', 'title' => __('Navigation', 'mainwp'), 'content' => $help)); $help = '<p>' . __('You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Screen Options</strong> - Use the Screen Options tab to choose which Dashboard boxes to show, and how many columns to display.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Drag and Drop</strong> - To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a “Configure” link in the title bar if you hover over it.', 'mainwp') . '</p>'; get_current_screen()->add_help_tab(array('id' => 'help-layout', 'title' => __('Layout', 'mainwp'), 'content' => $help)); $help = '<p>' . __('The boxes on your Dashboard screen are:', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Right Now</strong> - Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Recent Comments</strong> - Shows the most recent comments on your posts (configurable, up to 30) and allows you to moderate them.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Incoming Links</strong> - Shows links to your site found by Google Blog Search.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>QuickPress</strong> - Allows you to create a new post and either publish it or save it as a draft.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Recent Drafts</strong> - Displays links to the 5 most recent draft posts you’ve started.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>WordPress Blog</strong> - Latest news from the official WordPress project.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Other WordPress News</strong> - Shows the <a href="http://planet.wordpress.org" target="_blank">WordPress Planet</a> feed. You can configure it to show a different feed of your choosing.', 'mainwp') . '</p>'; $help .= '<p>' . __('<strong>Plugins</strong> - Features the most popular, newest, and recently updated plugins from the WordPress.org Plugin Directory.', 'mainwp') . '</p>'; get_current_screen()->add_help_tab(array('id' => 'help-content', 'title' => __('Content', 'mainwp'), 'content' => $help)); unset($help); get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:', 'mainwp') . '</strong></p>' . '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>', 'mainwp') . '</p>' . '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'mainwp') . '</p>'); $today = current_time('mysql', 1); ?> <?php screen_meta($current_screen); // Back compatibility with 3.2 //$current_screen->render_screen_meta(); // For 3.3 ?> <div class="wrap"> <?php screen_icon('index'); ?> <h2><?php echo esc_html($title); ?> </h2> <?php wp_welcome_panel(); ?> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> <div class="clear"></div> </div> <!-- dashboard-widgets-wrap --> </div><!-- wrap --> <?php } exit; }
static function Display() { global $wpdb, $user_ID; require_once ABSPATH . 'wp-admin/includes/dashboard.php'; wpfb_loadclass('AdminDashboard'); add_thickbox(); wp_enqueue_script('dashboard'); if (wp_is_mobile()) { wp_enqueue_script('jquery-touch-punch'); } //register_shutdown_function( create_function('','$error = error_get_last(); if( $error && $error[\'type\'] != E_STRICT ){print_r( $error );}else{return true;}') ); wpfb_loadclass('File', 'Category', 'Admin', 'Output'); $_POST = stripslashes_deep($_POST); $_GET = stripslashes_deep($_GET); $action = !empty($_POST['action']) ? $_POST['action'] : (!empty($_GET['action']) ? $_GET['action'] : ''); $clean_uri = remove_query_arg(array('message', 'action', 'file_id', 'cat_id', 'deltpl', 'hash_sync', 'doit', 'ids', 'files', 'cats', 'batch_sync')); // keep search keyword WPFB_Admin::PrintFlattrHead(); ?> <script type="text/javascript"> /* Liking/Donate Bar */ if(typeof(jQuery) != 'undefined') { jQuery(document).ready(function(){ if(getUserSetting("wpfilebase_hidesuprow",false) == 1) { jQuery('#wpfb-liking').hide(); jQuery('#wpfb-liking-toggle').addClass('closed'); } jQuery('#wpfb-liking-toggle').click(function(){ jQuery('#wpfb-liking').slideToggle(); jQuery(this).toggleClass('closed'); setUserSetting("wpfilebase_hidesuprow", 1-getUserSetting("wpfilebase_hidesuprow",false), 0); }); }); } </script> <div class="wrap"> <div id="icon-wpfilebase" class="icon32"><br /></div> <h2><?php echo WPFB_PLUGIN_NAME; ?> </h2> <?php switch ($action) { default: $clean_uri = remove_query_arg('pagenum', $clean_uri); $upload_dir = WPFB_Core::UploadDir(); $upload_dir_rel = str_replace(ABSPATH, '', $upload_dir); $chmod_cmd = "CHMOD " . WPFB_PERM_DIR . " " . $upload_dir_rel; if (!is_dir($upload_dir)) { $result = WPFB_Admin::Mkdir($upload_dir); if ($result['error']) { $error_msg = sprintf(__('The upload directory <code>%s</code> does not exists. It could not be created automatically because the directory <code>%s</code> is not writable. Please create <code>%s</code> and make it writable for the webserver by executing the following FTP command: <code>%s</code>', 'wp-filebase'), $upload_dir_rel, str_replace(ABSPATH, '', $result['parent']), $upload_dir_rel, $chmod_cmd); } else { wpfb_call('Setup', 'ProtectUploadPath'); } } elseif (!is_writable($upload_dir)) { $error_msg = sprintf(__('The upload directory <code>%s</code> is not writable. Please make it writable for PHP by executing the follwing FTP command: <code>%s</code>', 'wp-filebase'), $upload_dir_rel, $chmod_cmd); } if (!empty($error_msg)) { echo '<div class="error default-password-nag"><p>' . $error_msg . '</p></div>'; } if (!empty(WPFB_Core::$settings->tag_conv_req)) { echo '<div class="updated"><p><a href="' . add_query_arg('action', 'convert-tags') . '">'; _e('WP-Filebase content tags must be converted', 'wp-filebase'); echo '</a></p></div><div style="clear:both;"></div>'; } ?> <?php if (self::PluginHasBeenUsedAWhile(true)) { self::ProUpgradeNag(); } if (self::PluginHasBeenUsedAWhile()) { ?> <div id="wpfb-support-col"> <div id="wpfb-liking-toggle"></div> <h3><?php _e('Like WP-Filebase?', 'wp-filebase'); ?> </h3> <div id="wpfb-liking"> <!-- <div style="text-align: center;"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwordpress.org%2Fextend%2Fplugins%2Fwp-filebase%2F&send=false&layout=button_count&width=150&show_faces=false&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:140px; height:21px; display:inline-block; text-align:center;" <?php echo ' allowTransparency="true"'; ?> ></iframe></div> --> <div style="text-align: center;" ><a href="https://twitter.com/wpfilebase" class="twitter-follow-button" data-show-count="false">Follow @wpfilebase</a> <script type="text/javascript">!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div> <p>Please <a href="http://wordpress.org/support/view/plugin-reviews/wp-filebase">give it a good rating</a>.</p> <p>For Cloud support and lots of other advanced features consider an</p> <p style="text-align: center;"><a href="https://wpfilebase.com/?ref=dblike" class="button-primary">Upgrade to Pro</a></p> <p style="text-align: center;"><a href="http://demo.wpfilebase.com/?ref=dblike" class="button">Live Pro Demo</a></p> <p style="text-align:right;float:right;font-style:italic;">Thanks, Fabian</p> <!-- <div style="text-align: center;"> <?php //WPFB_Admin::PrintPayPalButton() ?> <?php //WPFB_Admin::PrintFlattrButton() ?> </div> --> </div> </div> <?php } ?> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> </div><!-- dashboard-widgets-wrap --> <?php break; case 'convert-tags': ?> <h2><?php _e('Tag Conversion'); ?> </h2><?php if (empty($_REQUEST['doit'])) { echo '<div class="updated"><p>'; _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.'); echo '</p></div>'; echo '<p><a href="' . add_query_arg('doit', 1) . '" class="button">' . __('Continue') . '</a></p>'; break; } $result = wpfb_call('Setup', 'ConvertOldTags'); ?> <p><?php printf(__('%d Tags in %d Posts has been converted.'), $result['n_tags'], count($result['tags'])); ?> </p> <ul> <?php if (!empty($result['tags'])) { foreach ($result['tags'] as $post_title => $tags) { echo "<li><strong>" . esc_html($post_title) . "</strong><ul>"; foreach ($tags as $old => $new) { echo "<li>{$old} => {$new}</li>"; } echo "</ul></li>"; } } ?> </ul> <?php if (!empty($result['errors'])) { ?> <h2><?php _e('Errors'); ?> </h2> <ul><?php foreach ($result['errors'] as $post_title => $err) { echo "<li><strong>" . esc_html($post_title) . ": </strong> " . esc_html($err) . "<ul>"; } ?> </ul> <?php } $opts = WPFB_Core::GetOpt(); unset($opts['tag_conv_req']); update_option(WPFB_OPT_NAME, $opts); WPFB_Core::$settings = (object) $opts; break; // convert-tags // convert-tags case 'del': if (!empty($_REQUEST['files']) && WPFB_Core::CurUserCanUpload()) { $ids = explode(',', $_REQUEST['files']); $nd = 0; foreach ($ids as $id) { $id = intval($id); if (($file = WPFB_File::GetFile($id)) != null && $file->CurUserCanDelete()) { $file->Remove(true); $nd++; } } WPFB_File::UpdateTags(); echo '<div id="message" class="updated fade"><p>' . sprintf(__('%d Files removed'), $nd) . '</p></div>'; } if (!empty($_REQUEST['cats']) && WPFB_Core::CurUserCanCreateCat()) { $ids = explode(',', $_REQUEST['cats']); $nd = 0; foreach ($ids as $id) { $id = intval($id); if (($cat = WPFB_Category::GetCat($id)) != null) { $cat->Delete(); $nd++; } } echo '<div id="message" class="updated fade"><p>' . sprintf(__('%d Categories removed'), $nd) . '</p></div>'; } case 'sync': echo '<h2>' . __('Synchronisation') . '</h2>'; wpfb_loadclass('Sync'); $result = WPFB_Sync::Sync(!empty($_GET['hash_sync']), true); if (!is_null($result)) { WPFB_Sync::PrintResult($result); } if (empty($_GET['hash_sync'])) { echo '<p><a href="' . add_query_arg('hash_sync', 1) . '" class="button">' . __('Complete file sync', 'wp-filebase') . '</a> ' . __('Checks files for changes, so more reliable but might take much longer. Do this if you uploaded/changed files with FTP.', 'wp-filebase') . '</p>'; } if (empty($_GET['debug'])) { echo '<p><a href="' . add_query_arg('debug', 1) . '" class="button">' . __('Debug Sync', 'wp-filebase') . '</a> ' . __('Run to get more Debug Info in case Sync crashes', 'wp-filebase') . '</p>'; } break; // sync // sync case 'batch-upload': wpfb_loadclass('BatchUploader'); $batch_uploader = new WPFB_BatchUploader(); $batch_uploader->Display(); break; case 'reset-hits': global $wpdb; $n = 0; if (current_user_can('manage_options')) { $n = $wpdb->query("UPDATE `{$wpdb->wpfilebase_files}` SET file_hits = 0 WHERE 1=1"); } echo "<p>"; printf(__('Done. %d Files affected.'), $n); echo "</p>"; break; case 'install-extensions': wpfb_call('AdmInstallExt', 'Display'); break; } // switch if (!empty($_GET['action'])) { echo '<p><a href="' . $clean_uri . '" class="button">' . __('Go back') . '</a></p>'; } ?> </div> <!-- wrap --> <?php }
/** * Displays page content. * * @return void */ protected function page_content() { require_once ABSPATH . 'wp-admin/includes/dashboard.php'; ?> <div id="dashboard-widgets-wrap"> <?php wp_dashboard(); ?> </div> <?php }