XOOPS  2.6.0
mms.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}/mmssrc.gif' alt='" . XoopsLocale::MMS . "' onclick='xoopsCodeMms(\"{$textarea_id}\",\"" . htmlspecialchars(XoopsLocale::WIDTH, ENT_QUOTES) . "\");' onmouseover='style.cursor=\"hand\"'/>&nbsp;";
33  $javascript = <<<EOH
34  function xoopsCodeMms(id,enterMmsPhrase, enterMmsHeightPhrase, enterMmsWidthPhrase)
35  {
36  var selection = xoopsGetSelect(id);
37  if (selection.length > 0) {
38  var selection="mms://"+selection;
39  var text = selection;
40  } else {
41  var text = prompt(enterMmsPhrase+" mms or http", "mms://");
42  }
43  var domobj = xoopsGetElementById(id);
44  if ( text.length > 0 && text != "mms://") {
45  var text2 = prompt(enterMmsWidthPhrase, "480");
46  var text3 = prompt(enterMmsHeightPhrase, "330");
47  var result = "[mms="+text2+","+text3+"]" + text + "[/mms]";
48  xoopsInsertText(domobj, result);
49  }
50  domobj.focus();
51  }
52 EOH;
53  return array(
55  );
56  }
57 
62  public function load(MyTextSanitizer &$ts)
63  {
64  $ts->patterns[] = "/\[mms=(['\"]?)([^\"']*),([^\"']*)\\1]([^\"]*)\[\/mms\]/sU";
65  $rp = "<OBJECT id=videowindow1 height='\\3' width='\\2' classid='CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6'>";
66  $rp .= "<PARAM NAME=\"URL\" VALUE=\"\\4\">";
67  $rp .= "<PARAM NAME=\"rate\" VALUE=\"1\">";
68  $rp .= "<PARAM NAME=\"balance\" VALUE=\"0\">";
69  $rp .= "<PARAM NAME=\"currentPosition\" VALUE=\"0\">";
70  $rp .= "<PARAM NAME=\"defaultFrame\" VALUE=\"\">";
71  $rp .= "<PARAM NAME=\"playCount\" VALUE=\"1\">";
72  $rp .= "<PARAM NAME=\"autoStart\" VALUE=\"0\">";
73  $rp .= "<PARAM NAME=\"currentMarker\" VALUE=\"0\">";
74  $rp .= "<PARAM NAME=\"invokeURLs\" VALUE=\"-1\">";
75  $rp .= "<PARAM NAME=\"baseURL\" VALUE=\"\">";
76  $rp .= "<PARAM NAME=\"volume\" VALUE=\"50\">";
77  $rp .= "<PARAM NAME=\"mute\" VALUE=\"0\">";
78  $rp .= "<PARAM NAME=\"uiMode\" VALUE=\"full\">";
79  $rp .= "<PARAM NAME=\"stretchToFit\" VALUE=\"0\">";
80  $rp .= "<PARAM NAME=\"windowlessVideo\" VALUE=\"0\">";
81  $rp .= "<PARAM NAME=\"enabled\" VALUE=\"-1\">";
82  $rp .= "<PARAM NAME=\"enableContextMenu\" VALUE=\"-1\">";
83  $rp .= "<PARAM NAME=\"fullScreen\" VALUE=\"0\">";
84  $rp .= "<PARAM NAME=\"SAMIStyle\" VALUE=\"\">";
85  $rp .= "<PARAM NAME=\"SAMILang\" VALUE=\"\">";
86  $rp .= "<PARAM NAME=\"SAMIFilename\" VALUE=\"\">";
87  $rp .= "<PARAM NAME=\"captioningID\" VALUE=\"\">";
88  $rp .= "<PARAM NAME=\"enableErrorDialogs\" VALUE=\"0\">";
89  $rp .= "<PARAM NAME=\"_cx\" VALUE=\"12700\">";
90  $rp .= "<PARAM NAME=\"_cy\" VALUE=\"8731\">";
91  $rp .= "</OBJECT>";
92  $ts->replacements[] = $rp;
93 
94  return true;
95  }
96 }
Definition: mms.php:24
encode($textarea_id)
Definition: mms.php:30
load(MyTextSanitizer &$ts)
Definition: mms.php:62
$code
Definition: lostpass.php:48