Example #1
0
}
$module->page_title = _l('Inbox');
$header = array('title' => _l('Social Inbox'), 'type' => 'h2', 'main' => true, 'button' => array());
if (module_social::can_i('create', 'Facebook Comments', 'Social', 'social') || module_social::can_i('create', 'Twitter Comments', 'Social', 'social')) {
    $header['button'] = array('url' => module_social::link_open_compose(), 'title' => _l('Compose'), 'type' => 'add');
}
print_heading($header);
// 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['status'])) {
    $search['status'] = _SOCIAL_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.
$message_managers = module_social::get_message_managers();
/* @var $message_manager ucm_facebook */
foreach ($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 ($message_managers as $type => $message_manager) {
        if (!isset($loop_messages[$type])) {
            $loop_messages[$type] = $message_manager->get_next_message();
            if ($loop_messages[$type]) {