Xataface  2.0alpha2
Xataface Application Framework
 All Data Structures Namespaces Files Functions Variables Groups Pages
webcam.php
Go to the documentation of this file.
1 <?php
2 /*******************************************************************************
3  * File: HTML/QuickForm/calendar.php
4  * Author: Steve Hannah <shannah@sfu.ca>
5  * Created: March 10, 2006
6  * Description:
7  * HMTL Quickform calendar widget. This is essentially a wrapper to use the
8  * DynArch jscalendar widget - a really cool calendar widget.
9  *
10  ******************************************************************************/
11 
12 
13 require_once 'HTML/QuickForm/file.php';
14 
15 
24 class HTML_QuickForm_webcam extends HTML_QuickForm_file {
25 
26 
27  function HTML_QuickForm_webcam($elementName=null, $elementLabel=null, $attributes=null, $properties=array())
28  {
29  if ( isset($elementName) ){
30 
31  parent::HTML_QuickForm_file($elementName, $elementLabel, $attributes);
32  }
33 
34  } //end constructor
35 
36 
37  function toHtml(){
38  $field =& $this->getFieldDef();
39 
40 
41  $ID = 'temp'.rand(1,1000000); //$_REQUEST['ID'];//get current user's ID whose video will be recorded
42  if ( $this->record and $this->record->getValue('id') ){
43  $ID = $this->record->getValue('id');
44  }
45  $value = $ID;
46 
47 //get ray directory
48 $ray_dir = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']);
49 if ( $ray_dir{strlen($ray_dir)-1} != '/' ) $ray_dir .= '/';
50 $ray_xml = $ray_dir."get_xml.php";
51  $out = <<<END
52 
53 <div class="help">If you have a web camera you can press the <em>Record</em> button below to record your piece. <a href="troubleshooting.php">Troubleshooting instructions</a>.</div>
54 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="348" height="248" id="ray_recorder" align="middle">
55 <param name="allowScriptAccess" value="always" />
56 <param name="movie" value="{$ray_dir}ray_recorder.swf" />
57 <param name="quality" value="high" />
58 <param name="wmode" value="TRANSPARENT" />
59 <param name="FlashVars" value="ID={$ID}&url={$ray_xml}" />
60 <embed
61  src="{$ray_dir}ray_recorder.swf"
62  WMODE="TRANSPARENT"
63  quality="high"
64  bgcolor="#ffffff"
65  width="348" height="248"
66  name="ray_recorder"
67  align="middle"
68  allowScriptAccess="always"
69  type="application/x-shockwave-flash"
70  FlashVars="ID={$ID}&url={$ray_xml}"
71  pluginspage="http://www.macromedia.com/go/getflashplayer" />
72 </object><br/>
73 <div class="help">Or upload a movie file from your camera, phone, or computer...</div>
74 <input name="{$this->getName()}__webcam__" type="hidden" value="{$value}" />
75 END;
76  return $out . parent::toHtml();
77 
78 
79  }
80 
81 
82 
83 
84 }
85