XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
rtsp.php
Go to the documentation of this file.
1 <?php
20 defined('XOOPS_ROOT_PATH') or die('Restricted access');
21 
23 {
24  function encode($textarea_id)
25  {
26  $config = parent::loadConfig(dirname(__FILE__));
27  $code = "<img src='{$this->image_path}/rtspimg.gif' alt='" . _XOOPS_FORM_ALTRTSP . "' onclick='xoopsCodeRtsp(\"{$textarea_id}\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERRTSPURL, ENT_QUOTES) . "\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERHEIGHT, ENT_QUOTES) . "\",\"" . htmlspecialchars(_XOOPS_FORM_ENTERWIDTH, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"hand\"'/>&nbsp;";
28  $javascript = <<<EOH
29  function xoopsCodeRtsp(id,enterRtspPhrase, enterRtspHeightPhrase, enterRtspWidthPhrase){
30  var selection = xoopsGetSelect(id);
31  if (selection.length > 0) {
32  var selection = "rtsp://"+selection;
33  var text = selection;
34  } else {
35  var text = prompt(enterRtspPhrase+" Rtsp or http", "Rtsp://");
36  }
37  var domobj = xoopsGetElementById(id);
38  if ( text.length > 0 && text!="rtsp://") {
39  var text2 = prompt(enterRtspWidthPhrase, "480");
40  var text3 = prompt(enterRtspHeightPhrase, "330");
41  var result = "[rtsp="+text2+","+text3+"]" + text + "[/rtsp]";
42  xoopsInsertText(domobj, result);
43  }
44  domobj.focus();
45  }
46 EOH;
47  return array($code, $javascript);
48  }
49 
50  function load(&$ts)
51  {
52  $ts->patterns[] = "/\[rtsp=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/rtsp\]/sU";
53  $rp = "<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" HEIGHT='\\3' ID=Player WIDTH='\\2' VIEWASTEXT>";
54  $rp .= "<param NAME=\"_ExtentX\" VALUE=\"12726\">";
55  $rp .= "<param NAME=\"_ExtentY\" VALUE=\"8520\">";
56  $rp .= "<param NAME=\"AUTOSTART\" VALUE=\"0\">";
57  $rp .= "<param NAME=\"SHUFFLE\" VALUE=\"0\">";
58  $rp .= "<param NAME=\"PREFETCH\" VALUE=\"0\">";
59  $rp .= "<param NAME=\"NOLABELS\" VALUE=\"0\">";
60  $rp .= "<param NAME=\"CONTROLS\" VALUE=\"ImageWindow\">";
61  $rp .= "<param NAME=\"CONSOLE\" VALUE=\"_master\">";
62  $rp .= "<param NAME=\"LOOP\" VALUE=\"0\">";
63  $rp .= "<param NAME=\"NUMLOOP\" VALUE=\"0\">";
64  $rp .= "<param NAME=\"CENTER\" VALUE=\"0\">";
65  $rp .= "<param NAME=\"MAINTAINASPECT\" VALUE=\"1\">";
66  $rp .= "<param NAME=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">";
67  $rp .= "<param NAME=\"SRC\" VALUE=\"\\4\">";
68  $rp .= "<embed autostart=\"0\" src=\"\\4\" type=\"audio/x-pn-realaudio-plugin\" HEIGHT='\\3' WIDTH='\\2' controls=\"ImageWindow\" console=\"cons\"> </embed>";
69  $rp .= "</object>";
70  $rp .= "<br /><object CLASSID=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA HEIGHT=32 ID=Player WIDTH='\\2' VIEWASTEXT>";
71  $rp .= "<param NAME=\"_ExtentX\" VALUE=\"18256\">";
72  $rp .= "<param NAME=\"_ExtentY\" VALUE=\"794\">";
73  $rp .= "<param NAME=\"AUTOSTART\" VALUE=\"0\">";
74  $rp .= "<param NAME=\"SHUFFLE\" VALUE=\"0\">";
75  $rp .= "<param NAME=\"PREFETCH\" VALUE=\"0\">";
76  $rp .= "<param NAME=\"NOLABELS\" VALUE=\"0\">";
77  $rp .= "<param NAME=\"CONTROLS\" VALUE=\"controlpanel\">";
78  $rp .= "<param NAME=\"CONSOLE\" VALUE=\"_master\">";
79  $rp .= "<param NAME=\"LOOP\" VALUE=\"0\">";
80  $rp .= "<param NAME=\"NUMLOOP\" VALUE=\"0\">";
81  $rp .= "<param NAME=\"CENTER\" VALUE=\"0\">";
82  $rp .= "<param NAME=\"MAINTAINASPECT\" VALUE=\"0\">";
83  $rp .= "<param NAME=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">";
84  $rp .= "<param NAME=\"SRC\" VALUE=\"\\4\">";
85  $rp .= "<embed autostart=\"0\" src=\"\\4\" type=\"audio/x-pn-realaudio-plugin\" HEIGHT='30' WIDTH='\\2' controls=\"ControlPanel\" console=\"cons\"> </embed>";
86  $rp .= "</object>";
87 
88  $ts->replacements[] = $rp;
89  }
90 }
91 ?>