XOOPS  2.6.0
rtsp.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
25 {
30  public function encode($textarea_id)
31  {
32  $code = "<img src='{$this->image_path}/rtspimg.gif' alt='" . XoopsLocale::REAL_PLAYER . "' onclick='xoopsCodeRtsp(\"{$textarea_id}\",\"" . htmlspecialchars(XoopsLocale::RTSP_URL, ENT_QUOTES) . "\",\"" . htmlspecialchars(XoopsLocale::HEIGHT, ENT_QUOTES) . "\",\"" . htmlspecialchars(XoopsLocale::WIDTH, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"hand\"'/>&nbsp;";
33  $javascript = <<<EOH
34  function xoopsCodeRtsp(id,enterRtspPhrase, enterRtspHeightPhrase, enterRtspWidthPhrase){
35  var selection = xoopsGetSelect(id);
36  if (selection.length > 0) {
37  var selection = "rtsp://"+selection;
38  var text = selection;
39  } else {
40  var text = prompt(enterRtspPhrase+" Rtsp or http", "Rtsp://");
41  }
42  var domobj = xoopsGetElementById(id);
43  if ( text.length > 0 && text!="rtsp://") {
44  var text2 = prompt(enterRtspWidthPhrase, "480");
45  var text3 = prompt(enterRtspHeightPhrase, "330");
46  var result = "[rtsp="+text2+","+text3+"]" + text + "[/rtsp]";
47  xoopsInsertText(domobj, result);
48  }
49  domobj.focus();
50  }
51 EOH;
52  return array($code, $javascript);
53  }
54 
59  public function load(MyTextSanitizer &$ts)
60  {
61  $ts->patterns[] = "/\[rtsp=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/rtsp\]/sU";
62  $rp = "<object classid=\"clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA\" HEIGHT='\\3' ID=Player WIDTH='\\2' VIEWASTEXT>";
63  $rp .= "<param NAME=\"_ExtentX\" VALUE=\"12726\">";
64  $rp .= "<param NAME=\"_ExtentY\" VALUE=\"8520\">";
65  $rp .= "<param NAME=\"AUTOSTART\" VALUE=\"0\">";
66  $rp .= "<param NAME=\"SHUFFLE\" VALUE=\"0\">";
67  $rp .= "<param NAME=\"PREFETCH\" VALUE=\"0\">";
68  $rp .= "<param NAME=\"NOLABELS\" VALUE=\"0\">";
69  $rp .= "<param NAME=\"CONTROLS\" VALUE=\"ImageWindow\">";
70  $rp .= "<param NAME=\"CONSOLE\" VALUE=\"_master\">";
71  $rp .= "<param NAME=\"LOOP\" VALUE=\"0\">";
72  $rp .= "<param NAME=\"NUMLOOP\" VALUE=\"0\">";
73  $rp .= "<param NAME=\"CENTER\" VALUE=\"0\">";
74  $rp .= "<param NAME=\"MAINTAINASPECT\" VALUE=\"1\">";
75  $rp .= "<param NAME=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">";
76  $rp .= "<param NAME=\"SRC\" VALUE=\"\\4\">";
77  $rp .= "<embed autostart=\"0\" src=\"\\4\" type=\"audio/x-pn-realaudio-plugin\" HEIGHT='\\3' WIDTH='\\2' controls=\"ImageWindow\" console=\"cons\"> </embed>";
78  $rp .= "</object>";
79  $rp .= "<br /><object CLASSID=clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA HEIGHT=32 ID=Player WIDTH='\\2' VIEWASTEXT>";
80  $rp .= "<param NAME=\"_ExtentX\" VALUE=\"18256\">";
81  $rp .= "<param NAME=\"_ExtentY\" VALUE=\"794\">";
82  $rp .= "<param NAME=\"AUTOSTART\" VALUE=\"0\">";
83  $rp .= "<param NAME=\"SHUFFLE\" VALUE=\"0\">";
84  $rp .= "<param NAME=\"PREFETCH\" VALUE=\"0\">";
85  $rp .= "<param NAME=\"NOLABELS\" VALUE=\"0\">";
86  $rp .= "<param NAME=\"CONTROLS\" VALUE=\"controlpanel\">";
87  $rp .= "<param NAME=\"CONSOLE\" VALUE=\"_master\">";
88  $rp .= "<param NAME=\"LOOP\" VALUE=\"0\">";
89  $rp .= "<param NAME=\"NUMLOOP\" VALUE=\"0\">";
90  $rp .= "<param NAME=\"CENTER\" VALUE=\"0\">";
91  $rp .= "<param NAME=\"MAINTAINASPECT\" VALUE=\"0\">";
92  $rp .= "<param NAME=\"BACKGROUNDCOLOR\" VALUE=\"#000000\">";
93  $rp .= "<param NAME=\"SRC\" VALUE=\"\\4\">";
94  $rp .= "<embed autostart=\"0\" src=\"\\4\" type=\"audio/x-pn-realaudio-plugin\" HEIGHT='30' WIDTH='\\2' controls=\"ControlPanel\" console=\"cons\"> </embed>";
95  $rp .= "</object>";
96 
97  $ts->replacements[] = $rp;
98  }
99 }
encode($textarea_id)
Definition: rtsp.php:30
load(MyTextSanitizer &$ts)
Definition: rtsp.php:59
const REAL_PLAYER
Definition: en_US.php:943
const RTSP_URL
Definition: en_US.php:961
const HEIGHT
Definition: en_US.php:459
$code
Definition: lostpass.php:48