// so we can loop through them on the global messages combined page. $myListTable = new SupportHubMessageList(); $screen = get_current_screen(); // retrieve the "per_page" option $screen_option = $screen->get_option('per_page', 'option'); // retrieve the value of the option stored for the current user $per_page = get_user_meta(get_current_user_id(), $screen_option, true); 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());
_e('Compose', 'support_hub'); ?> </a> </h2> <?php // copy layout from UCM // grab a mysql resource from all available social plugins (hardcoded for now - todo: hook) $search = isset($_REQUEST['search']) && is_array($_REQUEST['search']) ? $_REQUEST['search'] : array(); if (!isset($search['shub_status'])) { $search['shub_status'] = _shub_MESSAGE_STATUS_UNANSWERED; } $order = array(); // retuin a combined copy of all available messages, based on search, as a MySQL resource // so we can loop through them on the global messages combined page. $myListTable = new SupportHubMessageList(); $myListTable->set_columns(array('cb' => '', 'shub_column_account' => __('Social Account', 'support_hub'), 'shub_column_time' => __('Date/Time', 'support_hub'), 'shub_column_from' => __('From', 'support_hub'), 'shub_column_summary' => __('Summary', 'support_hub'), 'shub_column_action' => __('Action', 'support_hub'))); $myListTable->process_bulk_action(); // before we do the search on messages. /* @var $message_manager shub_facebook */ foreach ($this->message_managers as $message_id => $message_manager) { $message_manager->load_all_messages($search, $order); } // filter through each mysql resource so we get the date views. output each row using their individual classes. $all_messages = array(); $loop_messages = array(); $last_timestamp = false; while (true) { // fill them up $has_messages = false; foreach ($this->message_managers as $type => $message_manager) { if (!isset($loop_messages[$type])) {