Ejemplo n.º 1
0
/**
 * Returns an implementation based on data from the POST
 * @return   FBMLImplementation
 * @param string $s_context generally this would be $_POST['fb_mockajax_context']
 * @param string $h_context generally this would be $_POST['fb_mockajax_context_hash']
 */
function fbml_mock_ajax_get_impl($s_context, $h_context)
{
    // null means get the latest implementation version
    $context = FBMLContext::unmarshall_($s_context, $h_context);
    // The user has presumably triggered this event so we can do
    // all sort of things like show iframes and do autoplay, etc.
    $flavor = $context->_flavor;
    $flavor->_fbml_env['user_triggered'] = true;
    $flavor->_fbml_env['image_cache'] = null;
    $flavor->_fbml_env['ajax_triggered'] = true;
    // This is only applicable to a mock-ajax call from a dialog box,
    // and if the return fbml contains dialog-response.
    if ($flavor->check('dialog_response')) {
        $flavor->_fbml_env['is_dialog_response'] = true;
    }
    return new FBJSEnabledFacebookImplementation($flavor);
}