Пример #1
0
function fbml_sample_parse($fbml_from_callback, $fbml_impl)
{
    // Preconfigure the FBML engine so it knows which FBML tags
    // to look for, which HTML tags require special rendering, which
    // tags require precaching, and so forth.
    $fbml_tags = $fbml_impl->get_all_fb_tag_names();
    $html_special = $fbml_impl->get_special_html_tags();
    $precache_tags = $fbml_impl->get_precache_tags();
    $style_tags = array('style');
    $style_attrs = array('style', 'imgstyle');
    $rewrite_attrs = array('name', 'for', 'href', 'src', 'background', 'url', 'dynsrc', 'lowsrc', 'clickrewriteurl', 'onclick', 'onmouseover', 'onabort', 'onblur', 'ondblclick', 'onerror', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmousewheel', 'onmouseup', 'onreset', 'onresize', 'onselect', 'onsubmit', 'onunload', 'onchange');
    $special_attrs = array('id');
    $fbml_attrs = array_merge($style_attrs, $rewrite_attrs, $special_attrs);
    $fbml_schema = schema_get_schema();
    fbml_complex_expand_tag_list_11($fbml_tags, $fbml_attrs, $html_special, $precache_tags, $style_tags, $style_attrs, array(), $rewrite_attrs, $special_attrs, $fbml_schema);
    $data = array('impl' => $fbml_impl);
    $rewriter = array('func' => 'fbml_rewrite_attr', 'data' => $fbml_impl);
    // FBOPEN:NOTE - no css sanitizer incorporated in this version.
    $sanitizer = array();
    $parse_tree = fbml_parse_opaque_11($fbml_from_callback, true, false, false, $sanitizer, array(), $rewriter);
    $fbml_tree = new FBMLNode($parse_tree['root']);
    $fbml_tree->precache($fbml_impl);
    $html = $fbml_tree->render_html($fbml_impl);
    return $html;
}
Пример #2
0
function complex_expand_tag($tags, $attrs, $tag_flags, $attr_flags, $schema)
{
    //var_dump($tags, $attrs);
    //var_dump($tag_flags, $attr_flags, $schema, get($attr_flags,'special'));
    fbml_complex_expand_tag_list_11($tags, $attrs, get($tag_flags, 'special'), get($tag_flags, 'precache'), get($tag_flags, 'style'), get($attr_flags, 'style'), get($attr_flags, 'script'), get($attr_flags, 'rewrite'), get($attr_flags, 'special'), $schema);
}