Beispiel #1
0
function fetch_xmlpairs($courseid)
{
    global $CFG;
    $pairs = fetch_pairs($courseid);
    $xml_output = "<pairsets>\n";
    foreach ($pairs as $pair) {
        $pairstreamname = rand(1000000, 9999999);
        $xml_output .= "\t<pair name='{$pairstreamname}' dirty='false'>\n";
        foreach ($pair as $pelement) {
            $user = get_record('user', 'username', $pelement['username']);
            $xml_output .= "\t\t<pairelement username='******'username'] . "' showname='" . $pelement['fullname'] . "' pictureurl='" . fetch_user_picture($user, 35) . "' />\n";
        }
        $xml_output .= "\t</pair>\n";
    }
    $xml_output .= "</pairsets>";
    //echo $xml_output;
    return $xml_output;
}
 function fetch_course_users($courseid)
 {
     global $CFG, $DB;
     //get course and require requester is logged in
     if (!($course = $DB->get_record('course', array('id' => $courseid)))) {
         print_error('invalidcourseid');
     }
     require_course_login($course);
     //fetch course context
     $coursecontext = \context_course::instance($courseid);
     //fetch user objects for all users in course
     //'u.id, u.username, u.firstname, u.lastname, u.picture'
     $users = get_users_by_capability($coursecontext, 'moodle/user:viewdetails');
     //usersummary variable
     $usersummary = "";
     //set up xml to return
     $xml_output = "<pairsets>\n";
     $pairstreamname = rand(1000000, 9999999);
     $xml_output .= "\t<pair name='{$pairstreamname}' dirty='false'>\n";
     //fill with user "pairelements"
     foreach ($users as $user) {
         $xml_output .= "\t\t<pairelement username='******' showname='" . fullname($user) . "' pictureurl='" . fetch_user_picture($user, 120) . "' />\n";
         if ($usersummary == "") {
             $usersummary .= $user->username;
         } else {
             $usersummary .= ";" . $user->username;
         }
     }
     //close our list of users in the pairset
     $xml_output .= "\t</pair>\n";
     //We also provide a summary of all the users in this course
     //so that the laszlo client doesn't need to xml divine it
     $xml_output .= "\t<usersummary>\n";
     $xml_output .= $usersummary;
     $xml_output .= "\t</usersummary>\n";
     $xml_output .= "</pairsets>";
     //Return the data
     return $xml_output;
 }
function fetch_pairclient($runtime, $chat = true, $whiteboard = true, $showvideo = false, $whiteboardback = "", $useroles = false)
{
    global $CFG, $USER, $COURSE;
    if (!empty($USER->username)) {
        $mename = $USER->username;
        $mefullname = fullname($USER);
        $mepictureurl = fetch_user_picture($USER, 120);
    } else {
        //this is meaningless currently, there is no current way to do pairs
        //with guest. Lets call it "casual poodllpairwork." Butin future it is possible
        $mename = "guest_" + rand(100000, 999999);
        $mefullname = "guest";
        $mepictureurl = "";
    }
    //Set the servername
    $flvserver = $CFG->poodll_media_server;
    //auto try ports
    $autotryports = $CFG->filter_poodll_autotryports == 1 ? "true" : "false";
    //in order that this works effectively on tokyo.poodll.com which services multiple Moodles
    //we should change courseid (which creates a kind of virtual "room") to use the domainname of Moodle server
    $courseid = $COURSE->id;
    $moodleid = fetch_moodleid();
    $baseUrl = $CFG->wwwroot . '/filter/poodll/flash/newpairclient.lzx.swf9.swf';
    $params = '?red5url=' . urlencode($flvserver) . '&mename=' . $mename . '&mefullname=' . $mefullname . '&mepictureurl=' . urlencode($mepictureurl) . '&chat=' . $chat . '&autotryports=' . $autotryports . '&courseid=' . $courseid . '&moodleid=' . $moodleid . '&useroles=' . $useroles . '&whiteboard=' . $whiteboard . '&whiteboardback=' . $whiteboardback . '&showvideo=' . $showvideo . '&teacherallstreamname=voiceofauthority&lzproxied=false';
    return $baseUrl . $params;
}
Beispiel #4
0
function fetch_course_users($courseid)
{
    global $CFG;
    //fetch user objects for all users in course
    $coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
    //'u.id, u.username, u.firstname, u.lastname, u.picture'
    $users = get_users_by_capability($coursecontext, 'moodle/course:view');
    //usersummary variable
    $usersummary = "";
    //set up xml to return
    $xml_output = "<pairsets>\n";
    $pairstreamname = rand(1000000, 9999999);
    $xml_output .= "\t<pair name='{$pairstreamname}' dirty='false'>\n";
    //fill with user "pairelements"
    foreach ($users as $user) {
        $xml_output .= "\t\t<pairelement username='******' showname='" . fullname($user) . "' pictureurl='" . fetch_user_picture($user, 120) . "' />\n";
        if ($usersummary == "") {
            $usersummary .= $user->username;
        } else {
            $usersummary .= ";" . $user->username;
        }
    }
    //close our list of users in the pairset
    $xml_output .= "\t</pair>\n";
    //We also provide a summary of all the users in this course
    //so that the laszlo client doesn't need to xml divine it
    $xml_output .= "\t<usersummary>\n";
    $xml_output .= $usersummary;
    $xml_output .= "\t</usersummary>\n";
    $xml_output .= "</pairsets>";
    //Return the data
    return $xml_output;
}
Beispiel #5
0
function poodll_callback($link)
{
    global $CFG, $COURSE, $USER;
    //get our filter props
    //we use a function in the poodll poodllresourcelib, because
    //parsing will also need to be done by the html editor
    $filterprops = fetch_filter_properties($link[0]);
    //if we have no props, quit
    if (empty($filterprops)) {
        return "";
    }
    //if we want to ignore the filter (for "how to use a filter" demos) we let it go
    //to use this, make the last parameter of the filter passthrough=1
    if (!empty($filterprops['passthrough'])) {
        return str_replace(",passthrough=1", "", $link[0]);
    }
    //Init our return variable
    $returnHtml = "";
    //depending on the type of filter
    switch ($filterprops['type']) {
        case 'video':
            //$returnHtml="<BR />" . fetchSimpleVideoPlayer($filterprops['path'],$filterprops['width'],$filterprops['height']);
            $returnHtml = "<BR />" . fetchSimpleVideoPlayer($filterprops['path'], !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_videowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_videoheight, !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['embed']) ? $filterprops['embed'] == 'true' : false, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['embedstring']) ? $filterprops['embedstring'] : 'Play');
            break;
        case 'wmvvideo':
            $returnHtml = "<BR />" . fetchWMVPlayer($filterprops['path'], !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_videowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_videoheight);
            break;
        case 'audio':
            $returnHtml = "<BR />" . fetchSimpleAudioPlayer($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_audiowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_audioheight, !empty($filterprops['embed']) ? $filterprops['embed'] == 'true' : false, !empty($filterprops['embedstring']) ? $filterprops['embedstring'] : 'Play');
            break;
        case 'audiolist':
            $returnHtml = "<BR />" . fetchAudioListPlayer($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 250, !empty($filterprops['sequentialplay']) ? $filterprops['sequentialplay'] : 'true');
            break;
        case 'audiotest':
            $returnHtml = "<BR />" . fetchAudioTestPlayer($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 50);
            break;
        case 'talkback':
            $returnHtml = "<BR />" . fetchTalkbackPlayer($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['recordable']) ? $filterprops['recordable'] : 'false', !empty($filterprops['savefolder']) ? $filterprops['savefolder'] : 'default');
            break;
        case 'bigvideogallery':
            $returnHtml = "<BR />" . fetchBigVideoGallery($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_biggallwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_biggallheight);
            break;
        case 'videorecorder':
            $returnHtml = "<BR />" . fetchSimpleVideoRecorder($filterprops['savefolder']);
            break;
        case 'audiorecorder':
            $returnHtml = "<BR />" . fetchSimpleAudioRecorder($filterprops['savefolder']);
            break;
        case 'calculator':
            $returnHtml = "<BR />" . fetch_poodllcalc(!empty($filterprops['width']) ? $filterprops['width'] : 300, !empty($filterprops['height']) ? $filterprops['height'] : 400);
            break;
        case 'teachersrecorder':
            $returnHtml = "<BR />" . fetch_teachersrecorder($filterprops['savepath'], "");
            break;
        case 'adminconsole':
            $returnHtml = "<BR />" . fetch_poodllconsole("", "billybob", -1, true);
            break;
        case 'countdown':
            $returnHtml = "<BR />" . fetch_countdowntimer($filterprops['initseconds'], !empty($filterprops['usepresets']) ? $filterprops['usepresets'] : 'false', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 265, !empty($filterprops['fontsize']) ? $filterprops['fontsize'] : 64, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['uniquename']) ? $filterprops['uniquename'] : 'auniquename');
            break;
        case 'counter':
            $returnHtml = "<BR />" . fetch_counter(!empty($filterprops['initcount']) ? $filterprops['initcount'] : 0, !empty($filterprops['usepresets']) ? $filterprops['usepresets'] : 'false', !empty($filterprops['width']) ? $filterprops['width'] : 480, !empty($filterprops['height']) ? $filterprops['height'] : 265, !empty($filterprops['fontsize']) ? $filterprops['fontsize'] : 64, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false);
            break;
        case 'dice':
            $returnHtml = "<BR />" . fetch_dice(!empty($filterprops['dicecount']) ? $filterprops['dicecount'] : 1, !empty($filterprops['dicesize']) ? $filterprops['dicesize'] : 200, !empty($filterprops['width']) ? $filterprops['width'] : 300, !empty($filterprops['height']) ? $filterprops['height'] : 300);
            break;
        case 'flashcards':
            $returnHtml = "<BR />" . fetch_flashcards($filterprops['cardset'], !empty($filterprops['cardwidth']) ? $filterprops['cardwidth'] : 300, !empty($filterprops['cardheight']) ? $filterprops['cardheight'] : 150, !empty($filterprops['randomize']) ? $filterprops['randomize'] : 'yes', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 300);
            break;
        case 'stopwatch':
            $returnHtml = "<BR />" . fetch_stopwatch(!empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 265, !empty($filterprops['fontsize']) ? $filterprops['fontsize'] : 64, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['uniquename']) ? $filterprops['uniquename'] : 'auniquename');
            break;
        case 'smallvideogallery':
            $returnHtml = "<BR />" . fetchSmallVideoGallery($filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_smallgallwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_smallgallheight, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false);
            break;
        case 'newpoodllpairwork':
            $returnHtml = "<BR />" . fetch_embeddablepairclient(!empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_newpairwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_newpairheight, !empty($filterprops['chat']) ? $filterprops['chat'] : true, !empty($filterprops['whiteboard']) ? $filterprops['whiteboard'] : false, !empty($filterprops['showvideo']) ? $filterprops['showvideo'] : false, !empty($filterprops['whiteboardback']) ? $filterprops['whiteboardback'] : '');
            break;
        case 'screensubscribe':
            $returnHtml = "<BR />" . fetch_screencast_subscribe("", true, !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_showwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_showheight);
            break;
        case 'poodllpalette':
            $returnHtml = "<BR />" . fetch_poodllpalette($filterprops['width'], $filterprops['height']);
            break;
        case 'whiteboard':
            $returnHtml = "<BR />" . fetch_whiteboard(!empty($filterprops['boardname']) ? $filterprops['boardname'] : "whiteboard", !empty($filterprops['backimage']) ? $filterprops['backimage'] : "", !empty($filterprops['slave']) && $filterprops['slave'] == 'true' ? $filterprops['slave'] : false, !empty($filterprops['rooms']) ? $filterprops['rooms'] : "", !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_whiteboardwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_whiteboardheight, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['standalone']) && $filterprops['standalone'] == 'true' ? $filterprops['standalone'] : 'false');
            break;
        case 'poodllpairwork':
            $courseid = $COURSE->id;
            $username = $USER->username;
            $poodllpairworkplayer = "";
            $studentalias = "";
            $pairmap = "";
            if ($pairmap = get_record("poodllpairwork_usermap", "username", $username, "course", $courseid)) {
                $studentalias = $pairmap->role;
            }
            //if we have a role and hence a session.
            if ($studentalias != "") {
                $me = get_record('user', 'username', $username);
                $partner = get_record('user', 'username', $pairmap->partnername);
                $partnerpic = fetch_user_picture($partner, 35);
                $mepic = fetch_user_picture($me, 35);
                $poodllpairworkplayer = "<h4>" . get_string("yourpartneris", "poodllpairwork") . fullname($partner) . "</h4>";
                $poodllpairworkplayer .= fetchPairworkPlayer($pairmap->username, $pairmap->partnername, $mepic, fullname($me), $partnerpic, fullname($partner));
            }
            $returnHtml = "<BR />" . $poodllpairworkplayer;
            break;
        default:
    }
    //return our html
    return $returnHtml;
}
Beispiel #6
0
function filter_poodll_callback(array $link)
{
    global $CFG, $COURSE, $USER;
    ///$PAGE->requires->js_init_call('M.filter_poodll.init', array());
    //get our filter props
    //we use a function in the poodll poodllresourcelib, because
    //parsing will also need to be done by the html editor
    $filterprops = fetch_filter_properties($link[0]);
    //if we have no props, quit
    if (empty($filterprops)) {
        return "";
    }
    //if we want to ignore the filter (for "how to use a filter" demos) we let it go
    //to use this, make the last parameter of the filter passthrough=1
    if (!empty($filterprops['passthrough'])) {
        return str_replace(",passthrough=1", "", $link[0]);
    }
    //Init our return variable
    $returnHtml = "";
    //Runtime JS or Flash
    if (empty($filterprops['runtime'])) {
        $filterprops['runtime'] = 'auto';
    }
    //depending on the type of filter
    switch ($filterprops['type']) {
        case 'adminconsole':
            $returnHtml = fetch_poodllconsole($filterprops['runtime']);
            break;
        case 'audio':
            $returnHtml = fetchSimpleAudioPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_audiowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_audioheight, !empty($filterprops['embed']) ? $filterprops['embed'] == 'true' : false, !empty($filterprops['embedstring']) ? $filterprops['embedstring'] : 'Play', false, !empty($filterprops['usepoodlldata']) ? $filterprops['usepoodlldata'] == 'true' : false, !empty($filterprops['splashurl']) ? $filterprops['splashurl'] : '');
            break;
        case 'audiolist':
            $returnHtml = fetchAudioListPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['filearea']) ? $filterprops['filearea'] : 'content', !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 250, !empty($filterprops['sequentialplay']) ? $filterprops['sequentialplay'] : 'true', !empty($filterprops['player']) ? $filterprops['player'] : $CFG->filter_poodll_defaultplayer, !empty($filterprops['showplaylist']) ? $filterprops['showplaylist'] == 'true' : true, !empty($filterprops['usepoodlldata']) ? $filterprops['usepoodlldata'] == 'true' : false);
            break;
        case 'audiorecorder':
            $returnHtml = fetchSimpleAudioRecorder($filterprops['runtime'], !empty($filterprops['savefolder']) ? $filterprops['savefolder'] : '');
            break;
        case 'audiotest':
            $returnHtml = fetchAudioTestPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 50, !empty($filterprops['filearea']) ? $filterprops['filearea'] : 'content', !empty($filterprops['usepoodlldata']) ? $filterprops['usepoodlldata'] == 'true' : false);
            break;
        case 'talkback':
            $returnHtml = fetchTalkbackPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['recordable']) ? $filterprops['recordable'] : 'false', !empty($filterprops['savefolder']) ? $filterprops['savefolder'] : 'default');
            break;
        case 'bigvideogallery':
            $returnHtml = fetchBigVideoGallery($filterprops['runtime'], $filterprops['path'], !empty($filterprops['filearea']) ? $filterprops['filearea'] : 'content', !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'http', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_biggallwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_biggallheight, !empty($filterprops['usepoodlldata']) ? $filterprops['usepoodlldata'] == 'true' : false);
            break;
        case 'calculator':
            $returnHtml = fetch_poodllcalc($filterprops['runtime'], !empty($filterprops['width']) ? $filterprops['width'] : 300, !empty($filterprops['height']) ? $filterprops['height'] : 400, !empty($filterprops['size']) ? $filterprops['size'] : 'normal');
            break;
        case 'cambroadcaster':
            $returnHtml = fetchCamBroadcaster($filterprops['runtime'], !empty($filterprops['mename']) ? $filterprops['mename'] : '', !empty($filterprops['broadcastkey']) ? $filterprops['broadcastkey'] : '1234567');
            break;
        case 'countdown':
            $returnHtml = fetch_countdowntimer($filterprops['runtime'], $filterprops['initseconds'], !empty($filterprops['usepresets']) ? $filterprops['usepresets'] : 'false', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 300, !empty($filterprops['fontheight']) ? $filterprops['fontheight'] : 64, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['uniquename']) ? $filterprops['uniquename'] : 'auniquename');
            break;
        case 'counter':
            $returnHtml = fetch_counter($filterprops['runtime'], !empty($filterprops['initcount']) ? $filterprops['initcount'] : 0, !empty($filterprops['usepresets']) ? $filterprops['usepresets'] : 'false', !empty($filterprops['width']) ? $filterprops['width'] : 480, !empty($filterprops['height']) ? $filterprops['height'] : 265, !empty($filterprops['fontheight']) ? $filterprops['fontheight'] : 64, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false);
            break;
        case 'dice':
            $returnHtml = fetch_dice($filterprops['runtime'], !empty($filterprops['dicecount']) ? $filterprops['dicecount'] : 1, !empty($filterprops['dicesize']) ? $filterprops['dicesize'] : 200, !empty($filterprops['width']) ? $filterprops['width'] : 600, !empty($filterprops['height']) ? $filterprops['height'] : 300);
            break;
        case 'explorer':
            $returnHtml = fetch_explorer($filterprops['runtime'], !empty($filterprops['width']) ? $filterprops['width'] : 1250, !empty($filterprops['height']) ? $filterprops['height'] : 800, !empty($filterprops['moduleid']) ? $filterprops['moduleid'] : '');
            break;
        case 'flashcards':
            $returnHtml = fetch_flashcards($filterprops['runtime'], !empty($filterprops['cardset']) ? $filterprops['cardset'] : -1, !empty($filterprops['qname']) ? $filterprops['qname'] : "", !empty($filterprops['frontcolor']) ? $filterprops['frontcolor'] : "0xDDDDDD", !empty($filterprops['backcolor']) ? $filterprops['backcolor'] : "0x000000", !empty($filterprops['cardwidth']) ? $filterprops['cardwidth'] : 300, !empty($filterprops['cardheight']) ? $filterprops['cardheight'] : 150, !empty($filterprops['randomize']) ? $filterprops['randomize'] : 'yes', !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 300);
            break;
        case 'miniplayer':
            $returnHtml = fetch_miniplayer($filterprops['runtime'], $filterprops['url'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'http', !empty($filterprops['imageurl']) ? $filterprops['imageurl'] : '', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_miniplayerwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_miniplayerwidth, !empty($filterprops['iframe']) ? $filterprops['iframe'] == 'true' : false);
            break;
        case 'onceplayer':
            $returnHtml = fetch_onceplayer($filterprops['runtime'], $filterprops['url'], !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'http', !empty($filterprops['width']) ? $filterprops['width'] : 0, !empty($filterprops['height']) ? $filterprops['height'] : 0, !empty($filterprops['iframe']) ? $filterprops['iframe'] == 'true' : false);
            break;
        case 'newpoodllpairwork':
            $returnHtml = fetch_embeddablepairclient($filterprops['runtime'], !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_newpairwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_newpairheight, !empty($filterprops['chat']) ? $filterprops['chat'] : true, !empty($filterprops['whiteboard']) ? $filterprops['whiteboard'] : false, !empty($filterprops['showvideo']) ? $filterprops['showvideo'] : false, !empty($filterprops['whiteboardback']) ? $filterprops['whiteboardback'] : '');
            break;
        case 'stopwatch':
            $returnHtml = fetch_stopwatch($filterprops['runtime'], !empty($filterprops['width']) ? $filterprops['width'] : 400, !empty($filterprops['height']) ? $filterprops['height'] : 265, !empty($filterprops['fontheight']) ? $filterprops['fontheight'] : 64, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['uniquename']) ? $filterprops['uniquename'] : 'auniquename');
            break;
        case 'smallvideogallery':
            $returnHtml = fetchSmallVideoGallery($filterprops['runtime'], $filterprops['path'], !empty($filterprops['filearea']) ? $filterprops['filearea'] : 'content', !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'http', !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_smallgallwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_smallgallheight, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['usepoodlldata']) ? $filterprops['usepoodlldata'] == 'true' : false);
            break;
        case 'screensubscribe':
            $returnHtml = fetch_screencast_subscribe($filterprops['runtime'], !empty($filterprops['mename']) ? $filterprops['mename'] : '', true, !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_showwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_showheight, !empty($filterprops['broadcastkey']) ? $filterprops['broadcastkey'] : '1234567');
            break;
        case 'poodllpalette':
            $returnHtml = fetch_poodllpalette($filterprops['runtime'], $filterprops['width'], $filterprops['height'], "swf");
            break;
        case 'wordplayer':
            $returnHtml = fetch_wordplayer($filterprops['runtime'], $filterprops['url'], $filterprops['word'], !empty($filterprops['fontsize']) ? $filterprops['fontsize'] : $CFG->filter_poodll_wordplayerfontsize, !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'http', !empty($filterprops['width']) ? $filterprops['width'] : "0", !empty($filterprops['height']) ? $filterprops['height'] : "0", !empty($filterprops['iframe']) ? $filterprops['iframe'] == 'true' : false);
            break;
        case 'whiteboard':
            $returnHtml = fetch_whiteboard($filterprops['runtime'], !empty($filterprops['boardname']) ? $filterprops['boardname'] : "whiteboard", !empty($filterprops['backimage']) ? $filterprops['backimage'] : "", !empty($filterprops['slave']) && $filterprops['slave'] == 'true' ? $filterprops['slave'] : false, !empty($filterprops['rooms']) ? $filterprops['rooms'] : "", !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_whiteboardwidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_whiteboardheight, !empty($filterprops['mode']) ? $filterprops['mode'] : 'normal', !empty($filterprops['standalone']) && $filterprops['standalone'] == 'true' ? $filterprops['standalone'] : 'false');
            break;
        case 'poodllpairwork':
            $courseid = $COURSE->id;
            $username = $USER->username;
            $poodllpairworkplayer = "";
            $studentalias = "";
            $pairmap = "";
            if ($pairmap = get_record("poodllpairwork_usermap", "username", $username, "course", $courseid)) {
                $studentalias = $pairmap->role;
            }
            //if we have a role and hence a session.
            if ($studentalias != "") {
                $me = get_record('user', 'username', $username);
                $partner = get_record('user', 'username', $pairmap->partnername);
                $partnerpic = fetch_user_picture($partner, 35);
                $mepic = fetch_user_picture($me, 35);
                $poodllpairworkplayer = "<h4>" . get_string("yourpartneris", "poodllpairwork") . fullname($partner) . "</h4>";
                $poodllpairworkplayer .= fetchPairworkPlayer($pairmap->username, $pairmap->partnername, $mepic, fullname($me), $partnerpic, fullname($partner));
            }
            $returnHtml = $poodllpairworkplayer;
            break;
        case 'quizlet':
            $returnHtml = fetch_quizlet($filterprops['id'], !empty($filterprops['title']) ? $filterprops['title'] : 'quizlet', !empty($filterprops['mode']) ? $filterprops['mode'] : 'familiarize', !empty($filterprops['width']) ? $filterprops['width'] : '100%', !empty($filterprops['height']) ? $filterprops['height'] : '310');
            break;
        case 'scrollerstart':
            $returnHtml = fetch_poodllscroller(true, !empty($filterprops['width']) ? $filterprops['width'] : '400', !empty($filterprops['height']) ? $filterprops['height'] : '200', !empty($filterprops['speed']) ? $filterprops['speed'] : '10', !empty($filterprops['repeat']) ? $filterprops['repeat'] : 'yes', !empty($filterprops['axis']) ? $filterprops['axis'] : 'y', !empty($filterprops['pixelshift']) ? $filterprops['pixelshift'] : '2');
            break;
        case 'scrollerstop':
            $returnHtml = fetch_poodllscroller(false);
            break;
        case 'sliderocket':
            $returnHtml = fetch_sliderocket($filterprops['id'], !empty($filterprops['width']) ? $filterprops['width'] : '400', !empty($filterprops['height']) ? $filterprops['height'] : '326');
            break;
        case 'snapshot':
            $returnHtml = fetchSnapshotCamera(!empty($filterprops['updatecontrol']) ? $filterprops['updatecontrol'] : 'filename', !empty($filterprops['filename']) ? $filterprops['filename'] : 'filename', !empty($filterprops['width']) ? $filterprops['width'] : '350', !empty($filterprops['height']) ? $filterprops['height'] : '400');
            break;
        case 'teachersrecorder':
            $returnHtml = fetch_teachersrecorder($filterprops['runtime'], $filterprops['savepath'], "");
            break;
        case 'videorecorder':
            $returnHtml = fetchSimpleVideoRecorder($filterprops['runtime'], !empty($filterprops['savefolder']) ? $filterprops['savefolder'] : '');
            break;
        case 'video':
            //$returnHtml= fetchSimpleVideoPlayer($filterprops['path'],$filterprops['width'],$filterprops['height']);
            $returnHtml = fetchSimpleVideoPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_videowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_videoheight, !empty($filterprops['protocol']) ? $filterprops['protocol'] : 'rtmp', !empty($filterprops['embed']) ? $filterprops['embed'] == 'true' : false, !empty($filterprops['permitfullscreen']) ? $filterprops['permitfullscreen'] : false, !empty($filterprops['embedstring']) ? $filterprops['embedstring'] : 'Play', !empty($filterprops['splashurl']) ? $filterprops['splashurl'] : '');
            break;
        case 'wmvvideo':
            $returnHtml = fetchWMVPlayer($filterprops['runtime'], $filterprops['path'], !empty($filterprops['width']) ? $filterprops['width'] : $CFG->filter_poodll_videowidth, !empty($filterprops['height']) ? $filterprops['height'] : $CFG->filter_poodll_videoheight);
            break;
        default:
    }
    //return our html
    return $returnHtml;
}
Beispiel #7
0
 * @package poodllpairwork
 **/
//to call the poodllpairworkplayer from media resource lib: justin 20090209
require_once $CFG->libdir . '/poodllresourcelib.php';
//Include backend and form related actions
include "{$CFG->dirroot}/mod/poodllpairwork/playviewcontroller.php";
//If we are sessioning based on usermap then
//we should have a pairmap retrieved in playviewcontroller.
//So here we just fetch the player
$pairworkplayer = "";
if ($pairwork->sessiontype == SESSIONTYPE_USERNAME) {
    //if we have a role and hence a session.
    if ($studentalias != "") {
        $partner = get_record('user', 'username', $pairmap->partnername);
        $partnerpic = fetch_user_picture($partner, 35);
        $mepic = fetch_user_picture($USER, 35);
        $pairworkplayer = "<h4>" . get_string("yourpartneris", "poodllpairwork") . fullname($partner) . "</h4>";
        $pairworkplayer .= fetchPairworkPlayer($pairmap->username, $pairmap->partnername, $mepic, fullname($USER), $partnerpic, fullname($partner));
        //if we don't have a role and so there is no session(at least not for us).
    } else {
        //To Do Justin 20100522 :
        //It works but there are no hooks to control the absence presence of whiteboard or chat and the toggling only works for b partner
        //we also still need to fill in the src with a linl to poodlllogiclib to fethc bacht the introa and introb html .
        //srcfor the a user needs to deliver back the equiv of echo format_text($pairwork->introa, FORMAT_HTML);
        //srcfor the b user needs to deliver back the equiv of echo format_text($pairwork->introb, FORMAT_HTML);
        //the sizing of the iframe has not been figured out yet either.
        //==========================================================================================
        //for now you can do most things buy dropping a pairwork filter string in the main pairwork intro
        echo format_text($pairwork->intro, FORMAT_HTML);
        echo "<br/>";
        //$pairworkplayer =fetch_pairclient(false,true,false,"",true);
Beispiel #8
0
    print_string('clearsession', 'poodllpairwork');
    ?>
" onclick="document.forms['session'].what.value = 'clearsession' ; document.forms['session'].submit()" /></p>

<?php 
} else {
    print_simple_box(get_string('nosession', 'poodllpairwork'));
}
if (empty($users)) {
    print_simple_box(get_string('nousers', 'poodllpairwork'));
} else {
    echo "<center><table width='40%' border=1 bgcolor='#cfcfcf' cellpadding='2' cellspacing='2'>";
    echo "<tr><td colspan='2' forecolor='#ffffff' bgcolor='#x25BA'>" . get_string('unassignedusers', 'poodllpairwork') . " ( " . count($users) . " )</td></tr>";
    $odd = true;
    foreach ($users as $user) {
        $apic = "<img src='" . fetch_user_picture($user, 35) . "'/><br />";
        if ($odd) {
            echo "<tr><td width='50%' align='center'>" . $apic . fullname($user) . "</td>";
        } else {
            echo "<td width='50%' align='center'>" . $apic . fullname($user) . "</td></tr>";
        }
        $odd = !$odd;
    }
    if (!$odd) {
        echo "</td></tr>";
    }
    echo "</table>";
    ?>

<p>	<input type="button" name="go" value="<?php 
    print_string('addsession', 'poodllpairwork');
Beispiel #9
0
function fetch_pairclient($chat = true, $whiteboard = true, $showvideo = false, $whiteboardback = "", $useroles = false)
{
    global $CFG, $USER, $COURSE;
    if (!empty($USER->username)) {
        $mename = $USER->username;
        $mefullname = fullname($USER);
        $mepictureurl = fetch_user_picture($USER, 120);
    } else {
        //this is meaningless currently, there is no current way to do pairs
        //with guest. Lets call it "casual poodllpairwork." Butin future it is possible
        $mename = "guest_" + rand(100000, 999999);
        $mefullname = "guest";
        $mepictureurl = "";
    }
    //Set the servername
    $flvserver = $CFG->poodll_media_server;
    //Work out the course id to use and the url stub for the imageurl
    if ($CFG->filter_poodll_usecourseid) {
        $basefile = $CFG->wwwroot . "/file.php/" . $COURSE->id . "/";
        $courseid = $COURSE->id;
    } else {
        $basefile = $CFG->wwwroot . "/file.php/";
        $courseid = "";
    }
    //Complete the image url
    if ($whiteboardback != "") {
        $whiteboardback = $basefile . $whiteboardback;
    }
    $baseUrl = $CFG->wwwroot . '/filter/poodll/flash/newpairclient.lzx.swf10.swf';
    $params = '?red5url=' . urlencode($flvserver) . '&mename=' . $mename . '&mefullname=' . $mefullname . '&mepictureurl=' . $mepictureurl . '&chat=' . $chat . '&useroles=' . $useroles . '&whiteboard=' . $whiteboard . '&whiteboardback=' . $whiteboardback . '&showvideo=' . $showvideo . '&courseid=' . $COURSE->id . '&teacherallstreamname=voiceofauthority&lzproxied=false';
    return $baseUrl . $params;
}