Exemple #1
0
if (empty($per_page) || $per_page < 1 || is_array($per_page)) {
    // get the default value if none is set
    $per_page = $screen->get_option('per_page', 'default');
}
if (!$per_page) {
    $per_page = 20;
}
$myListTable->items_per_page = $per_page;
$myListTable->set_columns(array('cb' => 'Select All', 'shub_column_account' => __('Account', 'support_hub'), 'shub_column_product' => __('Product', 'support_hub'), 'shub_column_time' => __('Time', 'support_hub'), 'shub_column_from' => __('From', 'support_hub'), 'shub_column_summary' => __('Summary', 'support_hub'), 'shub_column_action' => __('Action', 'support_hub')));
/*$myListTable->set_sortable_columns( array(
		'shub_column_time'    => array(
            'shub_column_time',
            1
        ),
	) );*/
$myListTable->process_bulk_action();
// before we do the search on messages.
$this_search = $search;
if (isset($this_search['shub_status']) && $this_search['shub_status'] == -1) {
    unset($this_search['shub_status']);
}
//    SupportHub::getInstance()->load_all_messages($this_search, $order);
//    $all_messages = SupportHub::getInstance()->all_messages;
$all_messages = array_merge(SupportHubOutbox::get_failed(), SupportHubOutbox::get_pending());
$limit_pages = 2;
// get about 10 pages of data to display in WordPress.
$has_more = false;
if (count($all_messages) >= $myListTable->get_pagenum() * $myListTable->items_per_page + $limit_pages * $myListTable->items_per_page) {
    $has_more = true;
    // a flag so we can show "more" in the pagination listing.
}