copyAd($ad->id); } } Advman_Admin::add_notice('advman-notice-once', __("Ads copied"), false); break; case 'delete' : foreach ($ads as $ad) { if ($ad) { $advman_engine->deleteAd($ad->id); } } Advman_Admin::add_notice('advman-notice-once', __("Ads deleted"), false); break; } } } else { $ad = Advman_Tools::get_current_ad(); if ($ad) { Advman_Admin::ad_action($action, $ad); } } $url = remove_query_arg(array('action', 'ad', 'network', '_wpnonce')); wp_redirect($url); } } static function ad_analytics_action($action) { global $advman_engine; // First, if there are no ads, redirect to the create screen $ads = $advman_engine->getAds(); if (!$ads) { wp_redirect(admin_url('admin.php?page=advman-ad-new')); } } static function process() { global $advman_analytics; $q = Advman_Tools::get_search_query(); echo '

' . __('Analytics', 'advman'); if (!empty($q)) printf( ' ' . __('Search results for “%s”', 'advman') . '', $q ); echo '

'; $advman_analytics->views(); $advman_analytics->prepare_items(); ?>
search_box( 'search', 'ad' ); ?>
display(); ?>
'; echo '.wp-list-table .column-id { width: 5%; }'; echo '.wp-list-table .column-name { width: 30%; }'; echo '.wp-list-table .column-type { width: 15%; }'; echo '.wp-list-table .column-format { width: 15%; }'; echo '.wp-list-table .column-active { width: 10%; }'; echo '.wp-list-table .column-def { width: 10%; }'; echo '.wp-list-table .column-date { width: 15%; }'; echo ''; } /** * Add contextual help for ad list screen */ static function add_contextual_help() { get_current_screen()->add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), 'content' => '

' . __('This screen shows performance of ads running on your site. Select the timeframe that you want to view, and all ads that were shown during that timeframe will appear below.') . '

' ) ); get_current_screen()->add_help_tab( array( 'id' => 'screen-content', 'title' => __('Screen Content'), 'content' => '

' . __('You can customize the display of this screen’s contents in a number of ways:') . '

' . '' ) ); get_current_screen()->set_help_sidebar( '

' . __('For more information:') . '

' . '

' . __('Plugin Page') . '

' . '

' . __('Support Forums') . '

' ); } static function add_options() { $option = 'per_page'; $args = array( 'label' => 'Ads', 'default' => 10, 'option' => 'ads_per_page' ); add_screen_option( $option, $args ); } } ?>