public function fetch_recorder() { global $USER, $CFG; // $usercontextid = get_context_instance(CONTEXT_USER, $USER->id)->id; // $draftitemid=0; // $ret = '<form name="poodll_repository" action="' . $CFG->wwwroot . '/repository/poodll/recorder.php">'; switch ($this->options['recording_format']) { case 0: $ret = fetchSimpleAudioRecorder('swf', 'poodllrepository', $USER->id, 'filename'); break; case 1: $ret = fetchSimpleVideoRecorder('swf', 'poodllrepository', $USER->id, 'filename', '', '298', '340'); break; case 3: //this is the mp3 recorder, but we should not enter this function anyway in that case $ret = $this->fetchMP3PostRecorder("filename", "apic.jpg", '290', '340'); break; case 2: $ret = fetchSnapshotCamera("filename", "apic.jpg", '290', '340'); break; } echo $ret; }
public function fetch_recorder() { global $USER, $CFG; $ret = ""; //we get necessary info $context = get_context_instance(CONTEXT_USER, $USER->id); $filename = 'filename' . '_' . $this->options['recording_format']; if (isMobile()) { //if(true){ switch ($this->options['recording_format']) { case self::POODLLAUDIO: case self::POODLLVIDEO: case self::MP3AUDIO: //we load up the file upload HTML5 $ret .= fetch_HTML5RecorderForSubmission($filename, $context->id, "user", "draft", "0", "video", true); break; case self::POODLLWHITEBOARD: case self::POODLLSNAPSHOT: //we load up the file upload HTML5 $ret .= fetch_HTML5RecorderForSubmission($filename, $context->id, "user", "draft", "0", "image", true); break; } //end of switch //we need a dummy M object so we can reuse module js here $ret .= "<script type='text/javascript'>"; $ret .= "var M = new Object();"; $ret .= "</script>"; //we load the poodll filter module JS for the HTML5 recording logic $ret .= "<script type=\"text/javascript\" src=\"{$CFG->wwwroot}/filter/poodll/module.js\"></script> "; //this calls the script we loaded just above, after we have a fileupload area to attach events to $ret .= "<script type='text/javascript'>"; $ret .= "M.filter_poodll.loadmobileupload(0,0);"; $ret .= "</script>"; echo $ret; return; } //end of if is mobile // $usercontextid = get_context_instance(CONTEXT_USER, $USER->id)->id; // $draftitemid=0; // $ret .= '<form name="poodll_repository" action="' . $CFG->wwwroot . '/repository/poodll/recorder.php">'; // $filename = 'filename' . '_' . $this->options['recording_format'] ; switch ($this->options['recording_format']) { case self::POODLLAUDIO: $ret .= fetchSimpleAudioRecorder('swf', 'poodllrepository', $USER->id, $filename); break; case self::POODLLVIDEO: $ret .= fetchSimpleVideoRecorder('swf', 'poodllrepository', $USER->id, $filename, '', '298', '340'); break; case self::MP3AUDIO: //this is the mp3 recorder, by Paul Nichols //$ret = $this->fetchMP3PostRecorder("filename","apic.jpg", '290','340'); //$ret = fetchMP3RecorderForRepo("filename"); //$context = get_context_instance(CONTEXT_USER, $USER->id); $ret .= fetchMP3RecorderForSubmission($filename, $context->id, "user", "draft", "0"); break; case self::POODLLWHITEBOARD: //$context = get_context_instance(CONTEXT_USER, $USER->id); $ret .= fetchWhiteboardForSubmission($filename, $context->id, "user", "draft", "0", 510, 370); break; case self::POODLLSNAPSHOT: //$context = get_context_instance(CONTEXT_USER, $USER->id); $ret .= fetchSnapshotCameraForSubmission($filename, "apic.jpg", '290', '340', $context->id, "user", "draft", "0"); break; } echo $ret; }
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; }
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; }
function definition() { //--------------- ENHANCED POODLL FORUM BEGIN ------------------- //global $CFG; global $CFG, $COURSE, $USER; //--------------- ENHANCED POODLL FORUM END ------------------- $mform =& $this->_form; $course = $this->_customdata['course']; $cm = $this->_customdata['cm']; $coursecontext = $this->_customdata['coursecontext']; $modcontext = $this->_customdata['modcontext']; $forum = $this->_customdata['forum']; $post = $this->_customdata['post']; // hack alert // the upload manager is used directly in post precessing, moodleform::save_files() is not used yet $this->set_upload_manager(new upload_manager('attachment', true, false, $course, false, $forum->maxbytes, true, true)); $mform->addElement('header', 'general', ''); //fill in the data depending on page params //later using set_data $mform->addElement('text', 'subject', get_string('subject', 'forum'), 'size="48"'); $mform->setType('subject', PARAM_TEXT); $mform->addRule('subject', get_string('required'), 'required', null, 'client'); $mform->addRule('subject', get_string('maximumchars', '', 255), 'maxlength', 255, 'client'); //--------------- ENHANCED POODLL FORUM BEGIN ------------------- if ($CFG->filter_poodll_forum_video || $CFG->filter_poodll_forum_audio) { // $rtmptime = optional_param('rtmptime', time()); $mform->addElement('header', 'flvvideo', 'Voice posting'); $siteid = explode("/", $CFG->wwwroot); $siteid = str_replace(".", "_", $siteid[2]); //Justin 20081112 : add this for URLs with ports spec. by colon $siteid = str_replace(":", "-", $siteid[2]); $rtmplink = $CFG->poodll_media_server; $mediadata = '<a href="#" onclick="document.getElementById(\'teacherrecorder\').style.display=\'block\';">Record Audio/Video</a>'; $mediadata .= "<div id='teacherrecorder' style='display: none'>"; //toggle these lines to use video or audio forums if ($CFG->filter_poodll_forum_video) { //need to figure out a way to get post id on a new post ... // $mediadata .= fetchSimpleVideoRecorder('forum/' .$forum->id , $post->id); $mediadata .= fetchSimpleVideoRecorder('forum/' . $forum->id, $USER->id); } else { $mediadata .= fetchSimpleAudioRecorder('forum/' . $forum->id, $USER->id); } $mediadata .= "</div>"; $mform->addElement('static', 'description', 'Audio/Video Posting:', $mediadata); //Here we modify the existing post format, so that the html message is small and not required $mform->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols' => 50, 'rows' => 10)); $mform->setType('message', PARAM_RAW); $mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext'), false, 'editorhelpbutton'); } else { // Old Moodle Forum Stuff $mform->addElement('htmleditor', 'message', get_string('message', 'forum'), array('cols' => 50, 'rows' => 30)); $mform->setType('message', PARAM_RAW); $mform->addRule('message', get_string('required'), 'required', null, 'client'); $mform->setHelpButton('message', array('reading', 'writing', 'questions', 'richtext'), false, 'editorhelpbutton'); } //--------------- ENHANCED POODLL FORUM END ------------------- $mform->addElement('format', 'format', get_string('format')); if (isset($forum->id) && forum_is_forcesubscribed($forum)) { $mform->addElement('static', 'subscribemessage', get_string('subscription', 'forum'), get_string('everyoneissubscribed', 'forum')); $mform->addElement('hidden', 'subscribe'); $mform->setHelpButton('subscribemessage', array('subscription', get_string('subscription', 'forum'), 'forum')); } else { if (isset($forum->forcesubscribe) && $forum->forcesubscribe != FORUM_DISALLOWSUBSCRIBE || has_capability('moodle/course:manageactivities', $coursecontext)) { $options = array(); $options[0] = get_string('subscribestop', 'forum'); $options[1] = get_string('subscribestart', 'forum'); $mform->addElement('select', 'subscribe', get_string('subscription', 'forum'), $options); $mform->setHelpButton('subscribe', array('subscription', get_string('subscription', 'forum'), 'forum')); } else { if ($forum->forcesubscribe == FORUM_DISALLOWSUBSCRIBE) { $mform->addElement('static', 'subscribemessage', get_string('subscription', 'forum'), get_string('disallowsubscribe', 'forum')); $mform->addElement('hidden', 'subscribe'); $mform->setHelpButton('subscribemessage', array('subscription', get_string('subscription', 'forum'), 'forum')); } } } if ($forum->maxbytes != 1 && has_capability('mod/forum:createattachment', $modcontext)) { // 1 = No attachments at all $mform->addElement('file', 'attachment', get_string('attachment', 'forum')); $mform->setHelpButton('attachment', array('attachment', get_string('attachment', 'forum'), 'forum')); } if (empty($post->id) && has_capability('moodle/course:manageactivities', $coursecontext)) { // hack alert $mform->addElement('checkbox', 'mailnow', get_string('mailnow', 'forum')); } if (!empty($CFG->forum_enabletimedposts) && !$post->parent && has_capability('mod/forum:viewhiddentimedposts', $coursecontext)) { // hack alert $mform->addElement('header', '', get_string('displayperiod', 'forum')); $mform->addElement('date_selector', 'timestart', get_string('displaystart', 'forum'), array('optional' => true)); $mform->setHelpButton('timestart', array('displayperiod', get_string('displayperiod', 'forum'), 'forum')); $mform->addElement('date_selector', 'timeend', get_string('displayend', 'forum'), array('optional' => true)); $mform->setHelpButton('timeend', array('displayperiod', get_string('displayperiod', 'forum'), 'forum')); } else { $mform->addElement('hidden', 'timestart'); $mform->setType('timestart', PARAM_INT); $mform->addElement('hidden', 'timeend'); $mform->setType('timeend', PARAM_INT); $mform->setConstants(array('timestart' => 0, 'timeend' => 0)); } if (groups_get_activity_groupmode($cm, $course)) { // hack alert if (empty($post->groupid)) { $groupname = get_string('allparticipants'); } else { $group = groups_get_group($post->groupid); $groupname = format_string($group->name); } $mform->addElement('static', 'groupinfo', get_string('group'), $groupname); } //------------------------------------------------------------------------------- // buttons if (isset($post->edit)) { // hack alert $submit_string = get_string('savechanges'); } else { $submit_string = get_string('posttoforum', 'forum'); } $this->add_action_buttons(false, $submit_string); $mform->addElement('hidden', 'course'); $mform->setType('course', PARAM_INT); $mform->addElement('hidden', 'forum'); $mform->setType('forum', PARAM_INT); $mform->addElement('hidden', 'discussion'); $mform->setType('discussion', PARAM_INT); $mform->addElement('hidden', 'parent'); $mform->setType('parent', PARAM_INT); $mform->addElement('hidden', 'userid'); $mform->setType('userid', PARAM_INT); $mform->addElement('hidden', 'groupid'); $mform->setType('groupid', PARAM_INT); $mform->addElement('hidden', 'edit'); $mform->setType('edit', PARAM_INT); $mform->addElement('hidden', 'reply'); $mform->setType('reply', PARAM_INT); }
function definition() { global $USER, $CFG; $mform =& $this->_form; // visible elements $mform->addElement('htmleditor', 'text', get_string('submission', 'assignment'), array('cols' => 60, 'rows' => 15)); $mform->setType('text', PARAM_RAW); // to be cleaned before display $mform->setHelpButton('text', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton'); $mform->addRule('text', get_string('required'), 'required', null, 'client'); $mform->addElement('format', 'format', get_string('format')); $mform->setHelpButton('format', array('textformat', get_string('helpformatting'))); //Justin: added a Voice Recorder to the journal 20090518 //Justin: 20090519 :to allow us prefix our red5 data. //We have passed data into the variable $customdata //This is info we passed in at around #57 if ($CFG->filter_poodll_journal_video || $CFG->filter_poodll_journal_audio) { $linktext = '<a href="#" onclick="document.getElementById(\'poodllmediarecorder\').style.display=\'block\';">Record PoodLL Media</a>'; $divstarttext = "<div id='poodllmediarecorder' style='display: none'>"; if ($CFG->filter_poodll_journal_video) { //$recordertext= fetchSimpleVideoRecorder('assignment/' . $this->_customdata['cm']->id . '/' . $USER->id . '/' . time() . rand() , $USER->id); $recordertext = fetchSimpleVideoRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); } else { //$recordertext= fetchSimpleAudioRecorder('assignment/' . $this->_customdata['cm']->id . '/' . $USER->id . '/' . time() . rand() , $USER->id); $recordertext = fetchSimpleAudioRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); } $divendtext = "</div>"; $mediadata = $linktext . $divstarttext . $recordertext . $divendtext; //Add the PoodllAudio recorder. Theparams are the def filename and the DOM id of the filename html field to update $mform->addElement('static', 'description', get_string('poodllmediarecorder', 'assignment_poodlljournal'), $mediadata); } // hidden params $mform->addElement('hidden', 'id', 0); $mform->setType('id', PARAM_INT); // buttons $this->add_action_buttons(); }
function definition() { global $USER; $mform =& $this->_form; //Do we need audio or text? or both? //the customdata is info we passed in up around line 53 in the view method. switch ($this->_customdata['assignment']->var3) { case OM_REPLYVOICEONLY: //$mediadata= fetchSimpleAudioRecorder('onlinemedia' . $this->_customdata['cm']->id , $USER->id); $mediadata = fetchSimpleAudioRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); //Add the PoodllAudio recorder. Theparams are the def filename and the DOM id of the filename html field to update //$mform->addElement('static', 'description', get_string('voicerecorder', 'assignment_poodllonline'),$mediadata); $mform->addElement('static', 'description', '', $mediadata); //chosho recorder needs to know the id of the checkobox to set it. //moodle uses unpredictable ids, so we make our own checkbox when we fetch chosho recorder //$mform->addElement('checkbox', 'saveflvvoice', get_string('saverecording', 'assignment_poodllonline')); //$mform->addRule('saveflvvoice', get_string('required'), 'required', null, 'client'); break; case OM_REPLYVIDEOONLY: //$mediadata= fetchSimpleVideoRecorder('onlinemedia' . $this->_customdata['cm']->id , $USER->id); $mediadata = fetchSimpleVideoRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); $mform->addElement('static', 'description', '', $mediadata); //Add the PoodllAudio recorder. Theparams are the def filename and the DOM id of the filename html field to update //$mform->addElement('static', 'description', get_string('videorecorder', 'assignment_poodllonline'),$mediadata); //recorder needs to know the id of the checkobox to set it. //moodle uses unpredictable ids, so we make our own checkbox when we fetch chosho recorder //$mform->addElement('checkbox', 'saveflvvoice', get_string('saverecording', 'assignment_poodllonline')); //$mform->addRule('saveflvvoice', get_string('required'), 'required', null, 'client'); break; case OM_REPLYVOICETHENTEXT: //if we have no audio, we force user to make audio before text if (empty($this->_customdata['mediapath'])) { //Add the PoodllAudio recorder. Theparams are the def filename and the DOM id of the filename html field to update //$mediadata= fetchSimpleAudioRecorder('onlinemedia' . $this->_customdata['cm']->id , $USER->id); $mediadata = fetchSimpleAudioRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); //moodle uses unpredictable ids, so we make our own checkbox when we fetch chosho recorder //$mform->addElement('checkbox', 'saveflvvoice', get_string('saverecording', 'assignment_poodllonline')); //$mform->addRule('saveflvvoice', get_string('required'), 'required', null, 'client'); $mform->addElement('static', 'description', '', $mediadata); //$mform->addElement('static', 'description', get_string('voicerecorder', 'assignment_poodllonline'),$mediadata); //we don't give option to write text, so break here } else { //It should be already displayed //at the top of the submission area // $mediadata= format_text('{FMS:VOICE='. $this->_customdata['mediapath'] .'}', FORMAT_HTML); // $mform->addElement('static', 'description', get_string('voicerecorder', 'assignment_poodllonline'),$mediadata); } break; case OM_REPLYVIDEOTHENTEXT: //if we have no video, we force user to make video before text if (empty($this->_customdata['mediapath'])) { //Add the Video recorder. Theparams are the def filename and the DOM id of the filename html field to update //$mediadata= fetchSimpleVideoRecorder('onlinemedia' . $this->_customdata['cm']->id , $USER->id); $mediadata = fetchSimpleVideoRecorder('assignment/' . $this->_customdata['assignment']->id, $USER->id); //moodle uses unpredictable ids, so we make our own checkbox when we fetch video recorder //$mform->addElement('checkbox', 'saveflvvoice', get_string('saverecording', 'assignment_poodllonline')); //$mform->addRule('saveflvvoice', get_string('required'), 'required', null, 'client'); $mform->addElement('static', 'description', '', $mediadata); //$mform->addElement('static', 'description', get_string('videorecorder', 'assignment_poodllonline'),$mediadata); //we don't give option to write text, so break here } else { //It should be already displayed //at the top of the submission area //$mediadata= format_text('{FMS:VIDEO='. $this->_customdata['mediapath'] .'}', FORMAT_HTML); //$mform->addElement('static', 'description', get_string('videorecorder', 'assignment_poodllonline'),$mediadata); } break; } //If we are recording text, and we do not need torecord media first //We display the text box switch ($this->_customdata['assignment']->var3) { case OM_REPLYVIDEOTHENTEXT: case OM_REPLYVOICETHENTEXT: if (empty($this->_customdata['mediapath'])) { break; } case OM_REPLYVOICEONLY: case OM_REPLYVIDEOONLY: case OM_REPLYTALKBACK: //We do not need a text box, so we just break break; case OM_REPLYTEXTONLY: default: $mediadata = ""; // visible elements $mform->addElement('htmleditor', 'text', get_string('submission', 'assignment'), array('cols' => 85, 'rows' => 30)); $mform->setType('text', PARAM_RAW); // to be cleaned before display $mform->setHelpButton('text', array('reading', 'writing', 'richtext'), false, 'editorhelpbutton'); $mform->addRule('text', get_string('required'), 'required', null, 'client'); $mform->addElement('format', 'format', get_string('format')); $mform->setHelpButton('format', array('textformat', get_string('helpformatting'))); } // hidden params $mform->addElement('hidden', 'id', 0); $mform->setType('id', PARAM_INT); // buttons $this->add_action_buttons(); }