示例#1
0
function fetchJSWidgetCode($widget, $params, $width, $height, $bgcolor = "#FFFFFF")
{
    global $CFG;
    $widgetid = html_writer::random_id('laszlobase');
    $widgetjson = \filter_poodll\poodlltools::fetchJSWidgetJSON($widget, $params, $width, $height, $bgcolor = "#FFFFFF", $widgetid);
    $retcode = html_writer::div('', '', array('id' => $widgetid . 'Container'));
    $pathtoJS = $CFG->wwwroot . '/filter/poodll/js/';
    $retcode .= '<script type="text/javascript" src="' . $pathtoJS . 'lps/includes/embed-compressed.js"></script>
        <script type="text/javascript"> lz.embed.dhtml(' . $widgetjson . ')</script>';
    return $retcode;
}